Home

Awesome

banner banner

micro-ROS for RT-Thread

This is a micro-ROS library for projects based on RT-Thread RTOS.

The build process for ROS 2 and micro-ROS is based on custom meta-build system tools and CMake. SCons will handle the full build process, including dependencies, compilation and linkage.

Supported boards

Supported boards are:

BoardPlatformTransports
aurix_tc397tricoreudp

Requirements for Windows

How to add to your project

This package needs to be added manually to the RT-Thread env:

Further documentation on how to add packages to RT-Thread environment can be found on RT-Thread: Manage Software Package Index Source.

Build the library

Once the package has been enabled, the library can be build with the following command:

# Build micro-ROS library
scons --build_microros

After the library is compiled for first time the build process will be skipped, to trigger a rebuild and included the latest changes:

# Clean library
scons --clean_microros

# Rebuild
scons --build_microros

Library configuration

This section details the different library configuration options available to the user. Note that a library rebuild is needed after menuconfig modifications or new micro-ROS packages are added.

ROS 2 distribution

The target ROS 2 distribution can be configured with the menuconfig option Distribution, currently supported ROS2 distributions are:

Transport configuration

The transport can be configured with the provided user API for each type:

Extra packages

Extra packages can be added to the build process by copying the package directories on the micro-Landmark/builder/extra_packages folder. Added packages will appear on the build process log:

Downloading micro-ROS library
         - Downloaded ...

Checking extra packages
         - Adding example_interfaces

This should be used for example when adding custom messages types or custom micro-ROS packages.

Memory configuration

Memory footprint can be configured at the Micro XRCE-DDS middleware level:

ParameterDescriptionDefault value
NodesMaximum number of nodes1
PublishersMaximum number of publishers1
SubscribersMaximum number of subscribers1
ServicesMaximum number of services0
ClientsMaximum number of clients0

Further documentation on micro-ROS middleware configuration and memory footprint can be found on micro-ROS client Memory Profiling article.

Using the micro-ROS Agent

It is possible to use a micro-ROS Agent just by using this docker command:

# UDPv4 micro-ROS Agent
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO udp4 --port 8888 -v6

Examples

Simple publisher and subscriber examples are provided on the examples directory. This examples can be enabled with the Include examples menuconfig option.

The examples can be executed from the console with the Agent IP and port as arguments:

# Publisher app
msh > microros_pub 192.168.1.185 8888

# Subscriber app
msh > microros_sub 192.168.1.185 8888

Other examples and detailed documentation on micro-ROS can be found on: