PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

[Bug] Sometimes topic sensor_gps not updated in gz simulation

Open xdwgood opened this issue 1 year ago • 2 comments

Describe the bug

I tried swarm testing of 10 drones in gz. When I tried to take off the third drone, I found the following error. NOTE:The occurrence of a malfunction is a random small probability event, unless multiple drones are started in the gz simulation environment Screenshot from 2024-05-14 16-31-04

I debugged and found that the geomagnetic sensor in the gz environment relies on GPS signals. Then, I listened to sensor_gps and found that it is not updating(update 367s ago) Screenshot from 2024-05-14 16-44-55

https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/simulation/sensor_gps_sim/SensorGpsSim.cpp#L109 Because the sensor_gps publish requires _vehicle_local_position_sub. updated()&&_vehicle_global_position_sub. updated(). I listened to ORB-ID (vehicle_local_position_groundtruth) and ORB-ID (vehicle_global_position_groundtruth) and compared them with a normal takeoff drone, and did not find any issues. Screenshot from 2024-05-14 16-50-39 Screenshot from 2024-05-14 17-00-45

normal drone in gz: Screenshot from 2024-05-14 16-52-13 Screenshot from 2024-05-14 16-52-28

I also checked the running status of sensor_gps_sim and found that it was running.

I hope to receive your help,thanks

To Reproduce

Screenshot from 2024-05-14 16-55-12

Expected behavior

update sensor_gps

Screenshot / Media

No response

Flight Log

no

Software Version

main branch

Flight controller

gz

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

xdwgood avatar May 14 '24 08:05 xdwgood

The problem was resolved through:

sensor_gps_sim stop sensor_gps_sim start sensor_mag_sim stop sensor_mag_sim start

xdwgood avatar May 14 '24 09:05 xdwgood

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/unable-to-setup-compass-sensor-for-simulation/38810/2

DronecodeBot avatar May 20 '24 07:05 DronecodeBot