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

Revision history [back]

click to hide/show revision 1
initial version

Here is a good starting place for writing launch files. In general, all of your nodes/parameters can and should be run via launch files. This allows for the most control over your programs. Though, at times, it might not be advisable to restart all processes when you're trying to debug a single node. In that instance, you can use the command line to launch that process separately, just so you can kill/restart it at your leisure.

Here is an example of how to launch a bagfile via roslaunch. The one thing that you should also note is that if your program relies on the timestamp of incoming messages, you should set the use_sim_time parameter in your launch file so that your nodes will use the bagfile's timestamp instead of the PC's. You can do that by putting the following in your launch file:

<param name="use_sim_time" value="true" />

And just to help you out, here is example of how to use the republish node via launchfile (it's not explicitly obvious from reading the tutorials I've provided.

<node name="republish" type="republish" pkg="image_transport" output="screen" args="compressed in:=/axis_camera raw out:=/axis_camera/image_raw" />

As for using multiple bagfiles at the same time, you might run into some problems, since rosbag has limitations on recording the time exactly. As such, you might find that your bag times don't sync up. If this is the case, you can try using the rosbag API and the associated Cookbook to try and solve your problem.