Unverified Commit cbe81ce1 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6613 from DonLakeFlyer/GotoCommandInt

Goto Location uses COMMAND_INT
parents 4dc7b9d6 19a63525
...@@ -428,16 +428,30 @@ void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoord ...@@ -428,16 +428,30 @@ void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoord
return; return;
} }
vehicle->sendMavCommand(vehicle->defaultComponentId(), if (vehicle->capabilityBits() && MAV_PROTOCOL_CAPABILITY_COMMAND_INT) {
MAV_CMD_DO_REPOSITION, vehicle->sendMavCommandInt(vehicle->defaultComponentId(),
true, // show error is fails MAV_CMD_DO_REPOSITION,
-1.0f, MAV_FRAME_GLOBAL,
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE, true, // show error is fails
0.0f, -1.0f,
NAN, MAV_DO_REPOSITION_FLAGS_CHANGE_MODE,
gotoCoord.latitude(), 0.0f,
gotoCoord.longitude(), NAN,
vehicle->altitudeAMSL()->rawValue().toFloat()); gotoCoord.latitude(),
gotoCoord.longitude(),
vehicle->altitudeAMSL()->rawValue().toFloat());
} else {
vehicle->sendMavCommand(vehicle->defaultComponentId(),
MAV_CMD_DO_REPOSITION,
true, // show error is fails
-1.0f,
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE,
0.0f,
NAN,
gotoCoord.latitude(),
gotoCoord.longitude(),
vehicle->altitudeAMSL()->rawValue().toFloat());
}
} }
void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange) void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange)
......
...@@ -2978,7 +2978,6 @@ void Vehicle::_sendMavCommandAgain(void) ...@@ -2978,7 +2978,6 @@ void Vehicle::_sendMavCommandAgain(void)
&msg, &msg,
&cmd); &cmd);
} else { } else {
mavlink_message_t msg;
mavlink_command_long_t cmd; mavlink_command_long_t cmd;
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment