ROS利用python启动launch文件
记录一下,以防之后忘记
用Python代启动可以方便在仿真死机后自动shutdown restart
import roslaunch
import rospy
import time
uuid = roslaunch.rlutil.get_or_generate_uuid(None, False)
roslaunch.configure_logging(uuid)
tracking_launch = roslaunch.parent.ROSLaunchParent(
uuid, ["launch文件绝对路径"])
tracking_launch.start()
####tracking_launch.shutdown()
######以下一定要加!!!要不然会报KETBOARINTERRUPT错误
while not rospy.is_shutdown():
time.sleep(1)