-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override domain_id with ROS_DOMAIN_ID provided by the agent #333
Conversation
514de9c
to
4722043
Compare
Please take a look at the Windows CI Warning |
4d88313
to
70cd923
Compare
70cd923
to
35840b9
Compare
Signed-off-by: Jakub Delicat <[email protected]>
Signed-off-by: Jakub Delicat <[email protected]>
Signed-off-by: Jakub Delicat <[email protected]>
82c2782
to
f63e1af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature shall be documented in user manual when merged.
@@ -1242,5 +1260,15 @@ bool FastDDSMiddleware::matched_replier_from_bin( | |||
return rv; | |||
} | |||
|
|||
int16_t FastDDSMiddleware::get_domain_id_from_env(){ | |||
int16_t agent_domain_id = 0; | |||
const char * agent_domain_id_env = std::getenv( "ROS_DOMAIN_ID" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO The override of Micro XRCE-DDS Agent shall be ROS 2 agnostic. What about using XRCE_DOMAIN_ID_OVERRIDE
?
CC: @Acuadros95
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the compose would look like this if you have defined ROS_DOMAIN_ID
before.
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
- XRCE_DOMAIN_ID_OVERRIDE=${ROS_DOMAIN_ID}
# - XRCE_DOMAIN_ID_OVERRIDE=2
command: serial -D $SERIAL_PORT serial -b 576000 # -v6
Not bad. I can do this. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @pablogs9, looks cleaner
Where can I describe the feature? |
Signed-off-by: Jakub Delicat <[email protected]>
Don't worry @delihus, we can do it here https://github.com/eProsima/Micro-XRCE-DDS-docs after the PR is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested it and can confirm it works!
There was a need to select
ROS_DOMAIN_ID
in firmware without recompiling. Comparing this changes #322 and this PR #331 I prepared overriding client domain id. This change will override the clients domain (only when it is255
- safe value due to the smaller domain limit) to theROS_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 husarion/rosbot_ros2_firmware#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:
Best regards,
JD