7 :
WaitStateBase(QStringLiteral(
"SendMavlinkCommandState"), parent, 0)
9 setup(command, param1, param2, param3, param4, param5, param6, param7);
13 :
WaitStateBase(QStringLiteral(
"SendMavlinkCommandState"), parent, 0)
45 qCCritical(QGCStateMachineLog) <<
"SendMavlinkCommandState not configured";
55 static_cast<float>(_param1),
56 static_cast<float>(_param2),
57 static_cast<float>(_param3),
58 static_cast<float>(_param4),
59 static_cast<float>(_param5),
60 static_cast<float>(_param6),
61 static_cast<float>(_param7));
64void SendMavlinkCommandState::_mavCommandResult(
int vehicleId,
int targetComponent,
int command,
int ackResult,
int failureCode)
67 Q_UNUSED(targetComponent);
69 Vehicle* senderVehicle = qobject_cast<Vehicle*>(sender());
71 qWarning() <<
"Vehicle dynamic cast on sender() failed!";
74 if (senderVehicle !=
vehicle()) {
77 if (command != _command) {
84 qCDebug(QGCStateMachineLog) << QStringLiteral(
"%1 Command - No response from vehicle").arg(commandName);
87 qCWarning(QGCStateMachineLog) << QStringLiteral(
"%1 Command - Duplicate command pending").arg(commandName);
89 }
else if (ackResult != MAV_RESULT_ACCEPTED) {
90 qCWarning(QGCStateMachineLog) << QStringLiteral(
"%1 Command failed = ack.result: %2").arg(commandName).arg(ackResult);
94 qCDebug(QGCStateMachineLog) << QStringLiteral(
"%1 Command succeeded").arg(commandName);
static MissionCommandTree * instance()
QString friendlyName(MAV_CMD command) const
Returns the friendly name for the specified command.
Vehicle * vehicle() const
SendMavlinkCommandState(QState *parent, MAV_CMD command, double param1=0.0, double param2=0.0, double param3=0.0, double param4=0.0, double param5=0.0, double param6=0.0, double param7=0.0)
void connectWaitSignal() override
Subclasses override to set up their signal connections.
void disconnectWaitSignal() override
Subclasses override to tear down their signal connections.
void onWaitEntered() override
Called when the state is entered - subclasses should call base implementation.
void setup(MAV_CMD command, double param1=0.0, double param2=0.0, double param3=0.0, double param4=0.0, double param5=0.0, double param6=0.0, double param7=0.0)
void sendMavCommand(int compId, MAV_CMD command, bool showError, float param1=0.0f, float param2=0.0f, float param3=0.0f, float param4=0.0f, float param5=0.0f, float param6=0.0f, float param7=0.0f)
@ MavCmdResultFailureNoResponseToCommand
No response from vehicle to command.
@ MavCmdResultFailureDuplicateCommand
Unable to send command since duplicate is already being waited on for response.
void mavCommandResult(int vehicleId, int targetComponent, int command, int ackResult, int failureCode)