Open elpiel opened 2 years ago
That's odd. Looks like a PX4 issue. Although v1.11 is fairly old. Can't you move to v1.13?
@julianoes I think you did not understand me correctly - everything after 0.10.1
gives this error, including:
1.11
(tested)1.12
(I think I've tested this one too)1.13
(tested):px4-gazebo-headless | WARN [PreFlightCheck] Preflight Fail: Accel Range, hold still on arming
px4-gazebo-headless | WARN [PreFlightCheck] Primary accelerometer not found
It might be due to the fact that the Docker's entrypoint changed allowing vehicle and world?!
I'm also running the container using: -v typhoon_h480 -w baylands
I think I found the problem and it's the fact that there is an error when using baylands
as the world (model world not found) which causes all these issues.
@julianoes After updating the version QGroundControl works file, however, MAVSDK server does not... It can't find the new system for some reason. Using the old 0.10.1
image, mavsdk outputs:
mavsdk-grpc-server | [10:09:52|Info ] MAVSDK version: v1.4.4 (mavsdk_impl.cpp:20)
mavsdk-grpc-server | [10:09:52|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
mavsdk-grpc-server | [10:09:55|Info ] New system on: 172.18.0.2:14580 (with sysid: 1) (udp_connection.cpp:192)
mavsdk-grpc-server | [10:09:55|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:482)
mavsdk-grpc-server | [10:09:55|Debug] Component Autopilot (1) added. (system_impl.cpp:377)
mavsdk-grpc-server | [10:09:55|Debug] MAVLink: info: [logger] file: ./log/2022-08-08/10_09_55.ulg (system_impl.cpp:250)
mavsdk-grpc-server | [10:09:56|Debug] Discovered 1 component(s) (system_impl.cpp:578)
mavsdk-grpc-server | [10:09:56|Info ] System discovered (connection_initiator.h:63)
mavsdk-grpc-server | [10:09:56|Info ] Server started (grpc_server.cpp:53)
mavsdk-grpc-server | [10:09:56|Info ] Server set to listen on 0.0.0.0:4000 (grpc_server.cpp:54)
mavsdk-grpc-server | [10:10:05|Debug] MAVLink: info: ARMED by Arm/Disarm component command (system_impl.cpp:250)
using the newer version (no change in docker-compose setup) results to only (I've tried with 1.4.4
, 1.4.0
, 1.0.8
, as you can also see I've even tried adding the service name to the command, i.e. udp://px4-gazebo-headless:14540
):
mavsdk-grpc-server | [10:27:26|Info ] MAVSDK version: v1.0.8 (mavsdk_impl.cpp:28)
mavsdk-grpc-server | [10:27:26|Info ] Waiting to discover system on udp://px4-gazebo-headless:14540... (connection_initiator.h:20)
mavsdk-grpc-server | [10:27:26|Debug] Initializing connection to remote system... (mavsdk_impl.cpp:482)
This might be related to:
px4-gazebo-headless | INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
px4-gazebo-headless | INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
This message was not present in the older 0.10.1
image and I even set my docker-compose file environment:
environment:
MAV_BROADCAST: 1
MAV_0_BROADCAST: 1
MAV_1_BROADCAST: 1
Hm, so is the change that breaks it one related to PX4 or MAVSDK? It looks like it would be PX4 but from your testing it seems to be related to MAVSDK?
I think it might be related to the image. It seems that the broadcasting changed and that's why mavsdk_server does not find the system. When I run mavsdk_server locally (without docker-compose) it finds the system and connects.
I tried different solutions like setting a custom network with static IPs:
networks:
internal-ip:
ipv4_address: 172.20.0.6 # and 172.20.0.5 for px4-gazebo-headless
networks:
internal-ip:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/24
using the services name (for mavsdk server) - udp://px4-gazebo-headless:14540
but still nothing...
It does not find any system:
mavsdk-grpc-server | [09:32:08|Info ] MAVSDK version: v1.4.4 (mavsdk_impl.cpp:20)
mavsdk-grpc-server | [09:32:08|Info ] Waiting to discover system on udp://px4-gazebo-headless:14540... (connection_initiator.h:20)
mavsdk-grpc-server | [09:32:08|Debug] Initializing connection to remote system... (mavsdk_impl.cpp:480)
Ok, so, the initial problem I had with Primary accelerometer not found
was caused by a missing world - baylands
.
I've renamed this issue because it is still an issue that should be fixed and I'm opening a new issue to track down why docker-compose
running mavsdk_server
can't discover mavlink after updating to versions > 1.10.1
Running
docker run --rm -it jonasvautherin/px4-gazebo-headless:1.13.0 -w baylands
I get:
Error Code: 11 Msg: Unable to find uri[model://baylands]
Not sure why, though. Where should the file be?
According to the docs (https://docs.px4.io/main/en/simulation/gazebo_worlds.html) the files are located in this repo:
https://github.com/PX4/PX4-SITL_gazebo/tree/main/worlds
Not sure where and how they are pulled in the PX4-Autopilot repo and SITL configuration though.
Hmm, not sure why that changed. Please let me know if you find the root cause :blush:
I'm pretty sure that this is an issue with the image itself. Prior to
1.11
(i.e. 0.10.1) this issue is not present:PX4 logs: