Skip to content

Commit bcce61f

Browse files
committed
new animation and example
1 parent 3059b6f commit bcce61f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/figs/panda1.gif

7.67 MB
Loading

examples/readme.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# this is the example code from the t0p-level README..d
2+
import roboticstoolbox as rtb
3+
4+
robot = rtb.models.DH.Panda()
5+
print(robot)
6+
T = robot.fkine(robot.qz)
7+
print(T)
8+
qt = rtb.trajectory.jtraj(robot.qz, robot.qr, 50)
9+
robot.plot(qt.q, movie="panda1.gif")
10+
11+
# IK
12+
from spatialmath import SE3
13+
14+
T = SE3(0.1, 0.2, 0.5) * SE3.OA([0, 1, 0], [0, 0, -1])
15+
q, *_ = robot.ikunc(T)
16+
print(q)
17+
print(robot.fkine(q))
18+
19+
# URDF model
20+
robot = rtb.models.URDF.Panda()
21+
print(robot)
22+
env = rtb.backend.Swift()
23+
env.launch()
24+
env.add(robot)
25+
for qk in qt.q:
26+
robot.q = qk
27+
env.step()

0 commit comments

Comments
 (0)