Skip to content

Commit 970e48b

Browse files
committed
Add base files
Signed-off-by: Carlos San Vicente <[email protected]>
1 parent 58fba19 commit 970e48b

File tree

5 files changed

+120
-0
lines changed

5 files changed

+120
-0
lines changed

.github/workflows/colcon-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build and test
2+
on:
3+
push:
4+
branches: rolling
5+
pull_request:
6+
branches: rolling
7+
jobs:
8+
build-and-test:
9+
runs-on: [ubuntu-18.04]
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ros_distribution:
14+
- galactic
15+
include:
16+
# Galactic Geochelone (May 2021 - November 2022)
17+
- docker_image: ubuntu:focal
18+
ros_distribution: galactic
19+
ros_version: 2
20+
container:
21+
image: ${{ matrix.docker_image }}
22+
steps:
23+
- name: Setup ROS 2
24+
uses: ros-tooling/[email protected]
25+
with:
26+
required-ros-distributions: ${{ matrix.ros_distribution }}
27+
- name: Run Tests
28+
uses: ros-tooling/[email protected]
29+
with:
30+
package-name: ros2_realtime_examples
31+
target-ros2-distro: ${{ matrix.ros_distribution }}
32+
- name: Upload Logs
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: colcon-logs
36+
path: ros_ws/log
37+
if: always()

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Minimal ROS 2 real-time cookbook recipes
2+
3+
Collection of ROS 2 minimal examples showing how to leverage different POSIX and ROS 2 features to
4+
create real-time applications.
5+
6+
7+
TODO: Add other packages after review (currently in rolling-experimental branch):
8+
* minimal_memory_lock: shows how to lock the process memory and
9+
pre-allocate dynamic memory to avoid memory page faults
10+
* minimal_deadline_qos: shows how to use the DDS deadline QoS policy
11+
* minimal_lifecycle: shows how to use node lifecycle to separate configuration and runtime
12+
real-time phases
13+
* minimal_memory_check: shows how use verify that functions used in the real-time path
14+
does not allocate dynamic memory
15+
* minimal_memory_allocator: shows how to use different memory strategies to avoid dynamic
16+
memory allocations during the runtime phase
17+
* minimal_loaned_messages: shows how to use loaned messages APIs
18+
* minimal_data_sharing: shows how to use different data sharing approached to avoid
19+
blocking calls when sharing data between real-time and non real-time threads
20+
* minimal_dds_tuning: shows how to use DDS specific configurations to tune real-time
21+
related settings (TODO: add XML profiles for more DDS implementations)
22+
23+
24+
## Requirements
25+
26+
- ROS 2 rolling release
27+
- Linux based operating system (RT_PREEMPT is not mandatory to run the examples)
28+
- Privileges to set priority, scheduling and memory lock limits. This can be achieved by having
29+
root privileges or adding user privileges to `/etc/security/limits.conf`
30+
31+
32+
## Build instructions
33+
34+
### Create workspace
35+
36+
```bash
37+
$ mkdir -p ros2_realtime_examples_ws/src
38+
$ cd ros2_realtime_examples_ws/src
39+
$ git clone https://github.com/carlossvg/ros2-realtime-examples.git
40+
# Optional: Build rmw_iceoryx for zero-copy examples
41+
$ git clone https://github.com/ros2/rmw_iceoryx
42+
```
43+
44+
### Install dependencies
45+
46+
Use [rosdep](http://wiki.ros.org/ROS/Tutorials/rosdep) to install the required dependencies:
47+
48+
```bash
49+
$ cd ros2_realtime_examples_ws
50+
$ rosdep install --from-paths src/ --ignore-src
51+
```
52+
53+
### Build
54+
55+
Build examples
56+
57+
```bash
58+
$ cd ros2_realtime_examples_ws
59+
$ colcon build
60+
```
61+
62+
**Note: Some examples might require to install additional RMW implementations**

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-slate
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(ros2_realtime_examples)
3+
find_package(ament_cmake REQUIRED)
4+
ament_package()

ros2_realtime_examples/package.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="2">
4+
<name>ros2_realtime_examples</name>
5+
<version>0.0.1</version>
6+
<description>ros_realtime_examples metapackage</description>
7+
<maintainer email="[email protected]">Carlos San Vicente</maintainer>
8+
<license>Apache License 2.0</license>
9+
<author>Carlos San Vicente</author>
10+
11+
<buildtool_depend>ament_cmake</buildtool_depend>
12+
13+
<export>
14+
<build_type>ament_cmake</build_type>
15+
</export>
16+
</package>

0 commit comments

Comments
 (0)