How to launch roslaunch from python script
Hi I have a simple actuator python script.
How would I run the following command: roslaunch rplidar_ros view_lidar.launch in my python file.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hi I have a simple actuator python script.
How would I run the following command: roslaunch rplidar_ros view_lidar.launch in my python file.
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()
Asked: 2022-07-12 10:43:04 -0600
Seen: 170 times
Last updated: Jul 20 '22
Launching a Python program without a #! at the top
Do I need to know any specific computer language or framework to use ROS?
Is anybody in ROS community using PySide?
Is it possible to have memory mapped messages in ROS?
Can you launch non-ROS programs from a .launch file?
Any good examples of using dynamic_reconfigure for a python node?
is there a python equivalent of fromROSMsg/toROSMsg (pcl stack)