I have a quadcopter that flies autonomous missions. Note that these missions are not standard px4 missions but my own format. They are stored on a companion computer and executed with the help of MAVSDK Python. A normal “Move” command flies the vehicle to a waypoint, using the goto_location()
command.
Now, during a mission, the user should have the possibility to change the vehicle’s yaw at any time (The gimbal has only two axes, so vehicle yaw = camera yaw). when such a “SetYaw” command is issued, the yaw adjustment should be executed immediately and other commands that may be running at the moment should not be influenced by it. E.g. a running move command should just continue to run while the yaw is adjusted.
The only yaw adjustment commands I could find are the Offboard commands like set_position_global(position_global_yaw)
. However, these commands require a complete position, which the “SetYaw” command doesn’t know. The flight controller should just continue whatever it is currently doing plus the yaw adjustment. Also, I’d have to be in Offboard mode during missions.
If I had the opportunity to directly pass mavlink messages through MAVSDK, I could use Pymavlink to generate a MAV_CMD_CONDITION_YAW message, but a mavlink passthrough only seems to exist for C++.
Is there an easy way to do this? Memorizing all running commands and reexecuting them after yaw adjustment would be possible but very tedious.