Skip to content

Commit

Permalink
[example] use move_gohome() replace reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
vimior committed Sep 28, 2024
1 parent 45a9521 commit 5a86d4a
Show file tree
Hide file tree
Showing 29 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions example/wrapper/common/1001-move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(x=300, y=0, z=150, roll=-180, pitch=0, yaw=0, speed=100, wait=True)
print(arm.get_position(), arm.get_position(is_radian=True))
Expand All @@ -60,7 +60,7 @@
print(arm.get_position(), arm.get_position(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(x=300, y=0, z=150, roll=-3.1415926, pitch=0, yaw=0, speed=100, is_radian=True, wait=True)
print(arm.get_position(), arm.get_position(is_radian=True))
Expand All @@ -75,5 +75,5 @@
arm.set_position(x=300, y=0, z=250, roll=-3.1415926, pitch=0, yaw=0, speed=600, is_radian=True, wait=True)
print(arm.get_position(), arm.get_position(is_radian=True))

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/common/1002-move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(x=300, y=0, z=150, roll=-180, pitch=0, yaw=0, speed=100, is_radian=False, wait=True)
print(arm.get_position(), arm.get_position(is_radian=False))
Expand All @@ -60,7 +60,7 @@
print(arm.get_position(), arm.get_position(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(x=300, y=0, z=150, roll=-3.1415926, pitch=0, yaw=0, speed=100, wait=True)
print(arm.get_position(), arm.get_position(is_radian=False))
Expand All @@ -75,5 +75,5 @@
arm.set_position(x=300, y=0, z=250, roll=-3.1415926, pitch=0, yaw=0, speed=600, wait=True)
print(arm.get_position(), arm.get_position(is_radian=False))

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/1003-relative_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(x=100, relative=True, wait=True)
print(arm.get_position(), arm.get_position(is_radian=False))
Expand All @@ -59,5 +59,5 @@
arm.set_position(y=200, z=100, relative=True, wait=True)
print(arm.get_position(), arm.get_position(is_radian=False))

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/1004-move_arc_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

paths = [
[300, 0, 150, -180, 0, 0],
Expand Down Expand Up @@ -81,5 +81,5 @@ def move():
if move() != 0:
break

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/1005-move_arc_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

paths = [
[300, 0, 150, -180, 0, 0],
Expand All @@ -62,5 +62,5 @@

arm.move_arc_lines(paths, speed=300, times=10, wait=True)

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/1006-move_tool_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_tool_position(x=100, y=0, z=0, roll=0, pitch=0, yaw=0, speed=100, wait=True)
print(arm.get_position(), arm.get_position(is_radian=True))
Expand All @@ -59,5 +59,5 @@
arm.set_tool_position(x=0, y=200, z=0, roll=0, pitch=0, yaw=0, speed=600, wait=True)
print(arm.get_position(), arm.get_position(is_radian=True))

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/1007-counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def callback_count_changed(item):
arm.register_count_changed_callback(callback_count_changed)


arm.reset(wait=True)
arm.move_gohome(wait=True)

paths = [
[300, 0, 150, -180, 0, 0],
Expand Down Expand Up @@ -91,5 +91,5 @@ def move():
break
arm.set_counter_increase()

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
2 changes: 1 addition & 1 deletion example/wrapper/common/1009-cartesian_velocity_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_state(state=0)
time.sleep(1)

arm.reset(wait=True)
arm.move_gohome(wait=True)

# set cartesian velocity control mode
arm.set_mode(5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.set_position(x=400, y=-50, z=150, roll=-180, pitch=0, yaw=0, speed=100, is_radian=False, wait=True)

# set mode: cartesian online trajectory planning mode
Expand All @@ -66,5 +66,5 @@
# set_mode: position mode
arm.set_mode(0)
arm.set_state(0)
arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
2 changes: 1 addition & 1 deletion example/wrapper/common/2000-joint_velocity_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_state(state=0)
time.sleep(1)

arm.reset(wait=True)
arm.move_gohome(wait=True)

# set joint velocity control mode
arm.set_mode(4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.set_servo_angle(angle=[-50, 0, 0, 0, 0, 0, 0], wait=True)

# set mode: joint online trajectory planning mode
Expand All @@ -68,5 +68,5 @@
# set_mode: position mode
arm.set_mode(0)
arm.set_state(0)
arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/common/3001-move_circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

poses = [
[300, 0, 100, -180, 0, 0],
Expand All @@ -63,5 +63,5 @@
ret = arm.move_circle(pose1=poses[3], pose2=poses[4], percent=200, speed=200, mvacc=1000, wait=True)
print('move_circle, ret: {}'.format(ret))

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
2 changes: 1 addition & 1 deletion example/wrapper/common/7001-servo_j.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_mode(1)
arm.set_state(0)
Expand Down
2 changes: 1 addition & 1 deletion example/wrapper/common/7002-servo_cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

arm.set_position(*[200, 0, 200, 180, 0, 0], wait=True)

Expand Down
6 changes: 3 additions & 3 deletions example/wrapper/xarm5/2001-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(angle=[90, 0, 0, 0, 0], speed=speed, wait=True)
Expand All @@ -62,7 +62,7 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)
speed = math.radians(50)
arm.set_servo_angle(angle=[math.radians(90), 0, 0, 0, 0], speed=speed, is_radian=True, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/xarm5/2002-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(angle=[90, 0, 0, 0, 0], speed=speed, is_radian=False, wait=True)
Expand All @@ -62,7 +62,7 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)
speed = math.radians(50)
arm.set_servo_angle(angle=[math.radians(90), 0, 0, 0, 0], speed=speed, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/xarm5/2003-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(servo_id=1, angle=90, speed=speed, wait=True)
Expand All @@ -61,7 +61,7 @@
arm.set_servo_angle(servo_id=3, angle=0, speed=speed, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = math.radians(50)
arm.set_servo_angle(servo_id=1, angle=math.radians(90), speed=speed, is_radian=True, wait=True)
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/xarm5/2004-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(servo_id=1, angle=90, speed=speed, is_radian=False, wait=True)
Expand All @@ -61,7 +61,7 @@
arm.set_servo_angle(servo_id=3, angle=0, speed=speed, is_radian=False, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = math.radians(50)
arm.set_servo_angle(servo_id=1, angle=math.radians(90), speed=speed, wait=True)
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
4 changes: 2 additions & 2 deletions example/wrapper/xarm5/2005-move_arc_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50

Expand All @@ -60,5 +60,5 @@
for angle in angles:
code = arm.set_servo_angle(angle=angle, speed=speed, radius=20, wait=False)

arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/xarm6/2001-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(angle=[90, 0, 0, 0, 0, 0], speed=speed, wait=True)
Expand All @@ -62,7 +62,7 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)
speed = math.radians(50)
arm.set_servo_angle(angle=[math.radians(90), 0, 0, 0, 0, 0], speed=speed, is_radian=True, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=True))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
6 changes: 3 additions & 3 deletions example/wrapper/xarm6/2002-move_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arm.set_mode(0)
arm.set_state(state=0)

arm.reset(wait=True)
arm.move_gohome(wait=True)

speed = 50
arm.set_servo_angle(angle=[90, 0, 0, 0, 0, 0], speed=speed, is_radian=False, wait=True)
Expand All @@ -62,7 +62,7 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)
speed = math.radians(50)
arm.set_servo_angle(angle=[math.radians(90), 0, 0, 0, 0, 0], speed=speed, wait=True)
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))
Expand All @@ -78,5 +78,5 @@
print(arm.get_servo_angle(), arm.get_servo_angle(is_radian=False))


arm.reset(wait=True)
arm.move_gohome(wait=True)
arm.disconnect()
Loading

0 comments on commit 5a86d4a

Please sign in to comment.