You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When MPC_POS_MODE is set to simple position control (0) and the aircraft takes off in position mode the aircraft will hold altitude and position. If the right stick is moved to move the aircraft the position setpoint goes to NaN (as expected). Once the stick is released and the vehicle is in braking mode the setpoint remains as NaN. This prevents the vehicle from holding position and instead just uses 0 velocity as the hold mode which isn't very effective.
To Reproduce
set MPC_HOLD_MAX_XY to 0
set MPC_POS_MODE to Simple position control
Take off
Move right stick (mode 2 radio) out of the deadzone and then release.
Observe either the PID position mode XY graph and see that the setpoint has disappeared or look at the logs for the position setpoint.
Expected behavior
I expected the position setpoint to come back when the sticks are released and the vehicle to maintain position.
I added some printouts in the if else ladder here and found that it was entering this line, but when printing the position setpoint, it is NaN, even though the printed position is a real number.
It seems like var1.xy() = var2.xy() doesn't work? Altitude seems to work because it's only setting var1(2) = var2(2) instead of using the .xy() function.
The text was updated successfully, but these errors were encountered:
I quickly checked and the fix I linked was backported to 1.14: #22578
It went into the point release PX4 1.14.1
Can you help by requesting the source for the firmware you're using to always update to the point releases? They contain critical bugfixes like this one.
Looks like the change was added 9mo ago in their branch if I understand correctly. I must have had a very old commit as my head. Thanks for pointing me to the correct issue and pull request!
Describe the bug
When MPC_POS_MODE is set to simple position control (0) and the aircraft takes off in position mode the aircraft will hold altitude and position. If the right stick is moved to move the aircraft the position setpoint goes to NaN (as expected). Once the stick is released and the vehicle is in braking mode the setpoint remains as NaN. This prevents the vehicle from holding position and instead just uses 0 velocity as the hold mode which isn't very effective.
To Reproduce
set MPC_HOLD_MAX_XY to 0
set MPC_POS_MODE to Simple position control
Take off
Move right stick (mode 2 radio) out of the deadzone and then release.
Observe either the PID position mode XY graph and see that the setpoint has disappeared or look at the logs for the position setpoint.
Expected behavior
I expected the position setpoint to come back when the sticks are released and the vehicle to maintain position.
Screenshot / Media
No response
Flight Log
https://review.px4.io/plot_app?log=c834a12f-958e-4c93-8d69-4b2b34ca54b6
Software Version
1.14dev
Flight controller
ModalAI Voxl2 Mini
Vehicle type
Other
How are the different components wired up (including port information)
No response
Additional context
I chased this down to this line:
PX4-Autopilot/src/modules/flight_mode_manager/tasks/ManualPosition/FlightTaskManualPosition.cpp
Line 113 in 3478765
I added some printouts in the if else ladder here and found that it was entering this line, but when printing the position setpoint, it is NaN, even though the printed position is a real number.
It seems like var1.xy() = var2.xy() doesn't work? Altitude seems to work because it's only setting var1(2) = var2(2) instead of using the .xy() function.
The text was updated successfully, but these errors were encountered: