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

"Install" a .patch

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

borth gravatar image

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

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 image Mani  ( 2012-09-20 15:31:45 -0500 )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 image borth  ( 2012-09-20 17:26:47 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
5

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

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 -0500

Jakub gravatar image

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

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 image Lorenz  ( 2012-09-21 02:55:29 -0500 )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 image Jakub  ( 2012-09-21 03:04:08 -0500 )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 image Lorenz  ( 2012-09-21 03:14:37 -0500 )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 image KruseT  ( 2012-09-21 03:22:41 -0500 )edit
1

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

KruseT gravatar image KruseT  ( 2012-09-21 03:28:02 -0500 )edit

Question Tools

Stats

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

Seen: 5,244 times

Last updated: Sep 21 '12