Skip to content

Commit

Permalink
Replacing fabsf in standard lib for the one in libmath
Browse files Browse the repository at this point in the history
  • Loading branch information
mescarra committed Mar 26, 2018
1 parent 4526689 commit fc5d8d8
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 && std::fabsf(x - tx) < nearDelta && std::fabsf(y - ty) < nearDelta)
if (!targetReached && fabsf(x - tx) < nearDelta && fabsf(y - ty) < nearDelta)
{
targetReached = true;
}
if (targetReached && !settled && (fabs(this->vx) + std::fabsf(this->vy) + std::fabsf(this->vz) < almostStationery)) {
if (targetReached && !settled && (fabs(this->vx) + fabsf(this->vy) + fabsf(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 (std::fabsf(dx) < near && std::fabsf(dy) < near)
if (fabsf(dx) < near && fabsf(dy) < near)
{
leg_++;
if (leg_ == 4) leg_ = 0;
Expand Down

0 comments on commit fc5d8d8

Please sign in to comment.