#include <ariaUtil.h>
Static Public Member Functions | |
static double | addAngle (double ang1, double ang2) |
This adds two angles together and fixes the result to [-180, 180]. | |
static bool | angleBetween (double angle, double startAngle, double endAngle) |
Finds if one angle is between two other angles. | |
static double | atan2 (double y, double x) |
Finds the arctan of the given y/x pair. | |
static double | cos (double angle) |
Finds the cos, from angles in degrees. | |
static double | degToRad (double deg) |
Converts an angle in degrees to an angle in radians. | |
static double | distanceBetween (double x1, double y1, double x2, double y2) |
Finds the distance between two coordinates. | |
static double | fabs (double val) |
Finds the absolute value of a double. | |
static double | fixAngle (double angle) |
Takes an angle and returns the angle in range (-180,180]. | |
static double | log2 (double x) |
static void | pointRotate (double *x, double *y, double th) |
Rotates a point around 0 by degrees given. | |
static double | radToDeg (double rad) |
Converts an angle in radians to an angle in degrees. | |
static long | random (void) |
Returns a long between 0 and some arbitrary huge number. | |
static int | roundInt (double val) |
Finds the closest integer to double given. | |
static short | roundShort (double val) |
Finds the closest short to double given. | |
static double | sin (double angle) |
Finds the sin, from angles in degrees. | |
static double | squaredDistanceBetween (double x1, double y1, double x2, double y2) |
Finds the squared distance between two coordinates. | |
static double | subAngle (double ang1, double ang2) |
This subtracts one angle from another and fixes the result to [-180,180]. |
Definition at line 249 of file ariaUtil.h.
|
This adds two angles together and fixes the result to [-180, 180].
Definition at line 260 of file ariaUtil.h. References fixAngle(). Referenced by ArActionTriangleDriveTo::findTriangle(), ArActionIRs::fire(), ArActionBumpers::fire(), ArSick::processPacket(), ArRobot::setDeltaHeading(), and ArRobot::stateReflector(). |
|
Finds the arctan of the given y/x pair.
Definition at line 332 of file ariaUtil.h. References radToDeg(). Referenced by ArSensorReading::resetSensorPosition(). |
|
Finds the cos, from angles in degrees.
Definition at line 316 of file ariaUtil.h. References degToRad(). Referenced by ArBumpers::addBumpToBuffer(), ArTransform::ArTransform(), ArActionTriangleDriveTo::findTriangle(), pointRotate(), ArForbiddenRangeDevice::processReadings(), ArSensorReading::resetSensorPosition(), and ArTransform::setTransform(). |
|
Converts an angle in degrees to an angle in radians.
Definition at line 300 of file ariaUtil.h. Referenced by cos(), ArPose::getThRad(), and sin(). |
|
Finds the distance between two coordinates.
Definition at line 424 of file ariaUtil.h. Referenced by ArPose::findDistanceTo(). |
|
Finds the absolute value of a double.
Definition at line 352 of file ariaUtil.h. Referenced by ArActionTriangleDriveTo::findTriangle(), ArActionTriangleDriveTo::fire(), ArActionRobotJoydrive::fire(), ArActionLimiterBackwards::fire(), ArActionIRs::fire(), ArActionDeceleratingLimiter::fire(), ArActionColorFollow::fire(), ArActionBumpers::fire(), ArAnalogGyro::handleGyroPacket(), ArSickLogger::setDegDiff(), ArSickLogger::setDistDiff(), ArRobot::setRotDecel(), ArRobot::setTransDecel(), and ArRobot::stateReflector(). |
|
Takes an angle and returns the angle in range (-180,180].
Definition at line 281 of file ariaUtil.h. Referenced by addAngle(), angleBetween(), ArAnalogGyro::encoderCorrect(), ArRangeBuffer::getClosestPolarInList(), ArAnalogGyro::handleGyroPacket(), ArTCM2::packetHandler(), ArRobot::processMotorPacket(), ArPose::setTh(), ArPose::setThRad(), and subAngle(). |
|
Base-2 logarithm Definition at line 440 of file ariaUtil.h. |
|
Converts an angle in radians to an angle in degrees.
Definition at line 308 of file ariaUtil.h. Referenced by atan2(), ArPose::findAngleTo(), and ArRobot::processMotorPacket(). |
|
Finds the closest integer to double given.
Definition at line 366 of file ariaUtil.h. Referenced by ArP2Arm::convertDegToTicks(), ArP2Arm::convertTicksToDeg(), ArJoyHandler::getAdjusted(), ArJoyHandler::getNewData(), ArRobot::processMotorPacket(), ArSick::processPacket(), ArSick::simPacketHandler(), and ArSectors::update(). |
|
Finds the closest short to double given.
Definition at line 383 of file ariaUtil.h. Referenced by ArRobot::stateReflector(). |
|
Finds the sin, from angles in degrees.
Definition at line 324 of file ariaUtil.h. References degToRad(). Referenced by ArBumpers::addBumpToBuffer(), ArTransform::ArTransform(), ArActionTriangleDriveTo::findTriangle(), pointRotate(), ArForbiddenRangeDevice::processReadings(), ArSensorReading::resetSensorPosition(), and ArTransform::setTransform(). |
|
Finds the squared distance between two coordinates. use this only where speed really matters
Definition at line 436 of file ariaUtil.h. Referenced by ArSick::filterAddAndCleanCumulative(), ArForbiddenRangeDevice::processReadings(), and ArPose::squaredFindDistanceTo(). |
|
This subtracts one angle from another and fixes the result to [-180,180].
Definition at line 271 of file ariaUtil.h. References fixAngle(). Referenced by ArAnalogGyro::encoderCorrect(), ArRobot::findDeltaHeadingTo(), ArActionTriangleDriveTo::findTriangle(), ArActionGotoStraight::fire(), ArActionBumpers::fire(), ArRangeBuffer::getClosestPolarInList(), ArInterpolation::getPose(), ArTransform::setTransform(), and ArRobot::stateReflector(). |