Hi everyone,
I’ve come across an issue when switching between offboard velocity control and offboard attitude control whilst in offboard mode. It appears that mode switching in this manner is limited by the update rate of the commander mode enabler at 2Hz. If you look at the image below, you can see I am initially in offboard velocity control (blue line) and then when I send offboard_control_mode/attitude to true (orange), along with attitude setpoints, it looks like the old velocity commands are persisting and the quad is oscillating between two setpoints (red line). This then stops when the commander updates velocity_enabled to false and carries on with offboard attitude control as normal. Then I’m seeing the converse issue at the end, where I stop sending attitude commands and start publishing velocity commands again with offboard_control_mode/velocity to true, and because the commander hasn’t reenabled velocity control, I’m getting a complete dropout of attitude setpoints until the commander kicks back in to check the mode change.
Is this intended behaviour? and if so, could someone advise where I could look to change the source code so that the commander checks for the mode change at a higher frequency?
Thanks!