Geometry#
Two dimensional#
#include "navground/core/common.h"
Angle in radians.
Values:
agent-fixed frame
world-fixed frame
A two-dimensional vector, see Eigen
The orientation of a two dimensional vector.
- Parameters:
vector – [in] The vector
- Returns:
The orientation of the vector
Normalize an angle to a value in \([-\pi, \pi]\). Apply it when computing angular differences.
- Parameters:
value – [in] The original unbounded angle
- Returns:
The equivalent angle in \([-\pi, \pi]\)
Transform an absolute to a relative vector.
Equivalent to
reference.inverse().transform_vector(value)
- Parameters:
value – [in] The absolute vector
reference – [in] The reference pose
- Returns:
The absolute vector
Transform a relative to an absolute vector.
Equivalent to
reference.transform_vector(value)
- Parameters:
value – [in] The relative vector
reference – [in] The reference pose
- Returns:
The relative vector
Transform an absolute to a relative vector.
Equivalent to
reference.inverse().transform_point(value)
- Parameters:
value – [in] The absolute vector
reference – [in] The reference pose
- Returns:
The absolute point
Transform a relative to an absolute point.
Equivalent to
reference.transform_point(value)
- Parameters:
value – [in] The relative point
reference – [in] The reference pose
- Returns:
The relative point
Unit vector with a desired orientated.
- Parameters:
angle – [in] The desired orientation
- Returns:
Vector of norm one and desired orientation
Rotate a two-dimensional vector.
- Parameters:
vector – [in] The original vector
angle – [in] The rotation angle in radians
- Returns:
The rotated vector
Clamp the norm of a vector.
- Parameters:
vector – [in] The original vector
max_length – [in] The maximum length
- Returns:
A vector with the original orientation but norm clamped to
max_length
.
Two-dimensional pose composed of planar position and orientation. When not specified, poses are assumed to be in the world-fixed frame.
Poses are also associated to rigid transformations in SE(2)
translation(pose.position) . rotation(pose.orientation)
. We define the group operations as a multiplication and add methods like transform_pose for a pose to operate as a rigid transformation.Public Functions
Rotate the pose by an angle.
- Parameters:
angle – [in] The rotation angle in radians.
- Returns:
The rotated pose.
Integrate a pose.
- Parameters:
twist – [in] The twist (in agent or world frame)
dt – [in] The time step
- Returns:
The result of
pose + dt * twist
(in world frame)
Equality operator.
- Parameters:
other – [in] The other pose
- Returns:
The result of the equality
Inequality operator.
- Parameters:
other – [in] The other pose
- Returns:
The result of the inequality
Transform a relative pose to an absolute pose.
Equivalent to
reference.transform_pose(self) = reference * self
- Parameters:
reference – [in] The reference pose
- Returns:
The absolute pose
Transform an absolute pose to a relative pose.
Equivalent to
reference.inverse().transform_pose(self) = reference.inverse() * self
- Parameters:
reference – [in] The reference pose
- Returns:
The relative pose
Concatenate two transformations, i.e. the SE(2) operation.
- Parameters:
other – [in] The other pose
- Returns:
The composite transformation resulting from applying first the other transformation and then this transformation.
SE(2) division of two transformations.
- Parameters:
other – [in] The other pose
- Returns:
self * other.inverse()
Invert a transformation, i.e., SE(2) inversion.
- Returns:
The inverse transformation
Applies this rigid transformation to another pose.
Equivalent to
pose.absolute(self)
- Parameters:
pose – [in] The pose to transform
- Returns:
self * pose
Applies this rigid transformation to a point.
Equivalent to
to_absolute_point(point, self)
- Parameters:
point – [in] The point to transform
- Returns:
The roto-translated point
Applies the rigid transformation to a vector.
Equivalent to
to_absolute(vector, self)
- Parameters:
vector – [in] The vector to transform
- Returns:
The rotated vector
Returns this transformation in the desired frame of reference.
The returned transformation is defined as
frame.inverse() * self * frame
, so that, for any framef
, the following expressions are equivalent:pose.transform(other).relative(f)
pose.get_transformation_in_frame(frame).transform(other.relative(f))
- Parameters:
frame – [in] A posed defining the desired frame of reference for the transformation.
- Returns:
The transformation with respect to
frame
Public Members
Position in world frame
Orientation in world frame
Two-dimensional twist composed of planar velocity and angular speed.
Twist coordinates are in the frame specified by frame.
Public Functions
Rotate the twist by an angle.
- Parameters:
angle – [in] The rotation angle in radians.
- Returns:
The rotated twist.
Equality operator.
- Parameters:
other – [in] The other twist
- Returns:
The result of the equality
Inequality operator.
- Parameters:
other – [in] The other twist
- Returns:
The result of the inequality
Transform a twist to Frame::absolute.
- Parameters:
reference – [in] The pose of reference of this relative twist
- Returns:
The same twist in Frame::absolute (unchanged if already in Frame::absolute)
Transform a twist to Frame::relative relative to a pose.
- Parameters:
reference – [in] The desired pose of reference
- Returns:
The same twist in Frame::relative (unchanged if already in Frame::relative)
Convert a twist to a reference frame.
- Parameters:
frame – [in] The desired frame of reference
reference – [in] The pose of reference
- Returns:
The twist in the desired frame of reference.
Determines if almost zero.
- Parameters:
epsilon_speed – [in] The epsilon speed
epsilon_angular_speed – [in] The epsilon angular speed
- Returns:
True if almost zero, False otherwise.
Snap components to zero if their module is smaller than epsilon.
- Parameters:
epsilon – [in] The tolerance
Interpolates a twist towards a target respecting acceleration limits.
- Parameters:
target – [in] The target twist, must be in the same frame
time_step – [in] The time step
max_acceleration – [in] The maximum acceleration
max_angular_acceleration – [in] The maximum angular acceleration
- Returns:
The interpolate twist
Three dimensional#
#include "navground/core/controller_3d.h"
A three-dimensional vector, see Eigen
Three-dimensional pose composed of position and orientation.
Poses are assumed to be a world fixed frame.
Public Functions
Integrate a pose.
- Parameters:
twist – [in] The twist
dt – [in] The time step
- Returns:
pose + dt * twist
Project to the two dimensional plane.
- Returns:
The projected pose
Public Members
Position in world frame
Orientation in world frame
Three-dimensional twist composed of velocity and angular speed.
Twist3 coordinates may be in a fixed frame or in the agent’s own frame, as specified by frame.
Public Functions
Project to the two dimensional plane.
- Returns:
The projected twist
Public Members
Velocity
Angular speed
The frame of reference.