The documentation says that it’s possible to get in to offboard mode via mavlink message, but I can’t figure out what that message is.
Hi Joe,
You can use MAV_CMD_DO_SET_MODE with:
param1: VEHICLE_MODE_FLAG_CUSTOM_MODE_ENABLED (1, see commander/commander.cpp)
param 2: PX4_CUSTOM_MAIN_MODE_OFFBOARD (6, see commander/px4_custom_mode.h)
You can refer the answer.
I think that it is quite late reply, but I want to leave my answer for others who have the same problem.
You need to assign base_mode, main_mode, and sub_mode.
For instance, in order to trigger ‘position’ flight mode, you can use the following pymavlink code. I think that it will be same in dronekit code.
master.mav.command_long_send(
master.target_system, master.target_component,
mavutil.mavlink.MAV_CMD_DO_SET_MODE, 0,
base_mode, main_mode, sub_mode, 0, 0, 0, 0)
sub_mode is only defined …