Pause button -Why Cmd 192 (reposition) instead of Cmd 193 (do pause)?

I’m interfacing a custom autopilot to QGroundControl, and at the moment I have it claiming to be a PX4 autopilot as this puts the Fly Tools up on the display whereas claiming to be a Generic autopilot does not.

I’m running into some oddities in processing the requests to button clicks on the Fly tools. In particular, the action to change altitude and the pause button. They both seem to generate a MavLink Cmd Long message #192 (Reposition), whereas I would have expected that the pause button would send Cmd # 193 (MAV_CMD_DO_PAUSE_CONTINUE).

Can somebody point me in the right direction? Where in the QGC source would I find the Fly Tools implementation?

Thanks

Kris

Ok, well it seems that looking in the PX4 firmware confirmed my suspicion.

In PX4FirmwarePlugin.cc there is this:
“void PX4FirmwarePlugin::pauseVehicle(Vehicle* vehicle)
{
vehicle->sendMavCommand(vehicle->defaultComponentId(),
MAV_CMD_DO_REPOSITION,
true, // show error if failed
-1.0f,
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE,
0.0f,
NAN,
NAN,
NAN,
NAN);
}”

And a little lower down in PX4FirmwarePlugin::guidedModeChangeAltitude()
" vehicle->sendMavCommand(vehicle->defaultComponentId(),
MAV_CMD_DO_REPOSITION,
true, // show error is fails
-1.0f,
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE,
0.0f,
NAN,
NAN,
NAN,
static_cast(vehicle->homePosition().altitude() + newAltRel));"

So, the only difference between Pause and Change Altitude is the altitude field. BUT there’s still a problem.

When I hit ‘Pause’ I receive one Cmd Long 192 Reposition message with no altitude (use default), and then I receive a second one with an altitude. This second message is indistinguishable from a change altitude message. I would have thought that the desired behavour was that pause brings the vehicle to a hover (vtol) while attempting to follow the mission plan including any scheduled altitude changes.

Perhaps I need to build a custom firmware implementation in QGC…doesn’t sound simple. Is there a guide/tutorial on this, or is it a matter of copying/modding what was done for Px4 and hoping that it all compiles/links/works.