ROS_DOMAIN_ID Change
-
Dear Researchers and Developers,
I can see PX4-related ROS 2 messages even without explicitly running any ROS 2 nodes myself.
It looks like these messages are visible under ROS_DOMAIN_ID=0.
Could you please share guidance on how to change the ROS 2 domain ID for these PX4-related messages?

-
Dear Researchers and Developers,
I can see PX4-related ROS 2 messages even without explicitly running any ROS 2 nodes myself.
It looks like these messages are visible under ROS_DOMAIN_ID=0.
Could you please share guidance on how to change the ROS 2 domain ID for these PX4-related messages?

Hey @yunwool
I would recommend writingexport ROS_DOMAIN_ID=1in your~/.bashrcand then restarting all terminals so the change takes effect. This should prevent other ROS 2 messages from appearing in your environment, since you’ll effectively be using your own domain.Optionally, you may want to look into the ROS_LOCALHOST_ONLY variable as well, since I do believe if someone else sets their domain ID to 1, you would see their messages.
-
Hey @yunwool
I would recommend writingexport ROS_DOMAIN_ID=1in your~/.bashrcand then restarting all terminals so the change takes effect. This should prevent other ROS 2 messages from appearing in your environment, since you’ll effectively be using your own domain.Optionally, you may want to look into the ROS_LOCALHOST_ONLY variable as well, since I do believe if someone else sets their domain ID to 1, you would see their messages.
@ApoorvThapliyal
Thank you for the reply.
Did you happen to add export ROS_DOMAIN_ID=1 to your ~/.bashrc?
When I do that, ROS 2 topics disappear in the VOXL shell.
However, on my laptop where ROS_DOMAIN_ID=0, I can see the ROS topics.
That’s why I posted this. -
@ApoorvThapliyal
Thank you for the reply.
Did you happen to add export ROS_DOMAIN_ID=1 to your ~/.bashrc?
When I do that, ROS 2 topics disappear in the VOXL shell.
However, on my laptop where ROS_DOMAIN_ID=0, I can see the ROS topics.
That’s why I posted this.Hey @yunwool
Did you try setting the ROS_LOCALHOST_ONLY variable to limit the topics to your local device? -
Hey @yunwool
Did you try setting the ROS_LOCALHOST_ONLY variable to limit the topics to your local device?@ApoorvThapliyal
Thank you again for the reply!
We are setting up a multi-robot system, so we are using ROS_LOCALHOST_ONLY=0.
For example, we want to set the ROS_DOMAIN_ID of drone 1 to 1 and the ROS_DOMAIN_ID of drone 2 to 2.
However, for both drones, PX4-related messages still appear under domain ID 0.
Have you tried this with two or more drones? -
@ApoorvThapliyal
Thank you again for the reply!
We are setting up a multi-robot system, so we are using ROS_LOCALHOST_ONLY=0.
For example, we want to set the ROS_DOMAIN_ID of drone 1 to 1 and the ROS_DOMAIN_ID of drone 2 to 2.
However, for both drones, PX4-related messages still appear under domain ID 0.
Have you tried this with two or more drones?Hey @yunwool
Just to be clear, consider only your first drone, if you runexport ROS_DOMAIN_ID=1, then runros2 topic list, you aren't seeing any topics right?After you set the
ROS_DOMAIN_IDof a drone to 1, to get the PX4 topics to show up, onQGC > Analyze Tools > MAVLink Console, run the following commands:param set XRCE_DDS_DOM_ID 1 param saveThen power cycle the drone, give it like 15s after boot up, then the topics should come up directly when running
ros2 topic liston that drone.
Reading along? Create a free ModalAI Forum account to join in.
With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.
Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.
Register Login