Skip to content

Commit 5227a48

Browse files
committed
2 parents e583292 + 94fb9d6 commit 5227a48

File tree

17 files changed

+908
-627
lines changed

17 files changed

+908
-627
lines changed
File renamed without changes.

CONTRIBUTORS.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
People:
22

3-
* Jesse Haviland
4-
3+
* Jesse Haviland https://github.com/jhavl
54
* Micah Huth
65
* Sam Drew
7-
* Kristian Gibson
6+
* Kristian Gibson https://github.com/Kristian-Gibson
7+
* Aditya Dua, RoboPy, https://github.com/adityadua24
8+
* Luis Fernando Lara Tobar lflara@puj.edu.co
89

9-
* Aditya Dua
1010

11-
* Luis Fernando Lara Tobar
11+
Code bases that we have borrowed from with attribution.
1212

13-
Packages:
13+
* urdfpy Matthew Matl, https://github.com/mmatl/urdfpy
14+
* xacro Jariullah Safi, 1.13.3 https://pypi.org/project/xacro/
15+
* DynamixelSDK, Robotis, https://github.com/ROBOTIS-GIT/DynamixelSDK
1416

15-
Code bases that we have borrowed from with attribution.
17+
URDF models
18+
19+
* list them here
20+
21+
STL models
1622

