Kinematics

struct Vector2d

A point in 2d space.

Public Members

double x

The x component of the point

double y

The y component of the point

struct Pose2d

A pose in 2d space.

Public Members

double x

The x component of the pose

double y

The y component of the pose

double theta

The heading of the pose

class Odometry

Public Functions

void update(
double left_displacement,
double right_displacement,
double horizontal_displacement,
double heading,
)

Update the odometry tracking state.

Parameters:
  • left_displacement – the linear displacement of the left side of the Chassis

  • right_displacement – the linear displacement of the right side of the Chassis

  • horizontal_displacement – the linear displacement from any horizontal tracking

  • heading – the current heading

Pose2d get_position() const

Get the current position of the robot.

Returns:

Pose2d

void set_position(Pose2d pose)

Set the current position of the robot.

Parameters:

pose

double displacement_to(Vector2d point, bool reverse = false) const

Calculate the displacement from the current position of the robot to a point.

Parameters:
  • point – the end point

  • reverse – if the robot will move in reverse

Returns:

the displacement to the point

double angle_to(Vector2d point, bool reverse = false) const

Calculate the angle from the current position of the robot to a point.

Parameters:
  • point – the end point

  • reverse – if the robot will move in reverse

Returns:

the angle to the point