ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I prefer to spawn a separate bash file, e.g. which then does whatever...
sproc = subprocess.Popen("action.sh") # Can use sproc.wait() to check if the script has completed.
or you can use roslaunch library... e.g.
import rospy
from rosgraph_msgs.msg import Log
import roslaunch
rospy.init_node("my_launcher")
lidaruuid = roslaunch.rlutil.get_or_generate_uuid(None, False)
roslaunch.configure_logging(lidaruuid)
lidarlaunch = roslaunch.parent.ROSLaunchParent(
lidaruuid, ["/home/pi/catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_lidar.launch"])
lidarlaunch.start()