Brick
Loading...
Searching...
No Matches
Twist2d Class Reference

#include <twist2d.h>

Description

Class representing a difference between two poses, more specifically a distance along an arc from a pose. The angular displacement is continuous and is never wrapped. More specifically, dx and dy represent integrated motion in the moving reference frame of the robot.

Assumes conventional cartesian coordinate system: Looking down at the coordinate plane, +X is right +Y is up +Theta is counterclockwise

Public Member Functions

constexpr Twist2d ()
 Default Constructor for Twist2d.
constexpr Twist2d (units::Length dx, units::Length dy, units::Angle dtheta)
constexpr Twist2d (const Eigen::Vector3d &twist_vector, units::Length length_unit, units::Angle angle_unit=units::radians)
constexpr units::Length dx () const
 Gets the x displacement.
constexpr double dx (units::Length unit) const
 Gets the x displacement in the supplied unit.
constexpr void set_dx (units::Length val)
 Sets the x displacement.
constexpr units::Length dy () const
 Gets the y displacement.
constexpr double dy (units::Length unit) const
 Gets the y displacement in the supplied unit.
constexpr void set_dy (units::Length val)
 Sets the y displacement.
constexpr units::Angle dtheta () const
 Gets the Angle displacement.
constexpr double dtheta (units::Angle unit) const
 Gets the angle displacement in the supplied unit.
constexpr void set_dtheta (units::Angle val)
 Sets the angle displacement.
EVec< 3 > as_vector (units::Length length_unit, units::Angle angle_unit=units::radians) const
constexpr Twist2d operator* (double scalar) const
 Multiplies this twist by a scalar.
constexpr Twist2d & operator*= (double scalar)
 Multiplies this twist by a scalar.
constexpr Twist2d operator/ (double scalar) const
 Divides this twist by a scalar.
constexpr Twist2d & operator/= (double scalar)
 Divides this twist by a scalar.
constexpr bool operator== (const Twist2d &other) const
 Checks exact equality between this and another twist.
constexpr bool is_near (const Twist2d &other, units::Length distance_tolerance=units::Length(1e-6), units::Angle angle_tolerance=units::Angle(1e-6)) const

Friends

constexpr Twist2d operator* (double scalar, const Twist2d &twist)
 Multiplies a scalar by this twist.

Constructor & Destructor Documentation

◆ Twist2d() [1/2]

Twist2d::Twist2d ( units::Length dx,
units::Length dy,
units::Angle dtheta )
inlineconstexpr

Constructs a twist with given translation and angle deltas.

Parameters
dxthe linear dx component.
dythe linear dy component.
dthetathe angular dtheta component.

◆ Twist2d() [2/2]

Twist2d::Twist2d ( const Eigen::Vector3d & twist_vector,
units::Length length_unit,
units::Angle angle_unit = units::radians )
inlineconstexpr

Constructs a twist with given translation and angle deltas.

Parameters
twist_vectorvector of the form [dx, dy, dtheta]
length_unitunit for dx and dy.
angle_unitunit for dtheta, defaults to radians.

Member Function Documentation

◆ as_vector()

EVec< 3 > Twist2d::as_vector ( units::Length length_unit,
units::Angle angle_unit = units::radians ) const
inline

Returns [dx, dy, dtheta] in the supplied units. Angles default to radians.

Parameters
length_unitthe unit of length to get the values as
angle_unitthe unit of angle to get the rotation as, default radians
Returns
EVec<3> containing the values.

◆ is_near()

bool Twist2d::is_near ( const Twist2d & other,
units::Length distance_tolerance = units::Length(1e-6),
units::Angle angle_tolerance = units::Angle(1e-6) ) const
inlineconstexpr

Checks linear distance and unwrapped angle difference against tolerances. Defaults to 1um and 1e-6 radians.


The documentation for this class was generated from the following file: