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

I have successfully implement it using some trick. I compiled a c program with the following fraction of codes

system(roslaunch slam_gmapping.launch); //In this launch file, put slam_gmapping node so that required='true' system("rosbag play bagfile.bag"); system("rosrun map_server map_saver"); system("rosnode kill slam_gmapping");

Firstly, the program launch slam_gmapping.launch. This launch file was set such that required='true' for slam_gmapping node. Then, play the rosbag. After the rosbag play finished, the map is saved (at this time, the slam_gmapping.launch is still running and the map will definitely be available). Then, the slam_gmapping node is killed and thus killing the launch file safely (since the required='true' is set to the node).

I have successfully implement it using some trick. I compiled a c program with the following fraction of codes

system(roslaunch slam_gmapping.launch); slam_gmapping.launch &); //In this launch file, put slam_gmapping node so that required='true' required='true'

system("rosbag play bagfile.bag"); bagfile.bag");

system("rosrun map_server map_saver"); map_saver");

system("rosnode kill slam_gmapping");

Firstly, the program launch slam_gmapping.launch. This launch file was set such that required='true' for slam_gmapping node. Then, play the rosbag. After the rosbag play finished, the map is saved (at this time, the slam_gmapping.launch is still running and the map will definitely be available). Then, the slam_gmapping node is killed and thus killing the launch file safely (since the required='true' is set to the node).