I’m using RPYrT setpoints with offboard control. I see that in this mode, the attitude controller overrides the yaw rate calculated by AttitudeController::update() with the one I provide (reference pull request https://github.com/PX4/Firmware/pull/10892). However, AttitudeControl::update() still makes use of the yaw setpoint, and experiments show that this is very important.
In the pull request I mention above, @Pedro-Roque comments “At the moment, the yaw angle is kept to the same one that the UAV has (suggestions for this are welcome!)”. I’m wondering what the best thing to do about this is.
For now, I’ve modified mc_att_control_main.cpp to retrieve the yaw from the platform, and I then override my yaw setpoint (which I leave as 0) with this before calling on AttitudeControl::update(). The platform flies in the correct direction in SITL when I do this.
Can anyone comment on potential issues with my change? Is this a sensible solution to the problem mentioned by Pedro? I don’t want my offboard controller to supply a yaw setpoint; it’s running it’s own state estimation, and I also don’t want to use the attitude I receive from the px4 to set this setpoint, as I’m just going to be introducing delays with that approach.