Commit de0f00fb authored by xiaoqiang_user's avatar xiaoqiang_user

fix a1 not stop

parent 3cd5890e
......@@ -9,6 +9,9 @@ import rospy
import roslaunch
import time
from galileo_serial_server.msg import GalileoStatus
import rosservice
import subprocess
import os
LAST_UPDATE_TIME = 0
VISUAL_FLAG = False
......@@ -51,4 +54,9 @@ if __name__ == "__main__":
rplidar_launch.start()
# 在停用状态下却有雷达数据
if int(time.time()) - LAST_UPDATE_TIME < 5 and not keep_running_flag:
rplidar_launch.shutdown()
if rosservice.get_service_node("/stop_motor") is not None:
cmd = "rosservice call /stop_motor"
new_env = os.environ.copy()
subprocess.Popen(
cmd, shell=True, env=new_env)
time.sleep(5)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment