8000 GitHub - G-SS/robotics-toolbox-python at
[go: up one dir, main page]

Skip to content

G-SS/robotics-toolbox-python

 
 

Repository files navigation

stability-wipBinder Python 3.6

Language grade: Python Build Status Coverage License: MIT

Robotics Toolbox for Python

RTB-P logo

This is a Python implementation of the Robotics Toolbox for MATLAB®.

Synopsis

This toolbox brings robotics specific functionality to Python, and leverages the advantages of Python such as portability, ubiquity and support, and the capability of the Python ecosystem for linear algebra (numpy, scipy), graphics (matplotlib, three.js), interactive development (jupyter, jupyterlab), documentation (sphinx).

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.

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), and a Simulink model a of non-holonomic vehicle. The Toolbox also including a detailed Simulink model for a quadrotor flying robot.

Advantages of the Toolbox are that:

  • the code is mature and provides a point of comparison for other implementations of the same algorithms;
  • the routines are generally written in a straightforward manner which allows for easy understanding, perhaps at the expense of computational efficiency. If you feel strongly about computational efficiency then you can always rewrite the function to be more efficient, compile the M-file using the MATLAB compiler, or create a MEX version;
  • since source code is available there is a benefit for understanding and teaching.

The MATLAB version of this Toolbox dates back to 1993.

Code Example

>>> import roboticstoolbox as rtb
>>> p560 = rtb.models.DH.Puma560()
>>> print(p560)

┏━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━┓
┃θⱼdⱼaⱼ   ┃  ⍺  ┃
┣━━━╋━━━━━━━━━╋━━━━━━━━╋━━━━━━┫
┃q10.6720None ┃
┃q200.4318None ┃
┃q30.150050.0203None ┃
┃q40.43180None ┃
┃q500None ┃
┃q600None ┃
┗━━━┻━━━━━━━━━┻━━━━━━━━┻━━━━━━┛

┌───┬────────────────────────────┐
│qz0°, 0°, 0°, 0°, 0°, 0°     │
│qr0°, 90°, -90°, 0°, 0°, 0°  │
│qs0°, 0°, -90°, 0°, 0°, 0°   │
│qn0°, 45°, 180°, 0°, 45°, 0° │
└───┴────────────────────────────┘

 
>>> p560.fkine([0, 0, 0, 0, 0, 0])  # forward kinematics
   1           0           0           0.4521       
   0           1           0          -0.15005      
   0           0           1           0.4318       
   0           0           0           1            

We can animate a path

qt = rtb.tools.trajectory.jtraj(p560.qz, p560.qr, 50)
p560.plot(qt.q)

Puma robot animation

which uses the default matplotlib backend. We can instantiate our robot inside the 3d simulation environment

env = rtb.backend.Sim()
env.launch()
env.add(p560)
# inv kienmatis example here
# jacobian

Getting going

Installing

From GitHub

Requires Python ≥ 3.5.

git clone https://github.com/petercorke/robotics-toolbox-python.git
cd robotics-toolbox-python
pip3 install -e .

Using pip

Install a snapshot from PyPI

pip3 install roboticstoolbox-python

Run some examples

The notebooks folder contains some tutorial Jupyter notebooks which you can browse on GitHub.

Or you can run them, and experiment with them, at mybinder.org.

About

Robotics Toolbox for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 77.1%
  • Python 22.0%
  • Other 0.9%
0