ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Well, only for changing the file to play, this seems pretty overkill to me. And still limits you to have the file located at my_ros_package/bags/
, which again isn't very generic...
A few points to consider:
You could also use a launch arg, instead of the environment variable substitution. Basically change the launch file to
<launch>
<arg name="file" default="this_bag01.bag"/>
<node name="rosbag" type="play" pkg="rosbag" args="--pause $(find my_ros_package)/bags/($arg file)"/>
</launch>
and call it with roslaunch my_ros_package thelaunch_file.launch file:=otherfile.bag
.
Check out the docs about the various posibilities.
Personally, I'd definitely go for option two (actually, I'll manually launch the rosbag executable, but then again, you might need the filename somewhere else). Option one seems to me to try to accomplish the same thing, at the expense of adding another file that you'd have to change every time (which is not good for any VCS)...