Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Sometimes topic sensor_gps not updated in gz simulation #23130

Open
xdwgood opened this issue May 14, 2024 · 2 comments
Open

[Bug] Sometimes topic sensor_gps not updated in gz simulation #23130

xdwgood opened this issue May 14, 2024 · 2 comments

Comments

@xdwgood
Copy link
Contributor

xdwgood commented May 14, 2024

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 xdwgood changed the title [Bug] ORB_ID(sensor_gps) not updated in gz simulation [Bug] Sometimes topic sensor_gps not updated in gz simulation May 14, 2024
@xdwgood xdwgood closed this as completed May 14, 2024
@xdwgood
Copy link
Contributor Author

xdwgood commented May 14, 2024

The problem was resolved through:

sensor_gps_sim stop
sensor_gps_sim start
sensor_mag_sim stop
sensor_mag_sim start

@xdwgood xdwgood reopened this May 14, 2024
@DronecodeBot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants