ros2-realtime-demo / pendulum

ROS, ROS2, real-time, control, pendulum
Apache License 2.0
132 stars 38 forks source link
ade balance cart demo pendulum-demo raspberry-pi real-time robotics robotics-control ros ros2

Inverted pendulum demo

Disclaimer

This is work in progress and should be considered just as a proof of concept on how to leverage ROS 2 features to use in real-time applications. Any feedback and help to improve the project is appreciated.

Rolling branch is under active development.

Build status

Build Status [License]() GitHub issues

Table of content

Project description

The aim of this project is to show the real-time capabilities using the ROS2 framework. This project is based on the previous work made by the Open Robotics. The project uses these packages as a base.

This is the motivation of using an inverted pendulum for a real-time demo:

A classic example of a controls problem commonly solved by real-time computing is balancing an inverted pendulum. If the controller blocked for an unexpectedly long amount of time, the pendulum would fall down or go unstable. But if the controller reliably updates at a rate faster than the motor controlling the pendulum can operate, the pendulum will successfully adapt react to sensor data to balance the pendulum.

A more detailed description of demo the project design be found here: Design Article

Install instructions

Several ways to install the pendulum demo project are provided depending on the user needs.

How to run the demo

Source your workspace

If installed as an ADE image:

source /opt/ros/rolling/setup.bash

If installed from source:

cd ~/pendulum_ws
source ./install/setup.bash

Launch the demo

A complete explanation of all the possible options to run the demo can be found in the tutorial document:

For a quick test, launch the demo with rviz enabled:

ros2 launch pendulum_bringup pendulum_bringup.launch.py rviz:=True

If everything went well you should see the inverted pendulum being controlled in rviz:

pendulum_rviz

How to configure real-time settings

Instructions to configure the demo real-time settings can be found here.

How to measure real-time performance metrics

TODO

How to contribute

Make a fork using github, and make your changes. This project uses the same guidelines as all the officials ROS 2 packages, make sure that your code is compliant with cppcheck, uncrustify... After this, submit a PR and we will review as soon as possible.

Issues and feature request

Please, use the templates and make sure that you labeled them properly. Also, consider to open a PR to fix the issue or to implement a feature.