GithubHelp home page GithubHelp logo

zhangbaozhe / controllibrarydemo Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 1.0 5.81 MB

This repo contains demo ROS code based on Control-Toolbox and ACADO Toolkit

CMake 0.82% Shell 0.12% Python 0.15% C++ 83.03% C 7.45% MATLAB 5.94% TeX 1.62% M 0.01% Scilab 0.02% Makefile 0.36% Cython 0.32% Mercury 0.01% Forth 0.17% Objective-C 0.01%

controllibrarydemo's Introduction

Code Repo for Tutorial: Introducing Two Control Libraries -- Control Toolbox and ACADO Toolkit

This repo contains the following packages:

  • control-toolbox (modified from upstream): from https://github.com/ethz-adrl/control-toolbox
    • ct: meta package
    • ct_core: core library
    • ct_optcon: optimal control library
  • kindr: needed by control-toolbox
  • invpend_experiment: containing the necessary description of a inverted pendulum, I forked from https://github.com/linZHank/invpend_experiment
  • acado: containing ACADO source code. This folder will be ignored during catkin compilation
  • control_demo: containing demo control programs using the two libraries written in C++
    • ct_quad_circle_mpc.cpp -> executable ct_quad_circle_mpc_node: (non-linear) model predictive control for quadrotor tracking a circle using control-toolbox
    • ct_invpend_pid.cpp -> executable ct_invpend_pid_node: using one PID feedback controller to control the inverted pendulum stay stable, but not working
    • ct_invpend_lqr.cpp -> executable ct_invpend_lqr_node: using linear quadratic regulator feedback controller to control the inverted pendulum staying stable, working, but less robust
    • ct_invpend_mpc.cpp -> executable ct_invpend_mpc_node: (non-linear) model predictive control for the inverted pendulum staying stable, working
    • acado_invpend_mpc.cpp -> executable acado_invpend_mpc_node: Linear MPC for the inverted pendulum staying stable, working

Installation Guide

First, make a workspace folder, say demo_ws

$ mkdir demo_ws

Next clone this repo as src folder

$ git clone https://github.com/zhangbaozhe/ControlLibraryDemo.git src

Then install the following dependencies:

  • gflags:
    $ sudo apt install libgflags-dev
  • catkin tools:
    $ sudo apt install python-catkin-tools
    or
    $ sudo apt install python3-catkin-tools
  • Control Toolbox dependencies:
    • HPIPM & blasfeo: Go to src/control-toolbox/ct
      $ cd src/control-toolbox/ct
      $ bash install_hpipm.sh
  • invpend_experiment dependencies:
    $ sudo apt install ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-gazebo-ros ros-noetic-gazebo-ros-control
  • mavros:
    $ sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
    $ wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
    $ sudo bash ./install_geographiclib_datasets.sh 

In the workspace folder:

$ catkin build -DCMAKE_BUILD_TYPE=Release -j2

If you have more than 8GB RAM or even 16GB, you can maybe drop -j2 option. If you want compile the examples and tests in control toolbox you can type

$ catkin build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true -DBUILD_TESTS=true -j2

The compilation may take a while, since C++ templates compilation consumes huge resources.

(Optional) If you want to use the quadrotor demo, you need to use PX4-Autopilot simulation.

Executables

Run the inverted pendulum demo: In one terminal (in the workspace folder):

$ source devel/setup.bash
$ roslaunch invpend_control load_invpend.launch

In another terminal

$ source devel/setup.bash
$ rosrun control_demo ct_invpend_mpc_node

controllibrarydemo's People

Contributors

zhangbaozhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

erictonyliu

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.