17-
urdfpy Matthew Matl, https://github.com/mmatl/urdfpy
18-
xacro Jariullah Safi, 1.13.3 https://pypi.org/project/xacro/
19-
DynamixelSDK, Robotis, https://github.com/ROBOTIS-GIT/DynamixelSDK
23+
* [ARTE toolbox](https://github.com/4rtur1t0) by Arturo Gil arturo.gil@umh.es

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 114 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,73 +33,141 @@ A Python implementation of the <a href="https://github.com/petercorke/robotics-t
3333

3434
## Synopsis
3535

36-
This toolbox brings robotics specific functionality to Python, and leverages the Python's advantages of portability, ubiquity and support, and the capability of the open-source ecosystem for linear algebra (numpy, scipy), graphics (matplotlib, three.js, WebGL), interactive development (jupyter, jupyterlab, mybinder.org), and documentation (sphinx).
37-
38-
The Toolbox provides tools for representing the kinematics and dynamics of serial-link manipulators - you can create your own in Denavit-Hartenberg form, import a URDF file, or use supplied models for well known robots from Franka-Emika, Kinova, Universal Robotics, Rethink as well as classical robots such as the Puma 560 and the Stanford arm.
39-
40-
The toolbox also supports mobile robots with functions for robot motion models (unicycle, bicycle), path planning algorithms (bug, distance transform, D*, PRM), kinodynamic planning (lattice, RRT), localization (EKF, particle filter), map building (EKF) and simultaneous localization and mapping (EKF).
36+
This toolbox brings robotics-specific functionality to Python, and leverages
37+
Python's advantages of portability, ubiquity and support, and the capability of
38+
the open-source ecosystem for linear algebra (numpy, scipy), graphics
39+
(matplotlib, three.js, WebGL), interactive development (jupyter, jupyterlab,
40+
mybinder.org), and documentation (sphinx).
41+
42+
The Toolbox provides tools for representing the kinematics and dynamics of
43+
serial-link manipulators - you can easily create your own in Denavit-Hartenberg
44+
form, import a URDF file, or use over 30 supplied models for well-known
45+
contemporary robots from Franka-Emika, Kinova, Universal Robotics, Rethink as
46+
well as classical robots such as the Puma 560 and the Stanford arm.
47+
48+
The toolbox will also support mobile robots with functions for robot motion models
49+
(unicycle, bicycle), path planning algorithms (bug, distance transform, D*,
50+
PRM), kinodynamic planning (lattice, RRT), localization (EKF, particle filter),
51+
map building (EKF) and simultaneous localization and mapping (EKF).
4152

4253
The Toolbox provides:
4354

44-
* code that is mature and provides a point of comparison for other implementations of the same algorithms;
45-
* routines which are generally written in a straightforward manner which allows for easy understanding, perhaps at the expense of computational efficiency.
46-
* source code which can be read for learning and teaching.
55+
* code that is mature and provides a point of comparison for other
56+
implementations of the same algorithms;
57+
* routines which are generally written in a straightforward manner which
58+
allows for easy understanding, perhaps at the expense of computational
59+
efficiency;
60+
* source code which can be read for learning and teaching;
61+
* backward compatability with the Robotics Toolbox for MATLAB
4762

4863
## Code Example
4964

65+
We will load a model of the Franka-Emika Panda robot defined classically using
66+
modified (Craig's convention) Denavit-Hartenberg notation
67+
5068
```python
51-
>>> import roboticstoolbox as rtb
52-
>>> p560 = rtb.models.DH.Puma560()
53-
>>> print(p560)
54-
55-
┏━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━┓
56-
┃θⱼ ┃ dⱼ ┃ aⱼ ┃ ⍺ⱼ ┃
57-
┣━━━╋━━━━━━━━━╋━━━━━━━━╋━━━━━━┫
58-
┃q1 ┃ 0.6720None
59-
┃q2 ┃ 00.4318None
60-
┃q3 ┃ 0.150050.0203None
61-
┃q4 ┃ 0.43180None
62-
┃q5 ┃ 00None
63-
┃q6 ┃ 00None
64-
┗━━━┻━━━━━━━━━┻━━━━━━━━┻━━━━━━┛
65-
66-
┌───┬────────────────────────────┐
67-
│qz │ 0°, 0°, 0°, 0°, 0°, 0° │
68-
│qr │ 0°, 90°, -90°, 0°, 0°, 0° │
69-
│qs │ 0°, 0°, -90°, 0°, 0°, 0° │
70-
│qn │ 0°, 45°, 180°, 0°, 45°, 0° │
71-
└───┴────────────────────────────┘
72-
73-
>>> p560.fkine([0, 0, 0, 0, 0, 0]) # forward kinematics
74-
1 0 0 0.4521
75-
0 1 0 -0.15005
76-
0 0 1 0.4318
77-
0 0 0 1
69+
import roboticstoolbox as rtb
70+
robot = rtb.models.DH.Panda()
71+
print(robot)
72+
73+
┏━━━━━━━━┳━━━━━━━━┳━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
74+
┃ aⱼ₋₁ ┃ ⍺ⱼ₋₁ ┃ θⱼ ┃ dⱼ ┃ q⁻ ┃ q⁺ ┃
75+
┣━━━━━━━━╋━━━━━━━━╋━━━━━╋━━━━━━━╋━━━━━━━━━╋━━━━━━━━┫
76+
0.00.0° ┃ q1 ┃ 0.333-166.0° ┃ 166.0° ┃
77+
0.0-90.0° ┃ q2 ┃ 0.0-101.0° ┃ 101.0° ┃
78+
0.090.0° ┃ q3 ┃ 0.316-166.0° ┃ 166.0° ┃
79+
0.082590.0° ┃ q4 ┃ 0.0-176.0° ┃ -4.0° ┃
80+
-0.0825-90.0° ┃ q5 ┃ 0.384-166.0° ┃ 166.0° ┃
81+
0.090.0° ┃ q6 ┃ 0.0-1.0° ┃ 215.0° ┃
82+
0.08890.0° ┃ q7 ┃ 0.107-166.0° ┃ 166.0° ┃
83+
┗━━━━━━━━┻━━━━━━━━┻━━━━━┻━━━━━━━┻━━━━━━━━━┻━━━━━━━━┛
84+
85+
┌─────┬───────────────────────────────────────┐
86+
│tool │ t = 0, 0, 0.1; rpy/xyz = -45°, 0°, 0° │
87+
└─────┴───────────────────────────────────────┘
88+
89+
┌─────┬─────┬────────┬─────┬───────┬─────┬───────┬──────┐
90+
│name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │
91+
├─────┼─────┼────────┼─────┼───────┼─────┼───────┼──────┤
92+
│ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │
93+
│ qr │ 0° │ -17.2° │ 0° │ -126° │ 0° │ 115° │ 45° │
94+
└─────┴─────┴────────┴─────┴───────┴─────┴───────┴──────┘
95+
96+
T = robot.fkine(robot.qz) # forward kinematics
97+
print(T)
98+
99+
0.707107 0.707107 0 0.088
100+
0.707107 -0.707107 0 0
101+
0 0 -1 0.823
102+
0 0 0 1
78103
```
104+
(Python prompts are not shown to make it easy to copy+paste the code)
79105

80-
We can animate a path
106+
We can solve inverse kinematics very easily. We first choose an SE(3) pose
107+
defined in terms of position and orientation (end-effector z-axis down (-Z) and finger
108+
orientation (+Y)).
81109

82110
```python
83-
qt = rtb.tools.trajectory.jtraj(p560.qz, p560.qr, 50)
84-
p560.plot(qt.q)
111+
from spatialmath import SE3
112+
113+
T = SE3(0.8, 0.2, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])
114+
q_pickup, *_ = robot.ikine(T) # solve IK, ignore additional outputs
115+
print(q_pickup) # display joint angles
116+
117+
[ 1.10903519 1.21806211 0.10114796 1.49547496 0.33270093 -0.29437262 -0.8927488 ]
118+
119+
print(robot.fkine(q_pickup)) # FK shows that desired end-effector pose was achieved
120+
121+
-1 -1.31387e-11-1.57726e-09 0.0999999
122+
-1.31386e-11 1 -7.46658e-08 0.2
123+
1.57726e-09-7.46658e-08-1 0.5
124+
0 0 0 1
85125
```
86126

87-
![Puma robot animation](https://github.com/petercorke/robotics-toolbox-python/raw/master/docs/figs/puma_sitting.gif)
127+
Note that because this robot is redundant we don't have any control over the arm configuration apart from end-effector pose, ie. we can't control the elbow height.
88128

89-
which uses the default matplotlib backend. We can instantiate our robot inside
90-
the 3d simulation environment
129+
We can animate a path from the upright `qz` configuration to this pickup configuration
91130

92131
```python
93-
env = rtb.backend.Sim()
94-
env.launch()
95-
env.add(p560)
132+
qt = rtb.trajectory.jtraj(robot.qz, q_pickup, 50)
133+
robot.plot(qt.q, movie='panda1.gif')
96134
```
97135

136+
![Panda trajectory animation](https://github.com/petercorke/robotics-toolbox-python/raw/master/docs/figs/panda1.gif)
137+
138+
which uses the default matplotlib backend.
139+
140+
Let's now load a URDF model of the same robotWe can instantiate our robot inside
141+
the 3d simulation environment. The kinematic representation is no longer
142+
based on Denavit-Hartenberg parameters, it is now a rigid-body tree.
143+
98144
```python
99-
# inv kienmatis example here
100-
# jacobian
145+
robot = rtb.models.URDF.Panda() # load URDF version of the Panda
146+
print(robot) # display the model
147+
148+
┌───┬──────────────┬─────────────┬──────────────┬─────────────────────────────────────────────┐
149+
id │ link │ parent │ joint │ ETS
150+
├───┼──────────────┼─────────────┼──────────────┼─────────────────────────────────────────────┤
151+
0 │ panda_link0 │ - │ │ │
152+
1 │ panda_link1 │ panda_link0 │ panda_joint1 │ tz(0.333) * Rz(q0) │
153+
2 │ panda_link2 │ panda_link1 │ panda_joint2 │ Rx(-90°) * Rz(q1) │
154+
3 │ panda_link3 │ panda_link2 │ panda_joint3 │ ty(-0.316) * Rx(90°) * Rz(q2) │
155+
4 │ panda_link4 │ panda_link3 │ panda_joint4 │ tx(0.0825) * Rx(90°) * Rz(q3) │
156+
5 │ panda_link5 │ panda_link4 │ panda_joint5 │ tx(-0.0825) * ty(0.384) * Rx(-90°) * Rz(q4) │
157+
6 │ panda_link6 │ panda_link5 │ panda_joint6 │ Rx(90°) * Rz(q5) │
158+
7 │ panda_link7 │ panda_link6 │ panda_joint7 │ tx(0.088) * Rx(90°) * Rz(q6) │
159+
8@panda_link8 │ panda_link7 │ panda_joint8 │ tz(0.107) │
160+
└───┴──────────────┴─────────────┴──────────────┴─────────────────────────────────────────────┘
161+
env = rtb.backend.Swift() # instantiate 3D browser-based visualizer
162+
env.launch() # activate it
163+
env.add(robot) # add robot to the 3D scene
164+
for qk in qt.q: # for each joint configuration on trajectory
165+
robot.q = qk # update the robot state
166+
env.step() # update visualization
101167
```
102168

169+
![URDF Panda trajectory animation](https://github.com/petercorke/robotics-toolbox-python/raw/master/docs/figs/panda2.gif)
170+
103171
# Getting going
104172

105173
## Installing

docs/figs/panda1.gif

7.67 MB
Loading

docs/figs/panda2.gif

3.88 MB
Loading

docs/source/arm_ets.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ ETS - 3D
7070
--------
7171

7272
.. autoclass:: roboticstoolbox.robot.ETS.ETS
73-
:members: rx, ry, rz, tx, ty, tz, eta, n, joints, isjoint, isconstant, isrevolute, isprismatic, axis, config, __getitem__, pop, __mul__, __repr__, __str__, T, eval, jacob0, hessian0
73+
:members: rx, ry, rz, tx, ty, tz, eta, n, joints, isjoint, isconstant, isrevolute, isprismatic, axis, config, __getitem__, pop, __mul__, __repr__, __str__, T, eval, compile, SE3, jacob0, hessian0
7474
:undoc-members:
7575
:show-inheritance:
7676

7777
ETS - 2D
7878
--------
7979

8080
.. autoclass:: roboticstoolbox.robot.ETS.ETS2
81-
:members: r, tx, ty, eta, n, joints, isjoint, isconstant, isrevolute, isprismatic, axis, config, __getitem__, pop, __mul__, __repr__, __str__, T, eval
81+
:members: r, tx, ty, eta, n, joints, isjoint, isconstant, isrevolute, isprismatic, axis, config, __getitem__, pop, __mul__, __repr__, __str__, T, eval, compile
8282
:undoc-members:
8383
:show-inheritance:
8484

0 commit comments

Comments
 (0)