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: 60 times
Last updated: Jul 20 '22
Unsubscribing from ROS Topic - Python
How do i import pyaudio to ROS Node?
Can I set initial joint positions via URDF?
launching ros launch file from program
Problems with moving the Ur16e Robot with inverse differential kinematics
[warn] Messages of type 1 arrived out of order (will print only once)