PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.44k stars 13.48k forks source link

[Bug] Simulated gyro sensor data gets inverted at fast rates #23469

Open Jaeyoung-Lim opened 2 months ago

Jaeyoung-Lim commented 2 months ago

Describe the bug

I am trying to simulate a fast rotating vehicle, but the gyro data seems to get inverted at high rotating rates (~50rad/s).

I have checked the data up to the FIFO of the gyrodriver, and the data seems correct. However what comes out of the driver is not correct.

https://github.com/PX4/PX4-Autopilot/blob/75ce550db39cc5d61ba970ca5f4b6096a287827e/src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp#L249-L270

To Reproduce

Use this branch: https://github.com/PX4/PX4-Autopilot/tree/pr-monocopter

make px4_sitl gazebo-classic_monocopter

Expected behavior

In case the gyro saturates, it should report clipping rather than report some other random value

Screenshot / Media

image

Flight Log

https://review.px4.io/plot_app?log=faa25343-059d-4a67-96ca-101816085007

Software Version

https://github.com/PX4/PX4-Autopilot/tree/pr-monocopter

Flight controller

SITL

Vehicle type

None

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

No response

Additional context

No response

DronecodeBot commented 2 months ago

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/px4-sync-q-a-july-31-2024/39922/2

DronecodeBot commented 2 months ago

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/px4-sync-q-a-july-31-2024/39922/1

farhangnaderi commented 2 months ago

When landing a FW I also experienced this rotation. Not sure if related though!