482 Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int imu_port,
double wheel_diameter,
double ticks,
double ratio = 1.0);
504 Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int imu_port,
double wheel_diameter,
double ticks,
double ratio, std::vector<int> left_tracker_ports, std::vector<int> right_tracker_ports) __attribute__((deprecated(
"Use the integrated encoder constructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")));
528 Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int imu_port,
double wheel_diameter,
double ticks,
double ratio, std::vector<int> left_tracker_ports, std::vector<int> right_tracker_ports,
int expander_smart_port) __attribute__((deprecated(
"Use the integrated encoder constructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")));
548 Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int imu_port,
double wheel_diameter,
double ratio,
int left_rotation_port,
int right_rotation_port) __attribute__((deprecated(
"Use the integrated encoder constructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")));
727 void odom_xyt_set(okapi::QLength p_x, okapi::QLength p_y, okapi::QAngle p_t);
1812 void pid_drive_set(okapi::QLength p_target,
int speed,
bool slew_on,
bool toggle_heading =
true);
1836 void pid_drive_set(
double target,
int speed,
bool slew_on,
bool toggle_heading =
true);
3123 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);
3143 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);
3163 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);
3183 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);
3203 void pid_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);
3223 void pid_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);
3243 void pid_swing_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);
3263 void pid_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);
3283 void pid_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);
3303 void pid_swing_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);
3491 void opcontrol_drive_activebrake_targets_set();
3492 double odom_smooth_weight_smooth = 0.0;
3493 double odom_smooth_weight_data = 0.0;
3494 double odom_smooth_tolerance = 0.0;
3495 bool odom_use_left =
true;
3496 double odom_ime_track_width_left = 0.0;
3497 double odom_ime_track_width_right = 0.0;
3498 bool imu_calibrate_took_too_long =
false;
3499 bool is_full_pid_tuner_enabled =
false;
3500 std::vector<const_and_name>* used_pid_tuner_pids;
3501 double opcontrol_speed_max = 127.0;
3502 bool arcade_vector_scaling =
false;
3504 std::vector<odom> pp_movements;
3505 std::vector<int> injected_pp_index;
3507 std::vector<odom> smooth_path(std::vector<odom> ipath,
double weight_smooth,
double weight_data,
double tolerance);
3508 double is_past_target(
pose target,
pose current);
3509 void raw_pid_odom_pp_set(std::vector<odom> imovements,
bool slew_on);
3510 bool ptf1_running =
false;
3512 void raw_pid_odom_ptp_set(
odom imovement,
bool slew_on);
3513 std::vector<odom> inject_points(std::vector<odom> imovements);
3514 std::vector<pose> point_to_face = {{0, 0, 0}, {0, 0, 0}};
3515 double turn_is_toleranced(
double target,
double current,
double input,
double longest,
double shortest);
3516 double turn_short(
double target,
double current,
bool print =
false);
3517 double turn_long(
double target,
double current,
bool print =
false);
3519 double turn_left(
double target,
double current,
bool print =
false);
3520 double turn_right(
double target,
double current,
bool print =
false);
3521 bool imu_calibration_complete =
false;
3522 bool is_swing_slew_enabled(
e_swing type,
double target,
double current);
3523 bool slew_reenables_when_max_speed_changes =
true;
3524 int slew_min_when_it_enabled = 0;
3525 bool slew_will_enable_later =
false;
3526 bool current_slew_on =
false;
3527 bool is_odom_turn_bias_enabled =
true;
3528 bool odom_turn_bias_enabled();
3529 void odom_turn_bias_enable(
bool set);
3530 double angle_rad = 0.0;
3531 double global_track_width = 0.0;
3532 bool odometry_enabled =
true;
3533 pose odom_target = {0.0, 0.0, 0.0};
3534 pose odom_current = {0.0, 0.0, 0.0};
3535 pose odom_second_to_last = {0.0, 0.0, 0.0};
3536 pose odom_start = {0.0, 0.0, 0.0};
3537 pose odom_target_start = {0.0, 0.0, 0.0};
3538 pose turn_to_point_target = {0.0, 0.0, 0.0};
3539 bool y_flipped =
false;
3540 bool x_flipped =
false;
3541 bool theta_flipped =
false;
3542 double flip_angle_target(
double target);
3543 double odom_imu_start = 0.0;
3544 int past_target = 0;
3545 double SPACING = 0.5;
3546 double LOOK_AHEAD = 7.0;
3548 double max_boomerang_distance = 12.0;
3549 double odom_turn_bias_amount = 1.375;
3551 double h_last = 0.0, t_last = 0.0, l_last = 0.0, r_last = 0.0;
3552 pose l_pose{0.0, 0.0, 0.0};
3553 pose r_pose{0.0, 0.0, 0.0};
3554 pose central_pose{0.0, 0.0, 0.0};
3555 double xy_current_fake = 0.0;
3556 double xy_last_fake = 0.0;
3557 double xy_delta_fake = 0.0;
3558 double new_current_fake = 0.0;
3559 bool was_odom_just_set =
false;
3560 std::pair<float, float> decide_vert_sensor(
light::tracking_wheel* tracker,
bool is_tracker_enabled,
float ime = 0.0,
float ime_track = 0.0);
3561 pose solve_xy_vert(
float p_track_width,
float current_t,
float delta_vert,
float delta_t);
3562 pose solve_xy_horiz(
float p_track_width,
float current_t,
float delta_horiz,
float delta_t);
3563 bool was_last_pp_mode_boomerang =
false;
3564 bool global_forward_drive_slew_enabled =
false;
3565 bool global_backward_drive_slew_enabled =
false;
3566 bool global_forward_swing_slew_enabled =
false;
3567 bool global_backward_swing_slew_enabled =
false;
3568 double turn_tolerance = 3.0;
3569 bool global_turn_slew_enabled =
false;
3574 bool turn_biased_left =
false;
3575 std::vector<odom> set_odoms_direction(std::vector<odom> inputs);
3576 odom set_odom_direction(
odom input);
3578 bool odom_tracker_left_enabled =
false;
3579 bool odom_tracker_right_enabled =
false;
3580 bool odom_tracker_front_enabled =
false;
3581 bool odom_tracker_back_enabled =
false;
3583 double chain_target_start = 0.0;
3584 double chain_sensor_start = 0.0;
3585 double drive_forward_motion_chain_scale = 0.0;
3586 double drive_backward_motion_chain_scale = 0.0;
3587 double swing_forward_motion_chain_scale = 0.0;
3588 double swing_backward_motion_chain_scale = 0.0;
3589 double turn_motion_chain_scale = 0.0;
3590 double used_motion_chain_scale = 0.0;
3591 bool motion_chain_backward =
false;
3593 double IMU_SCALER = 1.0;
3595 bool drive_toggle =
true;
3596 bool print_toggle =
true;
3599 bool practice_mode_is_on =
false;
3600 int swing_opposite_speed = 0;
3601 bool slew_swing_fwd_using_angle =
false;
3602 bool slew_swing_rev_using_angle =
false;
3603 bool slew_swing_using_angle =
false;
3604 bool pid_tuner_terminal_b =
false;
3605 bool pid_tuner_lcd_b =
true;
3606 void pid_tuner_print();
3607 void pid_tuner_value_modify(
float p,
float i,
float d,
float start);
3608 void pid_tuner_value_increase();
3609 void pid_tuner_value_decrease();
3610 void pid_tuner_print_brain();
3611 void pid_tuner_print_terminal();
3612 void pid_tuner_brain_init();
3615 std::string arrow =
" <--\n";
3616 bool last_controller_curve_state =
false;
3617 bool last_auton_selector_state =
false;
3618 bool pid_tuner_on =
false;
3619 std::string complete_pid_tuner_output =
"";
3620 float p_increment = 0.1, i_increment = 0.001, d_increment = 0.25, start_i_increment = 1.0;
3625 void wait_until_drive(
double target);
3626 void wait_until_turn_swing(
double target);
3636 void private_drive_set(
int left,
int right);
3641 int clipped_joystick(
int joystick);
3646 bool heading_on =
true;
3651 double TICK_PER_REV;
3652 double TICK_PER_INCH;
3653 double CIRCUMFERENCE;
3657 double WHEEL_DIAMETER;
3667 void drive_pid_task();
3668 void swing_pid_task();
3669 void turn_pid_task();
3670 void ez_auto_task();
3672 void boomerang_task();
3684 bool disable_controller =
true;
3691#define DRIVE_INTEGRATED 1
3692#define DRIVE_ADI_ENCODER 2
3693#define DRIVE_ROTATION 3
3694#define ODOM_TRACKER 4
3704 void save_l_curve_sd();
3705 void save_r_curve_sd();
3712 bool release_reset =
false;
3713 int release_timer = 0;
3716 pros::controller_digital_e_t button;
3719 button_ l_increase_;
3720 button_ l_decrease_;
3721 button_ r_increase_;
3722 button_ r_decrease_;
3727 void button_press(button_* input_name,
int button, std::function<
void()> changeCurve, std::function<
void()> save);
3732 double left_curve_scale;
3733 double right_curve_scale;
3746 bool is_reversed =
false;
Tank-drive chassis class.
void opcontrol_arcade_standard(e_type stick_type)
Sets the chassis to controller joysticks using standard arcade control, where left stick is fwd/rev.
void odom_theta_flip(bool flip=true)
Flips the rotation axis.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
void pid_wait_until_point(pose target)
Lock the code in a while loop until this point has been passed.
void pid_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)
Set's constants for drive exit conditions.
double opcontrol_curve_right(double x)
Outputs a curve from 5225A In the Zone.
void pid_wait_until(pose target)
Lock the code in a while loop until this point has been passed.
void pid_swing_chain_forward_constant_set(okapi::QAngle input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void opcontrol_speed_max_set(int speed)
Sets the max speed for user control.
double drive_tick_per_inch()
Returns current tick_per_inch.
void drive_imu_scaler_set(double scaler)
Sets a new imu scaling factor.
void pid_odom_pp_set(std::vector< odom > imovements)
Takes in odom movements to go through multiple points.
void pid_turn_set(united_pose p_itarget, drive_directions dir, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn face a point using PID and odometry.
void opcontrol_arcade_flipped(e_type stick_type)
Sets the chassis to controller joysticks using flipped arcade control, where right stick is fwd/rev.
void pid_turn_set(double target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn relative to initial heading using PID, using slew if enabled for this motion.
int drive_velocity_left()
The velocity of the left motor.
void pid_tuner_disable()
Disables PID Tuner.
void ez_tracking_task()
Tasks for tracking.
void pid_turn_set(united_pose p_itarget, drive_directions dir, int speed, e_angle_behavior behavior)
Sets the robot to turn face a point using PID and odometry.
void drive_width_set(okapi::QLength p_input)
Sets the width of the drive.
double friction_kS
Friction-feedforward coefficients in motor-command units (-127..127).
void pid_turn_relative_set(double target, int speed, bool slew_on)
Sets the robot to turn relative to current heading using PID without okapi units, using slew if enabl...
void pid_wait_until_point(united_pose target)
Lock the code in a while loop until this point has been passed, with okapi units.
void pid_swing_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)
Set's constants for swing exit conditions.
void drive_rpm_set(double rpm)
Set the cartridge/wheel rpm of the robot.
void drive_angle_set(double angle)
Sets heading of imu and target of PID, takes double as an angle.
void pid_tuner_print_terminal_set(bool input)
Toggle for printing the display of the PID Tuner to the terminal.
void slew_swing_forward_set(bool slew_on)
Sets the default slew for swing forward motions, can be overwritten in movement functions.
void drive_mode_set(e_mode p_mode, bool stop_drive=true)
Sets current mode of drive.
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void pid_swing_behavior_set(e_angle_behavior behavior)
Sets the default behavior for turns in swinging movements.
bool slew_drive_forward_get()
Returns true if slew is enabled for all drive forward movements, false otherwise.
void pid_odom_set(odom imovement)
Takes in an odom movement to go to a single point.
void pid_swing_set(e_swing type, double target, int speed, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void pid_tuner_full_enable(bool enable)
Enables the full PID tuner with unique fwd/rev constants.
pros::adi::Encoder right_tracker
Deprecated right tracking wheel.
double drive_imu_get()
Returns the current imu rotation value in degrees.
void pid_speed_max_set(int speed)
Changes max speed during a drive motion.
std::vector< int > drive_get()
Gets the chassis to voltage, -127 to 127.
bool opcontrol_curve_buttons_toggle_get()
Gets the current state of the toggle.
void slew_drive_set(bool slew_on)
Sets the default slew for drive forwards and backwards motions, can be overwritten in movement functi...
void odom_x_flip(bool flip=true)
Flips the X axis.
void pid_wait_until(double target)
Lock the code in a while loop until this position has passed for driving without okapi units.
void opcontrol_joystick_practicemode_toggle(bool toggle)
Practice mode for driver practice that shuts off the drive if you go max speed.
void pid_odom_pp_set(std::vector< odom > imovements, bool slew_on)
Takes in odom movements to go through multiple points.
light::slew slew_swing_forward
int opcontrol_speed_max_get()
Returns the max speed for user control.
void pid_swing_chain_forward_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_odom_ptp_set(odom imovement, bool slew_on)
Takes in an odom movement to go to a single point.
void odom_boomerang_distance_set(double distance)
Sets how far away the carrot point can be from the target point.
void pid_odom_smooth_pp_set(std::vector< united_odom > p_imovements)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void pid_wait()
Lock the code in a while loop until the robot has settled.
void pid_turn_relative_set(okapi::QAngle p_target, int speed, bool slew_on)
Sets the robot to turn relative to current heading using PID with okapi units, using slew if enabled ...
std::vector< double > odom_path_smooth_constants_get()
Returns the constants for smoothing out a path.
void pid_drive_set(okapi::QLength p_target, int speed)
Sets the robot to move forward using PID with okapi units, only using slew if globally enabled.
void pid_turn_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the turn pid constants object.
void pid_angle_behavior_set(e_angle_behavior behavior)
Sets the default behavior for turns in odom, swinging, and turning.
void friction_constants_set(double kS, double kV=0.0, double kQ=0.0)
Sets the friction-feedforward coefficients.
void opcontrol_curve_buttons_toggle(bool toggle)
Enables/disables modifying the joystick input curves with the controller.
tracking_wheel * odom_tracker_left
Left vertical tracking wheel.
void pid_drive_chain_forward_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
double pid_tuner_increment_i_get()
Returns the value that PID Tuner increments I.
void drive_defaults_set()
Sets drive defaults.
void pid_drive_chain_backward_constant_set(okapi::QLength input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_turn_chain_constant_set(okapi::QAngle input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_turn_relative_set(okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn relative to current heading using PID with okapi units, using slew if enabled ...
void opcontrol_arcade_scaling(bool enable)
Toggles vector scaling for arcade control.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
void odom_tracker_right_set(tracking_wheel *input)
Sets the parallel right tracking wheel for odometry.
void pid_turn_set(pose itarget, drive_directions dir, int speed, e_angle_behavior behavior)
Sets the robot to turn face a point using PID and odometry.
bool pid_tuner_enabled()
Checks if PID Tuner is enabled.
void opcontrol_curve_buttons_iterate()
Iterates modifying controller curves with the controller.
void slew_drive_constants_backward_set(okapi::QLength distance, int min_speed)
Sets constants for slew for driving backward.
bool pto_check(pros::Motor check_if_pto)
Checks if the motor is currently in pto_list.
void odom_xy_set(double x, double y)
Sets the current X and Y coordinate for the robot.
bool slew_turn_get()
Returns true if slew is enabled for all turn motions, false otherwise.
void pid_turn_set(united_pose p_itarget, drive_directions dir, int speed)
Sets the robot to turn face a point using PID and odometry.
void pid_swing_constants_backward_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the backward swing pid constants object.
void odom_tracker_front_set(tracking_wheel *input)
Sets the perpendicular front tracking wheel for odometry.
void odom_turn_bias_set(double bias)
A proportion of how prioritized turning is during odometry motions.
void odom_tracker_left_set(tracking_wheel *input)
Sets the parallel left tracking wheel for odometry.
void pid_targets_reset()
Resets all PID targets to 0.
void pid_drive_constants_forward_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the forward pid constants object.
void slew_odom_reenable(bool reenable)
Allows slew to reenable when the new input speed is larger than the current speed during pure pursuit...
void pid_tuner_enable()
Enables PID Tuner.
void pid_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)
Set's constants for turn exit conditions.
void opcontrol_drive_sensors_reset()
Resets drive sensors at the start of opcontrol.
int CURRENT_MA
Global current mA.
void pid_odom_set(std::vector< united_odom > p_imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void pid_turn_set(pose itarget, drive_directions dir, int speed)
Sets the robot to turn face a point using PID and odometry.
pose odom_pose_get()
Returns the current pose of the robot.
void odom_tracker_back_set(tracking_wheel *input)
Sets the perpendicular back tracking wheel for odometry.
void pid_odom_set(okapi::QLength p_target, int speed, bool slew_on)
Sets the robot to move forward using PID with okapi units, using slew if enabled for this motion.
PID::Constants pid_drive_constants_forward_get()
Returns PID constants with PID::Constants.
void odom_boomerang_dlead_set(double input)
Sets a new dlead.
void pid_swing_relative_set(e_swing type, double target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
pros::Rotation left_rotation
Deprecated left rotation tracker.
void odom_path_spacing_set(okapi::QLength p_spacing)
Sets the spacing between points when points get injected into the path.
void pid_angle_behavior_tolerance_set(okapi::QAngle p_tolerance)
Gives some wiggle room in shortest vs longest, so a 180.1 and 179.9 degree turns have consistent beha...
Drive(std::vector< int > left_motor_ports, std::vector< int > right_motor_ports, int imu_port, double wheel_diameter, double ticks, double ratio=1.0)
Creates a Drive Controller using internal encoders.
Drive(std::vector< int > left_motor_ports, std::vector< int > right_motor_ports, int imu_port, double wheel_diameter, double ticks, double ratio, std::vector< int > left_tracker_ports, std::vector< int > right_tracker_ports) __attribute__((deprecated("Use the integrated encoder const ructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")))
Creates a Drive Controller using encoders plugged into the brain.
void pid_swing_chain_constant_set(okapi::QAngle input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_swing_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)
Set's constants for swing exit conditions.
bool drive_current_right_over()
Return true when the motor is over current.
bool opcontrol_joystick_practicemode_toggle_get()
Gets current state of the toggle.
bool drive_imu_calibrated()
Checks if the imu calibrated successfully or if it took longer than expected.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
double odom_boomerang_distance_get()
Returns how far away the carrot point can be from target.
tracking_wheel * odom_tracker_front
Front horizontal tracking wheel.
double pid_tuner_increment_p_get()
Returns the value that PID Tuner increments P.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
double drive_mA_right()
The watts of the right motor.
void pid_drive_toggle(bool toggle)
Toggles set drive in autonomous.
void opcontrol_tank()
Sets the chassis to controller joysticks using tank control.
void slew_swing_constants_backward_set(okapi::QLength distance, int min_speed)
Sets constants for slew for backward swing movements.
void pid_odom_set(united_odom p_imovement)
Takes in an odom movement to go to a single point.
tracking_wheel * odom_tracker_back
Back horizontal tracking wheel.
void odom_x_set(double x)
Sets the current X coordinate of the robot.
std::vector< double > opcontrol_curve_default_get()
Gets the default joystick curves, in {left, right}.
void pid_odom_boomerang_set(united_odom p_imovement)
Takes in an odom movement to go to a single point using boomerang.
int drive_sensor_right_raw()
The position of the right sensor.
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
double drive_imu_accel_get()
Returns the current imu accel x + accel y value.
void pid_turn_set(united_pose p_itarget, drive_directions dir, int speed, bool slew_on)
Sets the robot to turn face a point using PID and odometry.
int drive_current_limit_get()
Gets the limit for the current on the drive.
void pid_drive_chain_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void odom_y_set(okapi::QLength p_y)
Sets the current Y coordinate of the robot.
double pid_swing_chain_forward_constant_get()
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion fo...
e_angle_behavior pid_swing_behavior_get()
Returns the turn behavior for swings.
PID::Constants pid_turn_constants_get()
Returns PID constants with PID::Constants.
void pid_odom_set(double target, int speed, bool slew_on)
Sets the robot to move forward using PID without okapi units, using slew if enabled for this motion.
bool pid_tuner_print_terminal_enabled()
Returns true if printing to terminal is enabled.
void drive_angle_set(okapi::QAngle p_angle)
Sets heading of imu and target of PID, okapi angle.
void pid_tuner_increment_i_set(double i)
Sets the value that PID Tuner increments I.
void pid_wait_until_index_started(int index)
Lock the code in a while loop until this point becomes the target.
e_mode mode
Current mode of the drive.
Drive(std::vector< int > left_motor_ports, std::vector< int > right_motor_ports, int imu_port, double wheel_diameter, double ticks, double ratio, std::vector< int > left_tracker_ports, std::vector< int > right_tracker_ports, int expander_smart_port) __attribute__((deprecated("Use the integrated encoder const ructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")))
Creates a Drive Controller using encoders plugged into a 3 wire expander.
int pid_turn_min_get()
Returns minimum power for turns when kI and startI are enabled.
void pid_swing_chain_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void drive_imu_display_loading(int iter)
Loading display while the IMU calibrates.
double opcontrol_drive_activebrake_get()
Returns kP for active brake.
void pid_turn_relative_set(okapi::QAngle p_target, int speed, e_angle_behavior behavior)
Sets the robot to turn relative to current heading using PID with okapi units, only using slew if glo...
void pid_wait_quick_chain()
Lock the code in a while loop until the robot has settled.
double pid_tuner_increment_d_get()
Returns the value that PID Tuner increments D.
double pid_turn_chain_constant_get()
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion fo...
void pid_swing_chain_backward_constant_set(okapi::QAngle input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
tracking_wheel * odom_tracker_right
Right vertical tracking wheel.
void drive_width_set(double input)
Sets the width of the drive.
void drive_current_limit_set(int mA)
Sets the limit for the current on the drive.
std::vector< pros::Motor > left_motors
Vector of pros motors for the left chassis.
void drive_set(int left, int right)
Sets the chassis to voltage.
void odom_path_spacing_set(double spacing)
Sets the spacing between points when points get injected into the path.
bool slew_drive_backward_get()
Returns true if slew is enabled for all drive backward movements, false otherwise.
void pid_odom_smooth_pp_set(std::vector< odom > imovements)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void odom_x_set(okapi::QLength p_x)
Sets the current X coordinate of the robot.
double drive_width_get()
Returns the width of the drive.
bool slew_odom_reenabled()
Returns if slew will reenable when the new input speed is larger than the current speed during pure p...
PID::Constants pid_swing_constants_get()
Returns PID constants with PID::Constants.
void opcontrol_curve_default_set(double left, double right=0)
Sets the default joystick curves.
double odom_boomerang_dlead_get()
Returns the current dlead.
double odom_path_spacing_get()
Returns the spacing between points when points get injected into the path.
void pid_turn_set(pose itarget, drive_directions dir, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn face a point using PID and odometry.
void pid_odom_ptp_set(odom imovement)
Takes in an odom movement to go to a single point.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
void odom_theta_set(okapi::QAngle p_a)
Sets the current Theta of the robot.
pros::adi::Encoder left_tracker
Deprecated left tracking wheel.
void odom_xyt_set(double x, double y, double t)
Sets the current X, Y, and Theta values for the robot.
void pid_drive_set(okapi::QLength p_target, int speed, bool slew_on, bool toggle_heading=true)
Sets the robot to move forward using PID with okapi units, using slew if enabled for this motion.
void slew_drive_forward_set(bool slew_on)
Sets the default slew for drive forward motions, can be overwritten in movement functions.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
double pid_drive_chain_forward_constant_get()
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion fo...
light::slew slew_left
Slew objects.
void pid_turn_set(pose itarget, drive_directions dir, int speed, bool slew_on)
Sets the robot to turn face a point using PID and odometry.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
void slew_turn_set(bool slew_on)
Sets the default slew for turn motions, can be overwritten in movement functions.
double odom_y_get()
Returns the current Y coordinate of the robot in inches.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
std::vector< pros::controller_digital_e_t > opcontrol_curve_buttons_right_get()
Returns a vector of pros controller buttons user for the right joystick curve, in {decrease,...
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
void drive_ratio_set(double ratio)
Set the ratio of the robot.
void pid_tuner_increment_start_i_set(double start_i)
Sets the value that PID Tuner increments Start I.
void pid_odom_injected_pp_set(std::vector< united_odom > p_imovements)
Takes in odom movements to go through multiple points, will inject into the path.
bool odom_x_direction_get()
Checks if X axis is flipped.
void pid_swing_set(e_swing type, double target, int speed)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void opcontrol_curve_buttons_left_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase)
Sets buttons for modifying the left joystick curve.
e_angle_behavior pid_angle_behavior_bias_get()
Returns the behavior when a turn is within its tolerance, you can have it bias left or right.
void pid_odom_boomerang_set(united_odom p_imovement, bool slew_on)
Takes in an odom movement to go to a single point using boomerang.
bool drive_imu_calibrate(bool run_loading_animation=true)
Calibrates the IMU, recommended to run in initialize().
void slew_drive_constants_set(okapi::QLength distance, int min_speed)
Sets constants for slew for driving.
double drive_imu_scaler_get()
Returns the current imu scaling factor.
void pid_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)
Set's constants for drive exit conditions.
void odom_pose_set(united_pose itarget)
Sets the current pose of the robot.
std::vector< pros::Motor > right_motors
Vector of pros motors for the right chassis.
void pid_odom_injected_pp_set(std::vector< odom > imovements)
Takes in odom movements to go through multiple points, will inject into the path.
void pid_odom_set(std::vector< united_odom > p_imovements)
Takes in odom movements to go through multiple points, will inject and smooth the path.
pros::Imu imu
Inertial sensor.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
void pid_swing_constants_forward_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the forward swing pid constants object.
bool odom_enabled()
Returns whether the bot is tracking with odometry.
bool pid_drive_toggle_get()
Gets the current state of the toggle.
void pid_tuner_toggle()
Toggles PID tuner between enabled and disabled.
void pid_odom_injected_pp_set(std::vector< united_odom > p_imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject into the path.
void pid_wait_until(okapi::QLength target)
Lock the code in a while loop until this position has passed for driving with okapi units.
void pid_turn_chain_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_odom_behavior_set(e_angle_behavior behavior)
Sets the default behavior for turns in odom turning movements.
void pid_odom_boomerang_set(odom imovement)
Takes in an odom movement to go to a single point using boomerang.
void pid_turn_set(okapi::QAngle p_target, int speed, e_angle_behavior behavior)
Sets the robot to turn relative to initial heading using PID with okapi units.
bool pid_tuner_full_enabled()
Returns if the full PID tuner with unique fwd/rev constants is enabled.
void pid_turn_set(double target, int speed)
Sets the robot to turn relative to initial heading using PID.
double opcontrol_curve_left(double x)
Outputs a curve from 5225A In the Zone.
void opcontrol_joystick_threshold_iterate(int l_stick, int r_stick)
Sets minimum value distance constants.
int drive_sensor_left_raw()
The position of the left sensor.
std::vector< pros::controller_digital_e_t > opcontrol_curve_buttons_left_get()
Returns a vector of pros controller buttons user for the left joystick curve, in {decrease,...
void pid_print_toggle(bool toggle)
Toggles printing in autonomous.
double friction_ff(double v_target)
Computes the friction-feedforward term for a target motor-cmd-unit velocity.
void pid_wait_until_index(int index)
Lock the code in a while loop until this point has been passed.
bool odom_theta_direction_get()
Checks if the rotation axis is flipped.
void pid_odom_set(std::vector< odom > imovements)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void pid_swing_relative_set(e_swing type, double target, int speed, e_angle_behavior behavior)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
double drive_sensor_right()
The position of the right sensor in inches.
void pid_swing_relative_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
void pid_turn_relative_set(double target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn relative to current heading using PID without okapi units, using slew if enabl...
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)
Set's constants for odom driving exit conditions.
double drive_ratio_get()
Returns the ratio of the drive.
void pid_wait_quick()
Lock the code in a while loop until the robot has settled.
void pid_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)
Set's constants for turn exit conditions.
void pid_drive_constants_backward_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the backwards pid constants object.
void pid_swing_chain_backward_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_odom_smooth_pp_set(std::vector< odom > imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void opcontrol_joystick_threshold_set(int threshold)
Sets a new threshold for the joystick.
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
e_mode drive_mode_get()
Returns current mode of drive.
void pid_odom_injected_pp_set(std::vector< odom > imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject into the path.
pros::Rotation right_rotation
Deprecated right rotation tracker.
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void pid_turn_behavior_set(e_angle_behavior behavior)
Sets the default behavior for turns in turning movements.
bool odom_y_direction_get()
Checks if Y axis is flipped.
void pto_add(std::vector< pros::Motor > pto_list)
Adds motors to the pto list, removing them from the drive.
void pid_swing_relative_set(e_swing type, double target, int speed, int opposite_speed, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior)
Sets the robot to turn only using the left or right side relative to current heading using PID with o...
Drive(std::vector< int > left_motor_ports, std::vector< int > right_motor_ports, int imu_port, double wheel_diameter, double ratio, int left_rotation_port, int right_rotation_port) __attribute__((deprecated("Use the integrated encoder const ructor with odom_tracker_left_set() and odom_tracker_right_set() instead!")))
Creates a Drive Controller using rotation sensors.
void pid_angle_behavior_bias_set(e_angle_behavior behavior)
When a turn is within its tolerance, you can have it bias left or right.
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)
Set's constants for odom driving exit conditions.
PID::Constants pid_heading_constants_get()
Returns PID constants with PID::Constants.
void pid_turn_set(okapi::QAngle p_target, int speed)
Sets the robot to turn relative to initial heading using PID with okapi units.
int pid_speed_max_get()
Returns max speed of drive during autonomous.
void slew_drive_backward_set(bool slew_on)
Sets the default slew for drive backward motions, can be overwritten in movement functions.
void pid_tuner_increment_d_set(double d)
Sets the value that PID Tuner increments D.
light::slew slew_swing_backward
void slew_drive_constants_forward_set(okapi::QLength distance, int min_speed)
Sets constants for slew for driving forward.
void pid_odom_set(united_odom p_imovement, bool slew_on)
Takes in an odom movement to go to a single point.
void odom_xy_set(okapi::QLength p_x, okapi::QLength p_y)
Sets the current X and Y coordinate for the robot.
void pid_tuner_increment_p_set(double p)
Sets the value that PID Tuner increments P.
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void pid_heading_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the heading pid constants object.
void pid_odom_set(odom imovement, bool slew_on)
Takes in an odom movement to go to a single point.
void slew_swing_constants_forward_set(okapi::QAngle distance, int min_speed)
Sets constants for slew for swing forward movements.
void initialize()
Calibrates imu and initializes sd card to curve.
int opcontrol_joystick_threshold_get()
Gets the threshold for the joystick.
void pid_tuner_iterate()
Iterates through controller inputs to modify PID constants.
void slew_swing_set(bool slew_on)
Sets the default slew for swing forward and backward motions, can be overwritten in movement function...
double odom_theta_get()
Returns the current Theta of the robot in degrees.
double odom_turn_bias_get()
Returns the proportion of how prioritized turning is during odometry motions.
double odom_look_ahead_get()
Returns how far away the robot looks in the path during pure pursuits.
void pid_swing_min_set(int min)
Sets minimum power for swings when kI and startI are enabled.
void pid_odom_set(double target, int speed)
Sets the robot to move forward using PID without okapi units, only using slew if globally enabled.
void odom_pose_set(pose itarget)
Sets the current pose of the robot.
bool slew_swing_forward_get()
Returns true if slew is enabled for all swing forward motions, false otherwise.
void drive_sensor_reset()
Reset all the chassis motors and tracking wheels, recommended to run at the start of your autonomous ...
void pid_wait_until(united_pose target)
Lock the code in a while loop until this point has been passed, with okapi units.
void odom_y_set(double y)
Sets the current Y coordinate of the robot.
void pid_wait_until(okapi::QAngle target)
Lock the code in a while loop until this position has passed for turning or swinging with okapi units...
double pid_swing_chain_backward_constant_get()
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion fo...
double pid_tuner_increment_start_i_get()
Returns the value that PID Tuner increments Start I.
int pid_swing_min_get()
Returns minimum power for swings when kI and startI are enabled.
void slew_swing_constants_set(okapi::QLength distance, int min_speed)
Sets constants for slew for swing movements.
void drive_imu_reset(double new_heading=0)
Resets the current imu value.
void pid_drive_chain_forward_constant_set(okapi::QLength input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
bool drive_current_left_over()
Return true when the motor is over current.
void pid_odom_set(std::vector< odom > imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void opcontrol_curve_sd_initialize()
Initializes left and right curves with the SD card, recommended to run in initialize().
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)
Set's constants for odom turning exit conditions.
void pid_swing_relative_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
e_angle_behavior pid_turn_behavior_get()
Returns the turn behavior for turns.
void pid_turn_relative_set(okapi::QAngle p_target, int speed)
Sets the robot to turn relative to current heading using PID with okapi units, only using slew if glo...
bool pid_tuner_print_brain_enabled()
Returns true if printing to brain is enabled.
bool opcontrol_arcade_scaling_enabled()
Returns if vector scaling for arcade control is enabled.
std::vector< int > pto_active
Vector of pros motors that are disconnected from the drive.
void pid_swing_relative_set(e_swing type, double target, int speed, int opposite_speed)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
void odom_enable(bool input)
Enables / disables tracking.
void pid_drive_set(double target, int speed)
Sets the robot to move forward using PID without okapi units, only using slew if globally enabled.
void pid_odom_ptp_set(united_odom p_imovement, bool slew_on)
Takes in an odom movement to go to a single point.
pros::motor_brake_mode_e_t drive_brake_get()
Returns the brake mode of the drive in pros_brake_mode_e_t_.
void odom_path_print()
Prints the current path the robot is following.
bool opcontrol_drive_reverse_get()
Gets current state of the toggle.
void opcontrol_curve_buttons_right_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase)
Sets buttons for modifying the right joystick curve.
void pid_odom_smooth_pp_set(std::vector< united_odom > p_imovements, bool slew_on)
Takes in odom movements to go through multiple points, will inject and smooth the path.
void pto_toggle(std::vector< pros::Motor > pto_list, bool toggle)
Adds/removes motors from drive.
std::vector< const_and_name > pid_tuner_full_pids
Vector used for the full PID Tuner.
PID::Constants pid_swing_constants_backward_get()
Returns PID constants with PID::Constants.
double odom_x_get()
Returns the current X coordinate of the robot in inches.
void pid_angle_behavior_tolerance_set(double tolerance)
Gives some wiggle room in shortest vs longest, so a 180.1 and 179.9 degree turns have consistent beha...
void pid_odom_boomerang_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the odom boomerang pid constants object.
void pid_drive_chain_backward_constant_set(double input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void pid_odom_pp_set(std::vector< united_odom > p_imovements, bool slew_on)
Takes in odom movements to go through multiple points.
double drive_mA_left()
The watts of the left motor.
void slew_swing_backward_set(bool slew_on)
Sets the default slew for swing backward motions, can be overwritten in movement functions.
void pid_turn_relative_set(double target, int speed)
Sets the robot to turn relative to current heading using PID without okapi units, only using slew if ...
void odom_xyt_set(okapi::QLength p_x, okapi::QLength p_y, okapi::QAngle p_t)
Sets the current X, Y, and Theta values for the robot.
bool interfered
Autonomous interference detection.
PID::Constants pid_drive_constants_backward_get()
Returns PID constants with PID::Constants.
void pid_odom_boomerang_set(odom imovement, bool slew_on)
Takes in an odom movement to go to a single point using boomerang.
void pid_drive_set(double target, int speed, bool slew_on, bool toggle_heading=true)
Sets the robot to move forward using PID without okapi units, using slew if enabled for this motion.
void pid_odom_pp_set(std::vector< united_odom > p_imovements)
Takes in odom movements to go through multiple points.
void pid_turn_set(double target, int speed, bool slew_on)
Sets the robot to turn relative to initial heading using PID, using slew if enabled for this motion.
void odom_reset()
Resets xyt to 0.
PID headingPID
PID objects.
void pid_swing_relative_set(e_swing type, double target, int speed, bool slew_on)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
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)
Set's constants for odom turning exit conditions.
void pid_drive_chain_constant_set(okapi::QLength input)
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
void opcontrol_drive_reverse_set(bool toggle)
Reversal for drivetrain in opcontrol that flips the left and right side and the direction of the driv...
std::vector< double > friction_constants_get()
Returns {kS, kV, kQ}.
void pid_turn_set(double target, int speed, e_angle_behavior behavior)
Sets the robot to turn relative to initial heading using PID.
void odom_look_ahead_set(double distance)
Sets how far away the robot looks in the path during pure pursuits.
double drive_sensor_left()
The position of the left sensor in inches.
void slew_turn_constants_set(okapi::QAngle distance, int min_speed)
Sets constants for slew for turns.
e_swing current_swing
Current swing type.
void drive_brake_set(pros::motor_brake_mode_e_t brake_type)
Changes the way the drive behaves when it is not under active user control.
void pid_odom_angular_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the odom angular pid constants object.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
void pto_remove(std::vector< pros::Motor > pto_list)
Removes motors from the pto list, adding them to the drive.
void slew_swing_constants_backward_set(okapi::QAngle distance, int min_speed)
Sets constants for slew for swing backward movements.
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn only using the left or right side relative to initial heading using PID with o...
void pid_turn_set(okapi::QAngle p_target, int speed, bool slew_on)
Sets the robot to turn relative to initial heading using PID with okapi units, using slew if enabled ...
void odom_look_ahead_set(okapi::QLength p_distance)
Sets how far away the robot looks in the path during pure pursuits.
void pid_tuner_print_brain_set(bool input)
Toggle for printing the display of the PID Tuner to the brain.
void pid_odom_ptp_set(united_odom p_imovement)
Takes in an odom movement to go to a single point.
e_angle_behavior pid_odom_behavior_get()
Returns the turn behavior for odom turns.
void odom_theta_set(double a)
Sets the current angle of the robot.
bool pid_print_toggle_get()
Gets the current state of the toggle.
int drive_velocity_right()
The velocity of the right motor.
void odom_boomerang_distance_set(okapi::QLength p_distance)
Sets how far away the carrot point can be from the target point.
bool slew_swing_backward_get()
Returns true if slew is enabled for all swing backward motions, false otherwise.
void pid_swing_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the swing pid constants object.
void slew_swing_constants_forward_set(okapi::QLength distance, int min_speed)
Sets constants for slew for forward swing movements.
void odom_path_smooth_constants_set(double weight_smooth, double weight_data, double tolerance)
Sets the constants for smoothing out a path.
std::vector< const_and_name > pid_tuner_pids
Vector used for a simplified PID Tuner.
PID::Constants opcontrol_drive_activebrake_constants_get()
Returns all PID constants for active brake.
PID::Constants pid_swing_constants_forward_get()
Returns PID constants with PID::Constants.
void slew_swing_constants_set(okapi::QAngle distance, int min_speed)
Sets constants for slew for swing movements.
int JOYSTICK_THRESHOLD
Joysticks will return 0 when they are within this number.
void pid_turn_relative_set(double target, int speed, e_angle_behavior behavior)
Sets the robot to turn relative to current heading using PID without okapi units, only using slew if ...
double drive_rpm_get()
Returns the current cartridge / wheel rpm.
PID::Constants pid_drive_constants_get()
Returns PID constants with PID::Constants.
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading without okapi un...
void pid_drive_constants_set(double p, double i=0.0, double d=0.0, double p_start_i=0.0)
Set the drive pid constants object.
pros::Task ez_auto
Tasks for autonomous.
pros::motor_brake_mode_e_t CURRENT_BRAKE
Global current brake mode.
void odom_y_flip(bool flip=true)
Flips the Y axis.
light::slew slew_backward
void pid_turn_set(okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on)
Sets the robot to turn relative to initial heading using PID with okapi units, using slew if enabled ...
void pid_turn_min_set(int min)
The minimum power for turns when kI and startI are enabled.
void pid_swing_relative_set(e_swing type, double target, int speed)
Sets the robot to turn only using the left or right side relative to current heading using PID withou...
double pid_angle_behavior_tolerance_get()
Returns the wiggle room in shortest vs longest, so a 180.1 and 179.9 degree turns have consistent beh...
void opcontrol_drive_activebrake_set(double kp, double ki=0.0, double kd=0.0, double start_i=0.0)
Runs a PID loop on the drive when the joysticks are released.
double pid_drive_chain_backward_constant_get()
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion fo...
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, bool slew_on)
Sets the robot to turn using only the left or right side relative to initial heading with okapi units...
void pid_odom_set(okapi::QLength p_target, int speed)
Sets the robot to move forward using PID with okapi units, only using slew if globally enabled.
Discrete PID controller with rich exit-condition support.
Constants constants
Active PID gain constants (read/write).
Slew-rate limiter that ramps speed up linearly over a configurable distance.
Single tracking wheel for odometry.
Public LightLib odometry / pose-estimation API.
e_type
Arcade joystick layout.
e_angle_behavior
How to choose a turn direction when reaching an absolute heading.
@ raw
Use signed delta as-is (no wrap).
@ shortest
Pick the smaller of CW/CCW.
pose(*)() PoseGetterFn
External pose getter used by register_pose_source().
e_swing
Direction for swing-turn motions.
void(*)(pose) PoseSetterFn
External pose setter used by register_pose_source().
e_mode
Active chassis motion mode.
drive_directions
Drive direction with multiple spelling aliases.
void register_pose_source(PoseGetterFn getter, PoseSetterFn setter)
Register an external pose source.
Discrete PID controller with rich exit-condition support.
Slew-rate limiter that ramps motor output up over a configurable distance.
One waypoint of an odom-mode movement.
2D pose: position (in) and heading (deg).
One waypoint of an odom-mode movement, with okapi units.
2D pose with okapi units.
Wrapper around an ADI optical encoder or a smart pros::Rotation sensor that exposes the wheel's dista...
Shared types, enums, math helpers, and unit conversions used across LightLib.