eProsima / Micro-XRCE-DDS-Agent

Micro XRCE-DDS Agent respository. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
110 stars 77 forks source link

Override domain_id with ROS_DOMAIN_ID provided by the agent #333

Closed delihus closed 1 year ago

delihus commented 1 year ago

There was a need to select ROS_DOMAIN_ID in firmware without recompiling. Comparing this changes https://github.com/eProsima/Micro-XRCE-DDS-Agent/pull/322 and this PR https://github.com/eProsima/Micro-XRCE-DDS-Agent/pull/331 I prepared overriding client domain id. This change will override the clients domain (only when it is 255 - safe value due to the smaller domain limit) to the ROS_DOMAIN_ID configured as an environmental variable in e. g. micro-ros-agent docker container.

Tested on Nucleo-L476RG publisher example and ROSbot 2R firmware.

Here are the changes inside firmware https://github.com/husarion/rosbot_ros2_firmware/pull/20.

I prepared prebuilt docker container with these changes husarion/micro-ros-agent:humble-overrice-domain-id.

This is the example compose for ROSbot 2R or any microros serial client:

  microros:
    image: husarion/micro-ros-agent:humble-overrice-domain-id
    network_mode: host
    ipc: host
    devices:
      - ${SERIAL_PORT:?err}
    environment:
      - SERIAL_PORT
      - RMW_IMPLEMENTATION=rmw_fastrtps_cpp
      - ROS_DOMAIN_ID=2
    command: serial -D $SERIAL_PORT serial -b 576000 # -v6

image

Best regards, JD

richiprosima commented 1 year ago

Build status:

richiprosima commented 1 year ago

Build status:

pablogs9 commented 1 year ago

Please take a look at the Windows CI Warning

richiprosima commented 1 year ago

Build status:

richiprosima commented 1 year ago

Build status:

delihus commented 1 year ago

This feature shall be documented in user manual when merged.

Where can I describe the feature?

richiprosima commented 1 year ago

Build status:

pablogs9 commented 1 year ago

Where can I describe the feature?

Don't worry @delihus, we can do it here https://github.com/eProsima/Micro-XRCE-DDS-docs after the PR is merged