Skip to content

Commit 2b36075

Browse files
committed
add simple examples
1 parent 79f5240 commit 2b36075

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

examples/puma_fdyn.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import roboticstoolbox as rtb
2+
3+
# load a model with inertial parameters
4+
p560 = rtb.models.DH.Puma560()
5+
6+
# remove Coulomb friction
7+
p560 = p560.nofriction()
8+
9+
# print the kinematic & dynamic parameters
10+
p560.printdyn()
11+
12+
# simulate motion over 5s with zero torque input
13+
d = p560.fdyn(5, p560.qr, dt=0.05)
14+
15+
# show the joint angle trajectory
16+
rtb.tools.trajectory.qplot(d.q)
17+
18+
# animate it
19+
p560.plot(d.q.T) # movie='falling_puma.gif')

examples/puma_jtraj.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import roboticstoolbox as rtb
2+
from spatialmath import *
3+
4+
5+
p560 = rtb.models.DH.Puma560()
6+
print(p560)
7+
tw, T0 = p560.twists(p560.qn)
8+
print(tw)
9+
qt = rtb.tools.trajectory.jtraj(p560.qr, p560.qz, 50)
10+
p560.plot(qt.q.T, dt=100, movie='puma_sitting.gif')

0 commit comments

Comments
 (0)