Skip to content

Commit

Permalink
baseline structure and initial documents.
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Staschulat <jan.staschulat@de.bosch.com>
  • Loading branch information
JanStaschulat committed Feb 16, 2023
1 parent e0ec7a7 commit 602be3d
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 7 deletions.
15 changes: 15 additions & 0 deletions source/Concepts/About-Real-Time.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _RealTime:

About Real-Time
=========

.. contents:: Table of Contents
:local:

Overview
--------

* take sections from design document
* explain operating system concepts (tasks, threads, priorities)
* explain capabilities of the ROS 2 middleware
* refer to Real-Time Tutorial
Original file line number Diff line number Diff line change
@@ -1,15 +1,88 @@
.. redirect-from::
.. _RealTimeTutorial:

Real-Time-Programming
Tutorials/Real-Time-Programming

Understanding real-time programming
===================================
How to develop a Real-Time Application
======================================

.. contents:: Table of Contents
:depth: 2
:local:


TODO:
* create outline of the Tutorial
* fill each section
* update/review pendulum demo application
* possibly add the source code to github.com/ros2/examples

Overview
--------

TODO

What is real-time?
------------------
* soft real-time, hard real-time
* given bound on latency ...


Real-Time configuration options by ROS 2
----------------------------------------
TODO
* multi-threaded Executors (just high-level), reference Executor document

Real-Time configuration options by operating system
---------------------------------------------------

* pthreads (POSIX OS)
* intention using multiple cores for parallelism
* real-time Linux scheduler (FIFO)
* real-time priorities (not nice-levels)

Putting it together
----------------------------------

* using multi-threaded executor
* 2 threads with low,high priority
* pendulum demo (updated)
* drawback: can only add one node to an Executor (all callbacks of the node are treated the same)

Advanced: ROS 2 callback groups + real-time
-------------------------------------
* flexibility: group multiple callbacks from multiple nodes together
* using multi-threaded executor
* 2 threads with low, high priority
* application with 2 nodes with 2 callbacks each => how to use callback groups
* pendulum demo

Further information
-------------------
* Links to ros-realtime further documentation


Code examples
--------------

.. code-block:: cpp
int main(int argc, char* argv[])
{
// Some example code
rclcpp::init(argc, argv);
...
// Instantiate a node.
rclcpp::Node::SharedPtr node = ...
// Run the executor.
rclcpp::spin(node);
// Shutdown and exit.
...
return 0;
}
Below is a complete copy of Demos/Real-Time-Programming.rst

Background
----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
Building a real-time Linux kernel [community-contributed]
=========================================================

TODO: integrate tutorial from ros-realtime


This tutorial begins with a clean Ubuntu 20.04.1 install on Intel x86_64. Actual kernel is 5.4.0-54-generic, but we will install the Latest Stable RT_PREEMPT Version. To build the kernel you need at least 30GB free disk space.

Check https://wiki.linuxfoundation.org/realtime/start for the latest stable version, at the time of writing this is "Latest Stable Version 5.4-rt".
Expand Down

0 comments on commit 602be3d

Please sign in to comment.