Skip to content

Latest commit

 

History

History
136 lines (91 loc) · 4.91 KB

README.md

File metadata and controls

136 lines (91 loc) · 4.91 KB

Pyro

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

rocket cartpole
drone mass-spring

Library Architecture

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 "dyanmic system" class defined by a differential equation $\dot{x} = f(x,u,t)$, an output equation $y = h(x,u,t)$ and a foward kinematic equation $lines = fwd_kinematic(x,u,t)$ that is used for generating animations:

By creating a class defining these three base functions, most of the library tools can then be used directly to analyze or to generate model-based controllers.

How to use

This is a link to a tutorial, hosted on colab: https://colab.research.google.com/drive/18eEL-n-dv9JZz732nFCMtqMThDcfD2Pr?usp=sharing

Also see exemples scripts in pyro/examples/ and colab pages example availables in pyro/examples/notebooks/

Installation

Dependencies

  • numpy
  • scipy
  • matplotlib

Recommended environment (supported configuration for UdeS classes)###

Anaconda distribution + spyder IDE available here: https://www.anaconda.com/products/individual

Note: If graphical animations are not working, try changing the graphics backend. In spyder this option is found 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).

Clone repo and add to python path

A simple option for development is simply to clone the repo:

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

then add the pyro folder to the pythonpath variable of your environment. In spyder this option is found in the menu at python/PYTHONPATH manager.

Pyro internal structure

Dynamic objects

At the core of pyro is a mother-class representing generic non-linear dynamic systems, with the following nomemclature:

The main hierachy of sub-class of dynamic systems and implemented exemples are:

  • Linear System
    • Transfer function
    • Exemples: mass-spring-damper
  • Mechanical System
    • Manipulator Robot
      • 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)

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

Controller objects

Controller objects can be used to closed the loop with an operation generating a closed-loop dynamic system:

closed-loop system = controller + open-loop system

For "memoryless" controller, this operation is

Available control algorithms:

  • PID
  • LQR
  • Computed-Torque
  • Sliding-mode controller
  • End-point Impedance
  • Value-Iteration
  • End-point impedance controller for robot arms
  • End-point trajectory controller for robot arms

Planner objects

Available planner algorithm:

  1. RRT tree search
  2. Direct collocation trajectory optimisation
  3. Value-iteration