examples/microros_sub: Add minimal Int32 subscriber example.#3521
Merged
Conversation
Mirror of microros_pub for the receive direction. Creates a node, subscribes to /nuttx_sub with std_msgs/Int32, drives an rclc_executor spin loop, and prints each received value. Exercises the new rclc_executor + subscription callback path on top of the microros_transport library shipped in apps/system/microros. Validates the NuttX-native transport in the agent->client direction end-to-end against a micro-ROS agent + ros2 topic pub on the host. Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Member
|
FYI: I restarted the CI Build to fix the Docker Image |
xiaoxiang781216
approved these changes
Jun 4, 2026
xiaoxiang781216
approved these changes
Jun 4, 2026
lupyuen
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 7 of the micro-ROS on NuttX integration. Adds
apps/examples/microros_sub,a minimal Int32 subscriber that mirrors the
microros_pubexample merged in#3512 for the receive direction.
The example creates a
nuttx_sub_node, subscribes to/nuttx_subwithstd_msgs/msg/Int32, registers a callback viarclc_executor_add_subscription,and enters
rclc_executor_spin. Each received value is printed via NSH. Itexercises the rclc_executor + subscription callback path on top of the
NuttX-native
microros_transportlibrary that was wired up in Phase 6.Depends on:
Impact
EXAMPLES_MICROROS_SUBKconfig entry underApplication Configuration > Examples, gated onSYSTEM_MICROROS.Default
n; existing configs are unaffected.microros_transportlibrary andSYSTEM_MICROROSinclude layout.enabled (UDP via NuttX sockets or serial via TERMIOS) can run the example.
Testing
Host: Ubuntu 22.04.5 LTS (jammy), x86_64, Linux 6.8.0-1055-aws,
gcc 11.4.0, AWS EC2 m7i-flex.large (2 vCPU, 7.6 GB RAM).
Target: NuttX
sim:nshon Linux, UDP transport over TAP.1. checkpatch
2. Build with pub + sub both enabled
Result:
nuttxELF produced, bothmicroros_pub_mainandmicroros_sub_mainlinked.
3. Sub-only build (pub disabled)
Verifies the new example does not regress when the existing publisher example
is turned off and that
microros_transportstill links cleanly with just thesubscriber as a consumer.
4. End-to-end runtime against a micro-ROS agent
Agent (host, separate terminal):
NuttX sim:
Host publishes (in another terminal):
NuttX sim output:
All values delivered in order to the registered callback via
rclc_executor_spin, confirming the agent → client direction of theNuttX-native transport plus the rclc_executor subscription path works
end-to-end.