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

figured out an approach through which I could shutdown and launch move_base depending on map transitions.

Although i wanted to relaod costmaps for a new map published, this does the same. Used the ROS launch API and restructured the usage for my requirement with a move_base launch.

I'll post a basic overlay of usage here.

import roslaunch
import rospy

rospy.init_node('en_Mapping', anonymous=True)
uuid = roslaunch.rlutil.get_or_generate_uuid(None, False)
roslaunch.configure_logging(uuid)
launch = roslaunch.parent.ROSLaunchParent(uuid, ["/home/haier/catkin_ws/src/testapi/launch/test_node.launch"])
launch.start()
rospy.loginfo("started")

rospy.sleep(3)
# 3 seconds later
launch.shutdown()

The uuid can't be used again once launch.shutdown() is initiated. So for a procedural relaunch, this has to be adjusted.