Skip to main content
Version: 3.2.1

General

Tracking Wheels​

odom_tracker_left_set()​

Sets the parallel left tracking wheel for odometry.

input an ez::tracking_wheel

void odom_tracker_left_set(tracking_wheel* input);

odom_tracker_right_set()​

Sets the parallel right tracking wheel for odometry.

input an ez::tracking_wheel

void odom_tracker_right_set(tracking_wheel* input);

odom_tracker_front_set()​

Sets the perpendicular front tracking wheel for odometry.

input an ez::tracking_wheel

void odom_tracker_front_set(tracking_wheel* input);

odom_tracker_back_set()​

Sets the perpendicular back tracking wheel for odometry.

input an ez::tracking_wheel

void odom_tracker_back_set(tracking_wheel* input);

Pose​

odom_enable()​

Enables / disables tracking.

input true enables tracking, false disables tracking

void odom_enable(bool input);

odom_enabled()​

Returns whether the bot is tracking with odometry.

True means tracking is enabled, false means tracking is disabled.

bool odom_enabled();

odom_x_set()​

Sets the current x position of the robot.

x new x coordinate in inches

void odom_x_set(double x);

odom_x_set()​

Sets the current X coordinate of the robot.

p_x new x coordinate as an okapi unit

void odom_x_set(okapi::QLength p_x);

odom_y_set()​

Sets the current Y coordinate of the robot.

y new y coordinate in inches

void odom_y_set(double y);

odom_y_set()​

Sets the current Y coordinate of the robot.

p_y new y coordinate as an okapi unit

void odom_y_set(okapi::QLength p_y);

odom_theta_set()​

Sets the current Theta of the robot.

a new angle in degrees

void odom_theta_set(double a);

odom_theta_set()​

Sets the current angle of the robot.

p_y new angle as an okapi unit

void odom_theta_set(okapi::QAngle p_a);

odom_xy_set()​

Sets the current X and Y coordinate for the robot.

x new x value, in inches
y new y value, in inches

void odom_xy_set(double x, double y);

odom_xy_set()​

Sets the current X and Y coordinate for the robot.

p_x new x value, okapi unit
p_y new y value, okapi unit

void odom_xy_set(okapi::QLength p_x, okapi::QLength p_y);

odom_xyt_set()​

Sets the current X, Y, and Theta values for the robot.

x new x value, in inches
y new y value, in inches
t new theta value, in degrees

void odom_xyt_set(double x, double y, double t);

odom_xy_set()​

Sets the current X, Y, and Theta values for the robot.

p_x new x value, okapi unit
p_y new y value, okapi unit
p_t new theta value, okapi unit

void odom_xyt_set(okapi::QLength p_x, okapi::QLength p_y, okapi::QAngle p_t);

odom_pose_set()​

Sets the current pose of the robot.

itarget {x, y, t} units in inches and degrees

void odom_pose_set(pose itarget);

odom_pose_set()​

Set the current pose of the robot.

itarget {x, y, t} as an okapi unit

void odom_pose_set(united_pose itarget);

odom_x_flip()​

Flips the C axis.

flip true means left is positive x, false means right is positive x

void odom_x_flip(bool flip = true);

odom_y_flip()​

Flips the Y axis.

flip true means down is positive y, false means up is positive y

void odom_y_flip(bool flip = true);

odom_theta_flip()​

Flips the rotation axis. This works for odom and non odom functions.

flip true means counterclockwise is positive, false means clockwise is positive

void odom_theta_flip(bool flip = true);

odom_x_get()​

Returns the current x position of the robot in inches.

double odom_x_get();

odom_y_get()​

Returns the current Y coordinate of the robot in inches.

double odom_y_get();

odom_theta_get()​

Returns the current Theta of the robot in degrees.

double odom_theta_get();

odom_pose_get()​

Returns the current pose of the robot.

pose odom_pose_get();

odom_x_direction_get()​

Checks if X axis is flipped.

True means left is positive X, false means right is positive X.

bool odom_x_direction_get();

odom_y_direction_get()​

Checks if Y axis is flipped.

True means down is positive Y, false means up is positive Y.

bool odom_y_direction_get();

odom_theta_direction_get()​

Checks if the rotation axis is flipped.

True means counterclockwise is positive, false means clockwise is positive.

bool odom_theta_direction_get();

Movement Constants​

pid_odom_angular_constants_set()​

Set the odom angular pid constants object.

p proportional term
i integral term
d derivative term
p_start_i error threshold to start integral

void pid_odom_angular_constants_set(double p, double i = 0.0, double d = 0.0, double p_start_i = 0.0);

odom_turn_bias_set()​

A proportion of how prioritized turning is during odometry motions.

Turning is prioritized so the robot "applies brakes" while turning. Lower number means more braking.

bias a number between 0 and 1

void odom_turn_bias_set(double bias);

pid_odom_drive_exit_condition_set()​

Set's constants for odom driving exit conditions.

p_small_exit_time time to exit when within small_error, okapi unit
p_small_error small timer will start when error is within this, okapi unit
p_big_exit_time time to exit when within big_error, okapi unit
p_big_error big timer will start when error is within this, okapi unit
p_velocity_exit_time time, in okapi units, for velocity to be 0
p_mA_timeout velocity timer will start when velocity is 0, okapi unit
use_imu true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't

void pid_odom_drive_exit_condition_set(okapi::QTime p_small_exit_time, okapi::QLength p_small_error, okapi::QTime p_big_exit_time, okapi::QLength p_big_error, okapi::QTime p_velocity_exit_time, okapi::QTime p_mA_timeout, bool use_imu = true);

pid_odom_drive_exit_condition_set()​

