Closed elpiel closed 1 year ago
Ok, this gives me a headache.
When I don't pass any parameters to mavsdk_server (it uses udp://:14540
by default) and although mavlink says:
px4-gazebo-headless | 14540 will be associated to 172.20.0.6
( -v typhoon_h480 172.20.0.6
)
somehow the system is found on 172.20.0.5:14580
.
In a nutshell: You have to use a custom subnet and assign static IPs for mavsdk & mavlink (and pass that IP to the entrypoint script) otherwise the system is not found.
I also tried (but mavsdk_server still does not find it):
0.0.0.0
to entrypoint script, with default mavsdk param udp://:14540
0.0.0.0
to entrypoint & udp://0.0.0.0:14540
for mavsdkmavsdk-grpc-server | [10:05:12|Info ] MAVSDK version: v1.4.4 (mavsdk_impl.cpp:20)
mavsdk-grpc-server | [10:05:12|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
mavsdk-grpc-server | [10:05:12|Info ] New system on: 172.20.0.5:14580 (with sysid: 1) (udp_connection.cpp:192)
mavsdk-grpc-server | [10:05:12|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:482)
mavsdk-grpc-server | [10:05:12|Debug] Component Autopilot (1) added. (system_impl.cpp:377)
mavsdk-grpc-server | [10:05:12|Debug] Component Gimbal (154) added. (system_impl.cpp:377)
mavsdk-grpc-server | [10:05:13|Debug] Discovered 2 component(s) (system_impl.cpp:578)
mavsdk-grpc-server | [10:05:13|Info ] System discovered (connection_initiator.h:63)
mavsdk-grpc-server | [10:05:13|Info ] Server started (grpc_server.cpp:53)
This docker-compose setup now works:
https://github.com/AeroRust/mav/blob/658bbbe934a99c17616d4dded2a6c0030d456ba3/docker-compose.yml
I'm not sure why it's not finding the system anymore directly even though the port is published on the host.
Image version == 1.10.1
The key line this one which does not happen on newer versions of the image:
px4-gazebo-headless | MAV_BROADCAST: curr: 0 -> new: 1
After the broadcast is changed, mavsdk_server running in docker finds it and it works.Image version > 1.10.1
Using later versions
> 1.10.1
this is the output I get with no arguments passed to the container:I tried different solutions like:
Setting a custom network with static IPs:
Using the services name (for mavsdk server) -
udp://px4-gazebo-headless:14540
...It does not find any system:
I'm passing Environment variables:
but still nothing