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

How do I write my own launch files in Hydro?

asked 2014-01-06 07:00:22 -0600

Athoesen gravatar image

Does this have to be done through the catkin process or can you simply create a necessary folder structure with the requisite files? If so, how do you add it so that Hydro will recognize it since ROS_PACKAGE_PATH is used differently for Hydro than previous editions?

edit retag flag offensive close merge delete


I'm not sure to understand your problem correctly but if you want to add one folder as an extra work space you can do it in bashrc for example export ROS_PACKAGE_PATH=~/working_space:$ROS_PACKAGE_PATH

Hamid Didari gravatar image Hamid Didari  ( 2014-01-06 08:24:16 -0600 )edit

Except that I've done that and it refuses to recognize any addition to ROS_PACKAGE_PATH that isn't in /opt/ros/~. I finally got one launch working by adding the fuerte path into the package path but I can't add any folders from my desktop. I'm not sure why.

Athoesen gravatar image Athoesen  ( 2014-01-06 08:33:01 -0600 )edit

1) Does it matter if I use cd && nano .bashrc to edit it? I've already put my test directory in the .bashrc before and it didn't work to make roslaunch recognize my custom launch files. 2) I created the test package but I am unsure how this is used with launch files?

Athoesen gravatar image Athoesen  ( 2014-01-06 09:50:22 -0600 )edit

Hamid, it worked! I can run any launch file by placing it in a launch folder in that test folder. Why does it work that way? I looked all over the tutorials and could not find this. Is it because roslaunch needs all of the other stuff in the test folder? Thank you my friend!

Athoesen gravatar image Athoesen  ( 2014-01-06 11:44:28 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-01-06 09:16:00 -0600

Hamid Didari gravatar image

create one folder in your Desktop and open terminal type ($gedit .bashrc) and at the end write the following lines: (export ROS_PACKAGE_PATH=~/Desktop/(folder name):$ROS_PACKAGE_PATH) close terminal and open terminal again go to folder that you created type($roscreate-pkg test) and then type ($rosmake test) try this note: don't forget after you edited bashrc you must close the terminal and open it agian

edit flag offensive delete link more


when you create new work space and then create test pkg.test pkg directory add like other pkg directory in ros. when you call this pkg in launch file launch file can find your pkg

Hamid Didari gravatar image Hamid Didari  ( 2014-01-06 16:54:15 -0600 )edit

Thank you!

Athoesen gravatar image Athoesen  ( 2014-01-07 09:00:01 -0600 )edit

answered 2014-01-06 11:35:38 -0600

joq gravatar image

updated 2014-01-06 11:39:17 -0600

The recommended practice is to put your launch files in some package, typically in a launch/ subdirectory.

Many projects find it helpful to create a top-level ROS package containing launch files. It should depend on the lower-level packages referenced in those files.

If you release your launch package to the ROS build farm, be sure to install your launch files using the appropriate CMake commands.

edit flag offensive delete link more


Right, which I was doing. I guess that you need a CMakeLists.txt, mainpage.dox Makefile and manifest.xml or else roslaunch won't recognize the launch file?

Athoesen gravatar image Athoesen  ( 2014-01-06 11:47:45 -0600 )edit

With catkin, you need a package.xml for that directory to be recognized as a ROS package. You don't use Makefile or manifest.xml with catkin, and mainpage.dox only affects documentation.

joq gravatar image joq  ( 2014-01-06 11:49:56 -0600 )edit

Question Tools

1 follower


Asked: 2014-01-06 07:00:22 -0600

Seen: 563 times

Last updated: Jan 06 '14