Ask Your Question
0

"Install" a .patch

asked 2012-09-20 14:44:44 -0600

borth gravatar image

updated 2012-09-20 14:51:00 -0600

I've seen you guys have made several fixes(.patch) for ROS, some that would be very useful for me, however, I can't find anything that tells me how to "install" them in my ROS Fuerte, actually I'm pretty confused even about where to put the fixes. So, how do I do it?

edit retag flag offensive close merge delete

Comments

Could you please be more specific by giving an example?

Mani gravatar imageMani ( 2012-09-20 15:31:45 -0600 )edit

Well, https://code.ros.org/trac/ros/ticket/3949 here there are some patches to use ROS with Python 3 , but how I use them?

borth gravatar imageborth ( 2012-09-20 17:26:47 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
5

answered 2012-09-20 18:27:48 -0600

Hi,

patches are nothing you can simply install. Those .patch files are normally diffs of the source code (means it contains the changes to the source code that have been made to fix a bug).

So in general (I think this also applies for ROS) you need to download the ROS source code first (svn checkout) and then apply a .patch to the source code. You can read up on how to create and apply patches here.

Cheers Felix

edit flag offensive delete link more
0

answered 2012-09-21 02:48:04 -0600

Jakub gravatar image

updated 2012-09-21 03:22:37 -0600

The official way of applying custom patches is to work with overlays. Check what is overlay question as starting point.


For hackers knowing what they are doing (especially for non-Ubuntu users):

Ros packages always come with the source code. Only if you work on Ubuntu and install via apt-get you receive both source code and precompiled modules.

To install a patch, you have to:

  • apply the patch to the source code (usually subdirectory src/ in package directory)
  • delete ROS_NO_BUILD file from the package top directory
  • run "rosmake" from the package top directory, or "rosmake package_name" from anywhere

As the ROS distro is usually installed in /opt/ros directory, you need to sudo all the above tasks.

Be aware, that whenever you upgrade your ROS distro with apt-get upgrade all your patches will be lost, as new version of precompiled modules will be installed.

To avoid that, the best practice is to work with overlay as described at the beginning of the answer.

edit flag offensive delete link more

Comments

Never ever change anything in /opt/ros nor delete the ROS_NOBUILD file. That's exactly what overlays are for and overlays are the only correct solution.

Lorenz gravatar imageLorenz ( 2012-09-21 02:55:29 -0600 )edit

@Lorenz. That's the meaning of last statement. If you not using the Ubuntu distribution you don't get precompiled modules and you need to make rosmake all the time. So you are forced to make changes in /opt/ros. Not everybody is a fanatic of Ubuntu, remember that.

Jakub gravatar imageJakub ( 2012-09-21 03:04:08 -0600 )edit

Most people are using Ubuntu and people who don't normally know what they are doing.. I (and probably most other hard-core ROS users) believe that suggesting to make changes in /opt/ros is bad. I don't doubt that you know that, but it's important to explicitly state that such changes are bad.

Lorenz gravatar imageLorenz ( 2012-09-21 03:14:37 -0600 )edit
1

@Jakub: You said to get packages via apt-get and then patch files in /opt/ros using sudo. This is definitely the wrong way to do things. In particular this is VERY BAD if several people work on the same robot, many of which may not want the patches. This can also cause apt-get remove to fail.

KruseT gravatar imageKruseT ( 2012-09-21 03:22:41 -0600 )edit
1

Also starting with fuerte, several packages installed using apt-get do not come with sources.

KruseT gravatar imageKruseT ( 2012-09-21 03:28:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-09-20 14:44:44 -0600

Seen: 4,366 times

Last updated: Sep 21 '12