Skip to main content

object-based toolbox for robot dynamic simulation, analysis, control and planning

Project description

The latest version of this code is now hosted here: https://github.com/SherbyRobotics/pyro

example workflow

Pyro

An object-based toolbox for robot dynamic simulation, analysis, control and planning.

A collection of dynamic systems:

rocket cartpole
cartpole_swing_up mass-spring

A collection of controller synthesis and planning tools:

Computed torque controller ctc Sliding mode controller smc
Dynamic programming cost2go Optimal torque policy policy
Rapidly-exploring random tree planning rrt Direct collocation trajectory optimisation doublependulum

A collection of analysis tools:

Simulation (computing trajectories) traj Phase plane analysis phase-plane
Generating animated simulations ani Robot arm manipulability ellipsoid elp
Bode plot or output/input bode Pole zero map of output/input pz
Modal analysis (mode 1) mode1 Modal analysis (mode 2) mode2

Unified by a standardized dynamic system, controller and planner classes hierarchy

The concept of this toolbox is a hierachy of dynamic system objects, from the most generic representation (any non-linear differential equations) to more system specific representations such as mechanical system (second order equations), linear state space, manipulator equations, etc. This structure is then leveraged by analysis tools, from generic tools that work for all sub-class of dynamic systems such as running simulation and phase-plane analysis, to system-specific tools that leverage specific system propreties such as modal analysis for linear sub-class:

The core of the library is a mother dynamic system class defined by a differential equation $\dot{x} = f(x,u,t)$, and optionnaly an output equation $y = h(x,u,t)$ and a foward kinematic equation that is used for generating animations:

How to use

To learn how to use pyro, see the following notebook tutorials hosted on colab:

  1. The Dynamic System class and basic functionnality
  2. Creating a custom dynamic class
  3. Closed-loop system and controllers objects
  4. The Linear System class (comin soon..)
  5. The Mechanical System class (coming soon..)
  6. The Manipulator Robot class

Also see exemples scripts in pyro/examples/

and tutorial video (in french) on youtube: here

Installation

Dependencies

Pyro is built only using core python librairies:

  • numpy
  • scipy
  • matplotlib

Using in Colab

!git clone https://github.com/SherbyRobotics/pyro
import sys
sys.path.append('/content/pyro')
import pyro

Using with Anaconda and Spyder IDE

1. Download anaconda python distribution

Download anaconda (including spyder IDE) available here: https://www.anaconda.com/products/individual

2. Dowload pyro source code.

option a) Using git to clone the repo:

git clone https://github.com/SherbyRobotics/pyro.git

in the folder of your choice.

option b) Download the .zip using the Code/Download Zip link at the top of this page, and then unzip in the folder of your choice.

3. Add the pyro folder to the pythonpath

option a) [Easy spyder IDE only] Add it this the spyder menu at python/PYTHONPATH manager.

In order to run pyro in the terminal directly of in another IDE like VS code, option b) or c) should be used.

option b) [conda]

conda develop /PATH/TO/PYRO

option c) [pip] Go to the root directory of the pyro folder and run:

python -m pip install -e .
Graphical backend debuging

By default pyro will try to use matplotlib Qt5Agg backend and interactive mode. You can modify the default graphical behavior by modifying the headers of the file pyro/analysis/graphical.py In spyder IDE, you cand also change the graphics backend in the menu at python/Preferences/IPython console/Backend. Inline does not allow animations, it is best to use Automatic (for Windows and Ubuntu) or OS X (for Mac).

Pyro tools list

Dynamic objects

  • Continuous Dynamic system : $\dot{x} = f(x,u)$
  • Linear System : $\dot{x} = A x + B u $
    • Transfer function
    • Exemples: mass-spring-damper
  • Mechanical System : $H(q)\ddot{q} + C(\dot{q},q)\dot{q} = \sum F $
    • Manipulator Robot : $\dot{r} = J(q) \dot{q}$
      • Exemples: two link plananr robot
      • Exemples: five link plannar robot
      • Exemples: three link robot
    • Exemples: single pendulum
    • Exemples: double pendulum
    • Exemples: cart-pole
    • Exemples: planar drone
    • Exemples: rocket
  • Exemples: bicycle model (planar vehicle)

Controller objects

  • Linear
  • PID
  • LQR
  • Computed-Torque
  • Sliding-mode controller
  • End-point impedance controller for robot arms
  • End-point trajectory controller for robot arms
  • Tabular look-up table controller (generated by the value-iteration algorithm)

Planner objects

  1. RRT tree search
  2. Direct collocation trajectory optimisation
  3. Dynamic programming and value-iteration

Analysis tool

  • Copmuting simulation
  • Phase-plane analysis
  • Graphical animated output of the simulations
  • Cost function computation
  • Linearisation (from any dynamic class to the state-space class)
  • Modal analysis
  • Pole/zero computation
  • Bode plot
  • Reachability

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyro_udes-3.0.tar.gz (260.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyro_udes-3.0-py3-none-any.whl (129.4 kB view details)

Uploaded Python 3

File details

Details for the file pyro_udes-3.0.tar.gz.

File metadata

  • Download URL: pyro_udes-3.0.tar.gz
  • Upload date:
  • Size: 260.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pyro_udes-3.0.tar.gz
Algorithm Hash digest
SHA256 1b230aa4d83e7b8c7795088993ace0f51ca375bc3ee3e9cddf988b284a6e1fd2
MD5 29e4f23155d252a5929b87fbfafbbb42
BLAKE2b-256 28caafa7f0bd27dab856e5d2db71a275c1ac44e5d94318ebe196deb085573931

See more details on using hashes here.

File details

Details for the file pyro_udes-3.0-py3-none-any.whl.

File metadata

  • Download URL: pyro_udes-3.0-py3-none-any.whl
  • Upload date:
  • Size: 129.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pyro_udes-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dd1aa02c7711ee753ed3ac93cbe3ba67cc08c9ff20dc3fc7e762c9d99bb0c4c
MD5 4a7ca42ce9e3cbd042bc865ace052ed7
BLAKE2b-256 0fb8977bd3fafe15c933b128310e5be1291c3a24a49573308ce34fec979d3b62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page