ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to edit package source code?

asked 2018-08-26 09:56:48 -0600

topkek gravatar image

I get the source code files for move base with apt-get source, but how do i put them in move_base directory so i can edit them there and it gets saved and compiled??

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-08-26 10:28:00 -0600

lucasw gravatar image

updated 2018-08-26 10:28:40 -0600

There are a variety of old answers that walk through this process: #q252478 is one. You'll want to git clone https://github.com/ros-planning/navig... (package wiki pages usually link to the source repo pages) to put the source into a catkin_ws instead of using apt-get. If you source devel/setup.sh after building you'll be using the customized version of move_base instead of the one perhaps already installed with apt.

edit flag offensive delete link more

Comments

@lucasw: @topkek has used apt-get source. That got him the sources of move_base as they were used to build the currently released version of move_base.

See #q301627 for some more context.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-26 10:44:16 -0600 )edit

Maybe this works https://askubuntu.com/questions/28372... ? Even if it does I think a regular catkin_ws + git clone is more likely to be what they want, and is on the path to pushing changes back to github and pull requests.

lucasw gravatar image lucasw  ( 2018-08-26 11:03:58 -0600 )edit
0

answered 2021-03-21 05:15:07 -0600

ParkerRobert gravatar image

updated 2021-06-27 09:14:31 -0600

Adding to this thread for future readers who may still have queries regarding this. There are 2 main ways of installing ROS packages: installing through Debian packages or installing through source. For example, if I were to download move_base for ROS kinetic, which is part of the navigation repository, I can do either of the 2 commands below:

Installing through Debian packages:

  • sudo apt-get install ros-kinetic-navigation

Installing from source:

  • cd ~/catkin_ws/src (or any workspace for that matter)
  • git clone https://github.com/ros-planning/navig...
  • cd ..
  • rosdep update
  • rosdep install --from-paths src --ignore-src -r -y (this automatically installs all dependencies for you)
  • catkin_make

Both of these would have installed the move_base package into your system. Debian packages are installed into /opt/ros/kinetic/... while Source packages are installed directly into your workspace which is catkin_ws/src in this case. The benefit of installing from source is that you can edit the source code however you feel like.

Of course if you have installed from Debian prior to this and would now like to install from source, you can simply perform the procedure to install from source and the source package will be overlayed on top of your Debian package which means ROS will look for the source package before looking for a Debian package

Additional source: https://industrial-training-master.re...

edit flag offensive delete link more

Comments

1

There's actually a bit more to building packages from source. See #q252478 for an example workflow.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-21 11:25:47 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-26 09:56:48 -0600

Seen: 1,753 times

Last updated: Jun 27 '21