While @Lorenz makes a good point about creating new packages, there are sometimes good reasons to produce patches for an existing package.
The best solution is to check out a development version of the desired package, then use the diff tool for the relevant version control system (i.e. svn diff
, hg diff
, or git diff
). That produces a patch that is easy for the maintainers to apply.
Using the gazebo_plugins
package for an example, we first locate the development repository. You can look it up on the package wiki page, or use roslocate
:
$ roslocate info gazebo_plugins
- svn:
local-name: gazebo_plugins
uri: https://code.ros.org/svn/ros-pkg/stacks/simulator_gazebo/trunk/gazebo_plugins
Note that this is a package (roslocate type gazebo_plugins
prints package
). I recommend checking out the containing stack and not just one package. The stack is the ROS unit of installation, and packages may depend on other packages within the stack.
In this example the containing stack is simulator_gazebo
:
$ roslocate info simulator_gazebo > ~/gazebo.rosinstall
$ rosinstall ~/ros ~/gazebo.rosinstall /opt/ros/electric/.rosinstall
$ source ~/ros/setup.bash
$ roscd gazebo_plugins
Test that the downloaded version works unmodified. Then, make your changes and test them.
To produce a patch:
$ roscd gazebo_plugins
$ svn diff > ~/my_gazebo_plugins.diff
If your patch fixes a bug or implements a generally useful extension to the package, open a defect or enhancement ticket for the containing stack, adding your patch as an attachment.