Skip to content

Commit

Permalink
Add check for offboard control in the wiggle command.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Mar 27, 2017
1 parent ee26c20 commit 0d0a4e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 11 additions & 10 deletions MavLinkCom/MavLinkTest/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,6 @@ bool GotoCommand::Parse(const std::vector<std::string>& args) {
void GotoCommand::Execute(std::shared_ptr<MavLinkVehicle> com) {
this->channel = com;
this->requestedControl = false;
this->hasControl = false;
this->targetReached = false;
this->settled = false;
this->hasLocalPosition = false;
Expand Down Expand Up @@ -1874,18 +1873,20 @@ void WiggleCommand::HandleMessage(const MavLinkMessage& message)
if (!ready_) {
return;
}
MavLinkLocalPositionNed pos;
pos.decode(message);

if (xaxis_) {
wiggleX(pos);
}
else {
wiggleY(pos);
}
if (vehicle->hasOffboardControl()) {
MavLinkLocalPositionNed pos;
pos.decode(message);

meter_.reportMessageRate();
if (xaxis_) {
wiggleX(pos);
}
else {
wiggleY(pos);
}

meter_.reportMessageRate();
}
break;
}
default:
Expand Down
1 change: 0 additions & 1 deletion MavLinkCom/MavLinkTest/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ class GotoCommand : public Command
{
bool hasLocalPosition;
bool requestedControl;
bool hasControl;
bool targetReached;
bool targetPosition;
bool targetVelocity;
Expand Down

0 comments on commit 0d0a4e6

Please sign in to comment.