Skip to content

Commit 5d9a3d4

Browse files
committed
Reflect recent changes
1 parent 499407e commit 5d9a3d4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/readme.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# IK
1010
from spatialmath import SE3
1111

12-
T = SE3(0.8, 0.2, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])
13-
q_pickup, *_ = robot.ikine(T) # solve IK, ignore additional outputs
14-
print(q_pickup)# display joint angles
15-
print(robot.fkine(q_pickup)) # FK shows that desired end-effector pose was achieved
12+
T = SE3(0.7, 0.2, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])
13+
sol = robot.ikine_LMS(T) # solve IK, ignore additional outputs
14+
print(sol.q) # display joint angles
15+
print(robot.fkine(sol.q)) # FK shows that desired end-effector pose was achieved
1616

1717

18-
qt = rtb.trajectory.jtraj(robot.qz, q_pickup, 50)
19-
robot.plot(qt.q, movie="panda1.gif")
18+
qtraj = rtb.jtraj(robot.qz, sol.q, 50)
19+
robot.plot(qtraj.q, movie="panda1.gif")
2020

2121
# URDF + Swift version
2222
dt = 0.050 # simulation timestep in seconds
@@ -27,7 +27,7 @@
2727
env.launch("chrome") # activate it
2828
env.add(robot) # add robot to the 3D scene
2929
env.start_recording("panda2", 1 / dt)
30-
for qk in qt.q: # for each joint configuration on trajectory
30+
for qk in qtraj.q: # for each joint configuration on trajectory
3131
robot.q = qk # update the robot state
3232
env.step() # update visualization
3333
env.stop_recording()

0 commit comments

Comments
 (0)