GithubHelp home page GithubHelp logo

echandler5956f / galileo Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 3.0 129.21 MB

A light-weight and extensible C++ library for Pseudospectral Collocation of Switched Systems

License: MIT License

CMake 3.10% C++ 74.95% Python 21.63% Shell 0.32%

galileo's Introduction

Galileo

A light-weight and extensible C++ library for Pseudospectral Collocation of Switched Systems using CasADi and Pinocchio.

Galileo_Sequence.mp4
Galileo.Results.mp4

See the extended abstract for details!

Documentation License BSD-3-Clause

Named after the famous scientist who posed one variation of the Brachistochrone problem, Galileo is an efficient optimal control framework that uses Gauss-Legendre Pseudospectral Collocation to solve the switched systems problem for legged robots.

Features:

✔️ Intuitive and efficient formulation of variables, cost and constraints using CasADi.

✔️ Solver interface enables using the high-performance solvers Ipopt and SNOPT.

✔️ pinocchio makes custom robot integration as simple as switching the URDF.

✔️ ROS/catkin integration (optional).

✔️ Light-weight framework makes it easy to use and extend.


InstallRunVisualizeDevelopContributePublicationsCredits


Install

The following Linux installation instructions are provided for your convenience:

From source with CMake

  1. Install Galileo's mandatory dependencies:

  2. Install Galileo's optional dependencies

CasADi Source Install

First, gather the dependencies listed here: https://github.com/casadi/casadi/wiki/InstallationLinux

Then, clone the repo and make a build folder with

git clone https://github.com/casadi/casadi.git && cd casadi && mkdir build && cd build

Now, run

cmake -DCMAKE_BUILD_TYPE=Release -DWITH_BUILD_IPOPT=ON -DWITH_IPOPT=ON -DWITH_BUILD_METIS=ON -DWITH_MUMPS=ON -DWITH_BUILD_MUMPS=ON  ..

If you have an HSL license (highly recommended, as these solvers tend to speed up convergence by ~2x for our problems, and academics can acquire one for free!), you should manually build the ThirdParty-HSL interface and then add the following CasADi flag:

 -DWITH_HSL=ON

If you want to compile CasADi with OpenMP (recomended), you can add

-DWITH_OPENMP=ON

Similarly, you can add the optional SNOPT interface with

-DWITH_SNOPT=ON

Now, build CasADi from source:

make
sudo make install

Pinocchio Source Install

First, gather the dependencies listed here: https://stack-of-tasks.github.io/pinocchio/download.html

Clone the repo and its submodules:

git clone --recursive https://github.com/stack-of-tasks/pinocchio

Checkout the Pinocchio3 preview branch

cd pinocchio && git checkout pinocchio3-preview

Make a build directory

mkdir build && cd build

Run cmake with CasADi support

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_WITH_CASADI_SUPPORT=ON ..

If you are not building the Python interface, you can add the following flag:

-DBUILD_PYTHON_INTERFACE=OFF

and then build and install with

make -j4
sudo make install

Gnuplot Optional Install

Gnuplot is our plotting library of choice. Installation is very straightforward from the package manager with:

sudo apt-get update
sudo apt-get install gnuplot

Galileo Source Install

Once you have the required dependencies for Galileo, clone the repo

git clone https://github.com/echandler5956f/Galileo.git

create a build directory

cd Galileo && mkdir build && cd build

and finally, build and install Galileo with

 cmake -DCMAKE_BUILD_TYPE=Release .. && make && sudo make install

Optionally, you can add the -DBUILD_WITH_OPENMP=ON flag to enable using OpenMP for parallel evaluation of the constraint maps (highly recommended). Note that you must have enabled the OpenMP interface when installing CasADi for this to work.

To uninstall the library, simply run

sudo make uninstall

from within the build directory.

Run

We created a test-installs folder with some simple scripts to test your CasADi + pinocchio install. Be sure to take a look if you are running into trouble. To test the actual library, please refer to the examples folder. If you have already built the repo from source, you can test it by running

build/examples/huron_test

or

build/examples/go1_test

in the main repo directory.

Visualize

The solutions output by Galileo can be easily visualized using our ROS interface.

To run Galileo and visualize a solution using Rviz, run

roslaunch galileo_ros go1_galileo_ros.launch

and in another terminal

roslaunch galileo_ros go1_galileo_ros_rviz.launch

We also support connection with https://github.com/YifuYuan/legged_control. Follow the installation instructions listed, and launch a Galileo ROS legged robot example such as

roslaunch galileo_ros go1_galileo_ros.launch

and then launch the legged control nodes as instructed on the repo's readme. The control schematic for the combined Galileo + perceptive legged_control framework is as follows:

BiQu '24 URPS

This approach has been used to deploy Galileo in Gazebo and on the real Unitree Go1 hardware.

Documentation

Doxygen

Run

doxygen

in the main directory, and then open the index.html file in the docs folder. If you are using WSL like me, you can run

cd docs/html && explorer.exe index.html

to view the doxygen output.

Develop

Right now, our main development goal is to get the framework to solve general trajectory optimization problems with fixed contact sequences in an MPC context. This is essentially the same problem that OCS2 and Crocoddyl solve. Our hope is that using Pseudospectral Collocation will yield faster convergence, and that the Casadi + Pinocchio pipeline will result in smaller, more digestible code, which is easier to expand upon than the bulky frameworks mentioned prior.

Contribute

We are open to contributions from the community! Please feel free to submit a pull request or post an issue if you have any suggestions. This framework is still in its most nascent phase, and will take time to mature. Be patient, and hopefully something good will come from this work.

Publications

Coming soon (ICRA 2025?).

Credits

Written by

  • Ethan Chandler
  • Akshay Jaitly

With contributions from

  • Yuen Lam Leung
  • Hushmand Esmaeili
  • Ibrahim Salman Al-Tameemi
  • Duc Doan
  • Zhun Cheng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.