Commit 671f55e5 authored by DonLakeFlyer's avatar DonLakeFlyer

Goto locaiton using COMMAND_INT

parent 4dc7b9d6
...@@ -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)
......
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