5 from moveit_commander
import MoveGroupCommander
10 group = MoveGroupCommander(name)
14 print(name +
"do line_move")
16 pos = group.get_current_pose()
18 print(pos.pose.position)
19 group.set_joint_value_target(jbase)
22 pos = group.get_current_pose()
24 print(pos.pose.position)
28 lpos.pose.position.x = pos.pose.position.x - diff
29 group.set_pose_target(lpos)
31 lpos = group.get_current_pose()
33 print(lpos.pose.position)
35 lpos.pose.position.x = pos.pose.position.x + diff
36 group.set_pose_target(lpos)
38 lpos = group.get_current_pose()
40 print(lpos.pose.position)
44 lpos.pose.position.y = pos.pose.position.y - diff
45 group.set_pose_target(lpos)
47 lpos = group.get_current_pose()
49 print(lpos.pose.position)
51 lpos.pose.position.y = pos.pose.position.y + diff
52 group.set_pose_target(lpos)
54 lpos = group.get_current_pose()
56 print(lpos.pose.position)
60 lpos.pose.position.z = pos.pose.position.z - diff*0.2
61 group.set_pose_target(lpos)
63 lpos = group.get_current_pose()
65 print(lpos.pose.position)
67 lpos.pose.position.z = pos.pose.position.z + diff*0.2
68 group.set_pose_target(lpos)
70 lpos = group.get_current_pose()
72 print(lpos.pose.position)
75 group = MoveGroupCommander(name)
79 print(name +
"do line_move")
81 pos1 = group.get_current_pose(eef1)
83 print(pos1.pose.position)
84 pos2 = group.get_current_pose(eef2)
86 print(pos2.pose.position)
87 group.set_joint_value_target(jbase)
90 pos1 = group.get_current_pose(eef1)
92 print(pos1.pose.position)
93 pos2 = group.get_current_pose(eef2)
95 print(pos2.pose.position)
99 lpos1.pose.position.x = pos1.pose.position.x - diff
100 group.set_pose_target(lpos1,eef1)
102 lpos2.pose.position.x = pos2.pose.position.x - diff
103 group.set_pose_target(lpos2,eef2)
105 pos1 = group.get_current_pose(eef1)
107 print(pos1.pose.position)
108 pos2 = group.get_current_pose(eef2)
110 print(pos2.pose.position)
112 lpos1.pose.position.x = pos1.pose.position.x + diff
113 group.set_pose_target(lpos1,eef1)
115 lpos2.pose.position.x = pos2.pose.position.x + diff
116 group.set_pose_target(lpos2,eef2)
118 pos1 = group.get_current_pose(eef1)
120 print(pos1.pose.position)
121 pos2 = group.get_current_pose(eef2)
123 print(pos2.pose.position)
127 lpos1.pose.position.y = pos1.pose.position.y - diff
128 group.set_pose_target(lpos1,eef1)
130 lpos2.pose.position.y = pos2.pose.position.y - diff
131 group.set_pose_target(lpos2,eef2)
133 pos1 = group.get_current_pose(eef1)
135 print(pos1.pose.position)
136 pos2 = group.get_current_pose(eef2)
138 print(pos2.pose.position)
140 lpos1.pose.position.y = pos1.pose.position.y + diff
141 group.set_pose_target(lpos1,eef1)
143 lpos2.pose.position.y = pos2.pose.position.y + diff
144 group.set_pose_target(lpos2,eef2)
146 pos1 = group.get_current_pose(eef1)
148 print(pos1.pose.position)
149 pos2 = group.get_current_pose(eef2)
151 print(pos2.pose.position)
155 lpos1.pose.position.z = pos1.pose.position.z - diff*0.2
156 group.set_pose_target(lpos1,eef1)
158 lpos2.pose.position.z = pos2.pose.position.z - diff*0.2
159 group.set_pose_target(lpos2,eef2)
161 pos1 = group.get_current_pose(eef1)
163 print(pos1.pose.position)
164 pos2 = group.get_current_pose(eef2)
166 print(pos2.pose.position)
168 lpos1.pose.position.z = pos1.pose.position.z + diff*0.2
169 group.set_pose_target(lpos1,eef1)
171 lpos2.pose.position.z = pos2.pose.position.z + diff*0.2
172 group.set_pose_target(lpos2,eef2)
174 pos1 = group.get_current_pose(eef1)
176 print(pos1.pose.position)
177 pos2 = group.get_current_pose(eef2)
179 print(pos2.pose.position)
181 if __name__ ==
'__main__':
183 rospy.init_node(
"duaro_line")
185 line_move(
"lower_arm", [-1.6, 1.9, 0.045, 0.0])
186 line_move(
"upper_arm", [1.6, -1.9, 0.045, 0.0])
187 both_line_move(
"botharms",
"lower_link_j4",
"upper_link_j4", [-1.6, 1.9, 0.045, 0.0, 1.6, -1.9, 0.045, 0.0])
def line_move(name, jbase)
def both_line_move(name, eef1, eef2, jbase)