Run py setup.py install
An object-based toolbox for robot dynamic simulation, analysis, control and planning.
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
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.
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/
- numpy
- scipy
- matplotlib
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).
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.
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
- Manipulator Robot
- Exemples: bicycle model (planar vehicle)
- 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 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
Available planner algorithm:
- RRT tree search
- Direct collocation trajectory optimisation
- Value-iteration