|
@@ -16,6 +16,7 @@ from rospy.service import ServiceException
|
|
|
|
|
|
import actionlib_msgs.msg._GoalStatusArray
|
|
import actionlib_msgs.msg._GoalStatusArray
|
|
import sys
|
|
import sys
|
|
|
|
+import time
|
|
def wait_for_topic(topic_name, message_type):
|
|
def wait_for_topic(topic_name, message_type):
|
|
try:
|
|
try:
|
|
message = rospy.wait_for_message(topic_name, message_type, timeout=None)
|
|
message = rospy.wait_for_message(topic_name, message_type, timeout=None)
|
|
@@ -33,12 +34,17 @@ def clear_octomap():
|
|
rospy.loginfo("Failed to call /clear_octomap service or it is not available. Skipping operation.")
|
|
rospy.loginfo("Failed to call /clear_octomap service or it is not available. Skipping operation.")
|
|
|
|
|
|
waited_once = False
|
|
waited_once = False
|
|
|
|
+tim_list=[]
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|
|
command.load_rviz()
|
|
command.load_rviz()
|
|
rospy.init_node("set_update_paramter_p")
|
|
rospy.init_node("set_update_paramter_p")
|
|
|
|
|
|
# 初始化各种类型参数
|
|
# 初始化各种类型参数
|
|
- rospy.set_param("sign_control",0)
|
|
|
|
|
|
+
|
|
|
|
+ rospy.set_param("cishu",0)
|
|
|
|
+ rospy.set_param("time",0)
|
|
|
|
+
|
|
|
|
+ rospy.set_param("sign_control",1)
|
|
rospy.set_param("sign_pointcloud",0)
|
|
rospy.set_param("sign_pointcloud",0)
|
|
rospy.set_param("sign_traj_accepted",0)
|
|
rospy.set_param("sign_traj_accepted",0)
|
|
|
|
|
|
@@ -47,7 +53,7 @@ if __name__ == "__main__":
|
|
rospy.set_param("pitch_of_Horizontalweld",np.pi/4) #和底面夹角(俯仰角)
|
|
rospy.set_param("pitch_of_Horizontalweld",np.pi/4) #和底面夹角(俯仰角)
|
|
rospy.set_param("pitch_of_Verticalweld",np.pi/5)
|
|
rospy.set_param("pitch_of_Verticalweld",np.pi/5)
|
|
rospy.set_param("culling_radius",0) #焊缝剔除半径
|
|
rospy.set_param("culling_radius",0) #焊缝剔除半径
|
|
- rospy.set_param("folder_path","/home/robot/ROS/catkin_ws/data/2")
|
|
|
|
|
|
+ rospy.set_param("folder_path","/home/robot/ROS/catkin_ws/data/22")
|
|
|
|
|
|
rospy.loginfo("当前参数值:")# 显示参数当前值
|
|
rospy.loginfo("当前参数值:")# 显示参数当前值
|
|
rospy.loginfo("sign_pointcloud = %s", rospy.get_param("sign_pointcloud"))
|
|
rospy.loginfo("sign_pointcloud = %s", rospy.get_param("sign_pointcloud"))
|
|
@@ -62,8 +68,11 @@ if __name__ == "__main__":
|
|
if sign_control == "0":
|
|
if sign_control == "0":
|
|
if not waited_once:
|
|
if not waited_once:
|
|
print("等待点云数据准备完成...")
|
|
print("等待点云数据准备完成...")
|
|
- sys.stdin.flush()#清空键盘缓冲区
|
|
|
|
- aaa=input("请选择 1-2: ")
|
|
|
|
|
|
+ # sys.stdin.flush()#清空键盘缓冲区
|
|
|
|
+ # aaa=input("请选择 1-2: ")
|
|
|
|
+ aaa='2'
|
|
|
|
+
|
|
|
|
+ rospy.set_param("cishu",rospy.get_param("cishu")+1)
|
|
if(aaa =='1' or aaa=='2'):
|
|
if(aaa =='1' or aaa=='2'):
|
|
rospy.set_param("sign_control",aaa)
|
|
rospy.set_param("sign_control",aaa)
|
|
else:
|
|
else:
|
|
@@ -100,15 +109,25 @@ if __name__ == "__main__":
|
|
waited_once = False
|
|
waited_once = False
|
|
|
|
|
|
elif sign_control == "2":
|
|
elif sign_control == "2":
|
|
|
|
+ tim=time.time()
|
|
|
|
+ rospy.set_param("time",0)
|
|
# 重置参数
|
|
# 重置参数
|
|
#rospy.set_param("sign_control",0)
|
|
#rospy.set_param("sign_control",0)
|
|
rospy.set_param("sign_traj_accepted",0)
|
|
rospy.set_param("sign_traj_accepted",0)
|
|
-
|
|
|
|
|
|
+ hjsx.run()
|
|
|
|
+ hanqiangpose.run()
|
|
process = multiprocessing.Process(target=command.launch_moveit_control_server_background)
|
|
process = multiprocessing.Process(target=command.launch_moveit_control_server_background)
|
|
process.start()
|
|
process.start()
|
|
|
|
|
|
while rospy.get_param("sign_control"):
|
|
while rospy.get_param("sign_control"):
|
|
pass
|
|
pass
|
|
|
|
+
|
|
|
|
+ tim=time.time()-tim
|
|
|
|
+ tim_list.append(tim)
|
|
|
|
+ print("-------------------------------------")
|
|
|
|
+ print(f'第{rospy.get_param("cishu")}次规划:')
|
|
|
|
+ print(tim_list)
|
|
|
|
+ print("")
|
|
#运行结束,重置参数
|
|
#运行结束,重置参数
|
|
waited_once = False
|
|
waited_once = False
|
|
|
|
|