RIT VEXU Core API
|
#include <odometry_3wheel.h>
Classes | |
struct | odometry3wheel_cfg_t |
Public Member Functions | |
Odometry3Wheel (CustomEncoder &lside_fwd, CustomEncoder &rside_fwd, CustomEncoder &off_axis, odometry3wheel_cfg_t &cfg, bool is_async=true) | |
Pose2d | update () override |
void | tune (vex::controller &con, TankDrive &drive) |
![]() | |
OdometryBase (bool is_async) | |
virtual Pose2d | get_position (void) |
virtual void | set_position (const Pose2d &newpos=zero_pos) |
void | end_async () |
virtual double | get_speed () |
virtual double | get_accel () |
double | get_angular_speed_deg () |
double | get_angular_accel_deg () |
Additional Inherited Members | |
![]() | |
static int | background_task (void *ptr) |
static double | smallest_angle (double start_deg, double end_deg) |
![]() | |
bool | end_task = false |
end_task is true if we instruct the odometry thread to shut down | |
vex::task * | handle |
vex::mutex | mut |
Pose2d | current_pos |
double | speed |
double | accel |
double | ang_speed_deg |
double | ang_accel_deg |
This class handles the code for a standard 3-pod odometry setup, where there are 3 "pods" made up of undriven (dead) wheels connected to encoders in the following configuration:
+Y ------------— ^ | | | | | | | || O || | | | | | | === | | ------------— | +-------------------> + X
Where O is the center of rotation. The robot will monitor the changes in rotation of these wheels and calculate the robot's X, Y and rotation on the field.
This is a "set and forget" class, meaning once the object is created, the robot will immediately begin tracking it's movement in the background.
Odometry3Wheel::Odometry3Wheel | ( | CustomEncoder & | lside_fwd, |
CustomEncoder & | rside_fwd, | ||
CustomEncoder & | off_axis, | ||
odometry3wheel_cfg_t & | cfg, | ||
bool | is_async = true ) |
Construct a new Odometry 3 Wheel object
lside_fwd | left-side encoder reference |
rside_fwd | right-side encoder reference |
off_axis | off-axis (perpendicular) encoder reference |
cfg | robot odometry configuration |
is_async | true to constantly run in the background |
void Odometry3Wheel::tune | ( | vex::controller & | con, |
TankDrive & | drive ) |
A guided tuning process to automatically find tuning parameters. This method is blocking, and returns when tuning has finished. Follow the instructions on the controller to complete the tuning process
con | Controller reference, for screen and button control |
drive | Drivetrain reference for robot control |
A guided tuning process to automatically find tuning parameters. This method is blocking, and returns when tuning has finished. Follow the instructions on the controller to complete the tuning process
It is assumed the gear ratio and encoder PPR have been set correctly
|
overridevirtual |
Update the current position of the robot once, using the current state of the encoders and the previous known location
Implements OdometryBase.