|
@@ -60,7 +60,7 @@ class MoveIt_Control:
|
|
|
|
|
|
self.arm.set_num_planning_attempts(10)
|
|
|
|
|
|
-
|
|
|
+
|
|
|
self.go_home()
|
|
|
self.home_pose=self.get_now_pose()
|
|
|
|
|
@@ -197,7 +197,7 @@ class MoveIt_Control:
|
|
|
self.arm.clear_path_constraints()
|
|
|
|
|
|
return points,trajectory,trajectory_with_type,er
|
|
|
-
|
|
|
+
|
|
|
|
|
|
def move_pl(self,point,points,trajectory,trajectory_with_type,a=1,v=1):
|
|
|
|
|
@@ -213,7 +213,7 @@ class MoveIt_Control:
|
|
|
|
|
|
self.arm.set_pose_target(point, self.end_effector_link)
|
|
|
|
|
|
-
|
|
|
+
|
|
|
path_constraints = self.create_path_constraints(points[-1],point)
|
|
|
self.arm.set_path_constraints(path_constraints)
|
|
|
|
|
@@ -545,6 +545,7 @@ def ROS2PY_msgs(msgs, m_sr):
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
def get_valid_input(factor, default):
|
|
|
while True:
|
|
|
user_input=input(factor)
|
|
@@ -585,30 +586,6 @@ def ROS2_msgs(msgs, m_sr):
|
|
|
for point in py_msgs.point.xyz_list:
|
|
|
file.write(' '.join(str(value) for value in point)+ "\n")
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
if __name__ =="__main__":
|
|
|
|
|
@@ -619,14 +596,14 @@ if __name__ =="__main__":
|
|
|
moveit_server = MoveIt_Control(is_use_gripper=False)
|
|
|
welding_sequence = rospy.get_param('welding_sequence')
|
|
|
|
|
|
-
|
|
|
- speed_v=get_user_input()
|
|
|
- rospy.loginfo(f"用户输入的速度缩放因子为{speed_v}")
|
|
|
+ speed_v=1.0
|
|
|
+
|
|
|
+
|
|
|
|
|
|
trajectory,trajectory_merge,trajectory_with_type_merge = moveit_server.path_planning(folder_path)
|
|
|
- ROS2_msgs(trajectory_with_type_merge,moveit_server)
|
|
|
+
|
|
|
|
|
|
|
|
|
moveit_server.arm.execute(trajectory_merge)
|
|
|
|
|
|
- rospy.set_param("sign_control",0)
|
|
|
+ rospy.set_param("sign_control",0)
|