Set's constants for odom driving exit conditions.

p_small_exit_time time to exit when within small_error, in ms
p_small_error small timer will start when error is within this, in inches
p_big_exit_time time to exit when within big_error, in ms
p_big_error big timer will start when error is within this, in inches
p_velocity_exit_time velocity timer will start when velocity is 0, in ms
p_mA_timeout mA timer will start when the motors are pulling too much current, in ms
use_imu true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't

void pid_odom_drive_exit_condition_set(int p_small_exit_time, double p_small_error, int p_big_exit_time, double p_big_error, int p_velocity_exit_time, int p_mA_timeout, bool use_imu = true);

pid_odom_turn_exit_condition_set()​

Set's constants for odom turning exit conditions.

p_small_exit_time time to exit when within small_error, okapi unit
p_small_error small timer will start when error is within this, okapi unit
p_big_exit_time time to exit when within big_error, okapi unit
p_big_error big timer will start when error is within this, okapi unit
p_velocity_exit_time time, in okapi units, for velocity to be 0
p_mA_timeout velocity timer will start when velocity is 0, okapi unit
use_imu true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't

void pid_odom_turn_exit_condition_set(okapi::QTime p_small_exit_time, okapi::QAngle p_small_error, okapi::QTime p_big_exit_time, okapi::QAngle p_big_error, okapi::QTime p_velocity_exit_time, okapi::QTime p_mA_timeout, bool use_imu = true);

pid_odom_turn_exit_condition_set()​

Set's constants for odom turning exit conditions.

p_small_exit_time time to exit when within small_error, in ms
p_small_error small timer will start when error is within this, in degrees p_big_exit_time time to exit when within big_error, in ms p_big_error big timer will start when error is within this, in degrees p_velocity_exit_time velocity timer will start when velocity is 0, in ms p_mA_timeout mA timer will start when the motors are pulling too much current, in ms
use_imu true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't

void pid_odom_turn_exit_condition_set(int p_small_exit_time, double p_small_error, int p_big_exit_time, double p_big_error, int p_velocity_exit_time, int p_mA_timeout, bool use_imu = true);

odom_look_ahead_set()​

Sets how far away the robot looks in the path during pure pursuits.

distance how long the "carrot on a stick" is, in inches

void odom_look_ahead_set(double distance);

odom_look_ahead_set()​

Sets how far away the robot looks in the path during pure pursuits.

distance how long the "carrot on a stick" is, in okapi units

void odom_look_ahead_set(okapi::QLength p_distance);

pid_odom_behavior_set()​

Sets the default behavior for turns in odom turning movements.

behavior ez::shortest, ez::longest, ez::left, ez::right, ez::raw

void pid_odom_behavior_set(e_angle_behavior behavior);

pid_odom_behavior_get()​

Returns the turn behavior for odom turns.

e_angle_behavior pid_odom_behavior_get();

odom_path_spacing_set()​

Sets the spacing between points when points get injected into the path.

p_spacing a small number in okapi units

void odom_path_spacing_set(okapi::QLength p_spacing);

odom_path_spacing_set()​

Sets the spacing between points when points get injected into the path.

spacing a small number in inches

void odom_path_spacing_set(double spacing);

odom_turn_bias_get()​

Returns the proportion of how prioritized turning is during odometry motions.

double odom_turn_bias_get();

odom_look_ahead_get()​

Returns how far away the robot looks in the path during pure pursuits.

double odom_look_ahead_get();

odom_path_spacing_get()​

Returns the spacing between points when points get injected into the path.

double odom_path_spacing_get();

slew_odom_reenable()​

Allows slew to reenable when the new input speed is larger than the current speed during pure pursuits.

slew_on true enables, false disables

void slew_odom_reenable(bool reenable);

slew_odom_reenabled()​

Allows slew to reenable when the new input speed is larger than the current speed during pure pursuits.

bool slew_odom_reenabled();

odom_path_smooth_constants_set()​

Sets the constants for smoothing out a path.

Path smoothing based on https://medium.com/@jaems33/understanding-robot-motion-path-smoothing-5970c8363bc4

weight_smooth how much weight to update the data
weight_data how much weight to smooth the coordinates
tolerance how much change per iteration is necessary to keep iterating

void odom_path_smooth_constants_set(double weight_smooth, double weight_data, double tolerance);

odom_path_smooth_constants_get()​

Returns the constants for smoothing out a path.

In order of:

  • weight_smooth
  • weight_data
  • tolerance
std::vector<double> odom_path_smooth_constants_get();

odom_path_print()​

Prints the current path the robot is following.

void odom_path_print();

Boomerang Behavior​

pid_odom_boomerang_constants_set()​

Set the odom boomerang pid constants object.

p proportional term
i integral term
d derivative term
p_start_i error threshold to start integral

void pid_odom_boomerang_constants_set(double p, double i = 0.0, double d = 0.0, double p_start_i = 0.0);

odom_boomerang_dlead_set()​

Sets a new dlead.

Dlead is a proportional value of how much to make the robot curve during boomerang motions.

input a value between 0 and 1

void odom_boomerang_dlead_set(double input);

odom_boomerang_distance_set()​

Sets how far away the carrot point can be from the target point.

distance distance in inches

void odom_boomerang_distance_set(double distance);

odom_boomerang_distance_set()​

Sets how far away the carrot point can be from the target point.

distance distance as an okapi unit

void odom_boomerang_distance_set(okapi::QLength p_distance);

odom_boomerang_dlead_get()​

Returns the current dlead.

double odom_boomerang_dlead_get();

odom_boomerang_distance_get()​

Returns the maximum distance the carrot point can be away from the target point.

double odom_boomerang_distance_get();