-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Description
Describe the bug
Hey,
I am having issues setting up SITL with ROS2 with two seperate docker containers on an isolated network. I found a fix by modifying a config file and think it is a bug that PX4_PARAM_UXRCE_DDS_AG_IP
is not respected.
What do I want?
Two docker containers
offboard
running ros2 and the xrce agent that is exactly the same as running on the dronepx4_sim
that simulates PX4 and the XRCE_DDS bridge to ROS2
running in an isolated network on docker defined with
networks:
isolated_network:
driver: bridge
ipam:
config:
- subnet: 172.40.0.0/16
gateway: 172.40.0.1
When using the host
network, everything works.
To Reproduce
What should work but doesn't
Using that docker network, I
- set the IP of
offboard
toipv4_address: 172.40.0.3
- configure
px4_sim
to have environment variablePX4_PARAM_UXRCE_DDS_AG_IP=-1406664701
(matching the IP Address in INT32)
I can see that environment variable being set correctly in Qgroundcontrol.
However, the bridge still does not work.
The fix
the uxrce_dds_client is started with a hardcoded IP address that overrides any environment variable.
uxrce_dds_client start -t udp -h 127.0.0.1 -p $uxrce_dds_port $uxrce_dds_ns
if I modify this line on my docker container to be
uxrce_dds_client start -t udp -p $uxrce_dds_port $uxrce_dds_ns
and restart everything, the parameter is accepted, the correct IP is set and the bridge works.
Expected behavior
No response
Screenshot / Media
No response
Flight Log
No response
Software Version
I am not sure but saw that this line exists in all latest versions and main
.
Flight controller
No response
Vehicle type
Multicopter
How are the different components wired up (including port information)
No response
Additional context
So I made it work for now by modifying that file in my docker build but it seems hacky to modify the config file and I think this is a bug and instead
- this config file should not start the client with a fixed IP
- to not break existing setups, one could set a default param to be
127.0.0.1
Thank you for your consideration. I am still new to PX4 so I hope I did not miss anything.
Also happy to make a PR :)