Skip to content

Commit 6af61ad

Browse files
committed
feat: Add ROS 2 Lyrical support
- Add ROS 2 Lyrical dev and MCU environment package configurations - Add portenta_h7_m7_lyrical test environment and matrix workflow entry - Add C/C++ build patches for modern ROS 2 APIs: * rclc: rcl_timer_init2 adaptation with backward compatibility macros * rclc_lifecycle: initialize clock in rcl_lifecycle_state_machine_init * rcutils: RCUTILS_NO_THREAD_SUPPORT guards for base64 map * rosidl_buffer: C++11/14 std::is_same value compatibility and -fno-exceptions guards * ament_cmake_ros: ignore test fixture packages during dev environment build - Guard optional extra_packages folder in library_builder - Cleanly un-nest modern ROS 2 include directories in package_mcu_library() - Forward SCons toolchain environment in extra_script.py for seamless cross-compilation
1 parent cfee17f commit 6af61ad

7 files changed

Lines changed: 330 additions & 59 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, esp32dev_ethernet, portenta_h7_m7_humble, portenta_h7_m7_jazzy, portenta_h7_m7_kilted, portenta_h7_m7_rolling, teensy41_custom, pico, pico2]
19+
platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, esp32dev_ethernet, portenta_h7_m7_humble, portenta_h7_m7_jazzy, portenta_h7_m7_kilted, portenta_h7_m7_lyrical, portenta_h7_m7_rolling, teensy41_custom, pico, pico2]
2020

2121
steps:
2222
- uses: actions/checkout@v5

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ The target ROS 2 distribution can be configured with the `board_microros_distro
102102
- `humble`
103103
- `jazzy`
104104
- `kilted` *(default value)*
105+
- `lyrical`
105106
- `rolling`
106107

107108
### Transport configuration

‎ci/platformio.ini‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ board_microros_distro = kilted
2828
lib_deps =
2929
../
3030

31+
; Lyrical test
32+
[env:portenta_h7_m7_lyrical]
33+
platform = ststm32
34+
board = portenta_h7_m7
35+
framework = arduino
36+
board_microros_transport = serial
37+
board_microros_distro = lyrical
38+
lib_deps =
39+
../
40+
3141
; Rolling test
3242
[env:portenta_h7_m7_rolling]
3343
platform = ststm32
@@ -206,3 +216,4 @@ framework = arduino
206216
board_microros_transport = custom
207217
lib_deps =
208218
../
219+

‎ci/src/main.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void setup() {
126126
&timer,
127127
&support,
128128
RCL_MS_TO_NS(100),
129-
timer_callback));
129+
(rcl_timer_callback_t) timer_callback));
130130

131131
// create executor
132132
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));

‎extra_script.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,13 @@ def build_microros(*args, **kwargs):
104104
env['CC'],
105105
env['CXX'],
106106
env['AR'],
107-
"{} {} -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='".format(' '.join(env['CFLAGS']), ' '.join(env['CCFLAGS'])),
107+
"{} {} -Wno-error=implicit-function-declaration -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='".format(' '.join(env['CFLAGS']), ' '.join(env['CCFLAGS'])),
108108
"{} {} -fno-rtti -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='".format(' '.join(env['CXXFLAGS']), ' '.join(env['CCFLAGS']))
109109
)
110110

111111
python_env_path = env['PROJECT_CORE_DIR'] + "/penv/bin/activate"
112112
builder = library_builder.Build(library_folder=main_path, packages_folder=extra_packages_path, distro=microros_distro, python_env=python_env_path)
113+
builder.env = env.get("ENV", os.environ.copy())
113114
builder.run('{}/metas/{}'.format(main_path, selected_board_meta), cmake_toolchain.path, microros_user_meta)
114115

115116
#######################################################

0 commit comments

Comments
 (0)