okapi::OdomMath class

Contents

Public static functions

static auto computeDistanceToPoint(const Point& ipoint, const OdomState& istate) -> QLength
Computes the distance from the given Odometry state to the given point.
static auto computeAngleToPoint(const Point& ipoint, const OdomState& istate) -> QAngle
Computes the angle from the given Odometry state to the given point.
static auto computeDistanceAndAngleToPoint(const Point& ipoint, const OdomState& istate) -> std::pair<QLength, QAngle>
Computes the distance and angle from the given Odometry state to the given point.
static auto constrainAngle360(const QAngle& angle) -> QAngle
Constraints the angle to [0,360] degrees.
static auto constrainAngle180(const QAngle& angle) -> QAngle
Constraints the angle to [-180,180) degrees.

Function documentation

static QLength okapi::OdomMath::computeDistanceToPoint(const Point& ipoint, const OdomState& istate)

Computes the distance from the given Odometry state to the given point.

Parameters
ipoint The point.
istate The Odometry state.
Returns The distance between the Odometry state and the point.

The point and the OdomState must be in StateMode::FRAME_TRANSFORMATION.

static QAngle okapi::OdomMath::computeAngleToPoint(const Point& ipoint, const OdomState& istate)

Computes the angle from the given Odometry state to the given point.

Parameters
ipoint The point.
istate The Odometry state.
Returns The angle between the Odometry state and the point.

The point and the OdomState must be in StateMode::FRAME_TRANSFORMATION.

static std::pair<QLength, QAngle> okapi::OdomMath::computeDistanceAndAngleToPoint(const Point& ipoint, const OdomState& istate)

Computes the distance and angle from the given Odometry state to the given point.

Parameters
ipoint The point.
istate The Odometry state.
Returns The distance and angle between the Odometry state and the point.

The point and the OdomState must be in StateMode::FRAME_TRANSFORMATION.

static QAngle okapi::OdomMath::constrainAngle360(const QAngle& angle)

Constraints the angle to [0,360] degrees.

Parameters
angle The input angle.
Returns The angle normalized to [0,360] degrees.

static QAngle okapi::OdomMath::constrainAngle180(const QAngle& angle)

Constraints the angle to [-180,180) degrees.

Parameters
angle The input angle.
Returns The angle normalized to [-180,180) degrees.