Skip to content

Commit

Permalink
minor changes for microsoft#908
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Mar 30, 2018
1 parent 95c285a commit 98dd283
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MavLinkCom/MavLinkTest/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,11 +1607,11 @@ void GotoCommand::HandleMessage(const MavLinkMessage& message)
channel->moveToLocalPosition(tx, ty, tz, is_yaw, static_cast<float>(theading * M_PI / 180));

if (this->hasLocalPosition) {
if (!targetReached && fabsf(x - tx) < nearDelta && fabsf(y - ty) < nearDelta)
if (!targetReached && std::abs(x - tx) < nearDelta && std::abs(y - ty) < nearDelta)
{
targetReached = true;
}
if (targetReached && !settled && (fabs(this->vx) + fabsf(this->vy) + fabsf(this->vz) < almostStationery)) {
if (targetReached && !settled && (fabs(this->vx) + std::abs(this->vy) + std::abs(this->vz) < almostStationery)) {
settled = true;
// ok, now we can safely switch to loiter.
TargetReached();
Expand Down Expand Up @@ -2081,7 +2081,7 @@ void SquareCommand::UpdateTarget()
float dy = ty - y;
float dist = sqrtf((dx*dx) + (dy*dy));

if (fabsf(dx) < near && fabsf(dy) < near)
if (std::abs(dx) < near && std::abs(dy) < near)
{
leg_++;
if (leg_ == 4) leg_ = 0;
Expand Down

0 comments on commit 98dd283

Please sign in to comment.