Commit 99b77f19 authored by Lorenz Meier's avatar Lorenz Meier

Fix takeoff logic

parent d313eefa
...@@ -304,7 +304,7 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double altitudeRel) ...@@ -304,7 +304,7 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double altitudeRel)
mavlink_message_t msg; mavlink_message_t msg;
mavlink_command_long_t cmd; mavlink_command_long_t cmd;
cmd.command = (uint16_t)MAV_CMD_DO_REPOSITION; cmd.command = (uint16_t)MAV_CMD_NAV_TAKEOFF;
cmd.confirmation = 0; cmd.confirmation = 0;
cmd.param1 = -1.0f; cmd.param1 = -1.0f;
cmd.param2 = 0.0f; cmd.param2 = 0.0f;
...@@ -318,11 +318,6 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double altitudeRel) ...@@ -318,11 +318,6 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double altitudeRel)
mavlink_msg_command_long_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &cmd); mavlink_msg_command_long_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &cmd);
vehicle->sendMessage(msg); vehicle->sendMessage(msg);
QGC::SLEEP::msleep(300);
// trigger take off
vehicle->setFlightMode(takeoffFlightMode);
} }
void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoordinate& gotoCoord) void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoordinate& gotoCoord)
......
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