|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Tank-drive chassis class. More...
#include <drive.hpp>
Classes | |
| struct | const_and_name |
Public Member Functions | |
| void | friction_constants_set (double kS, double kV=0.0, double kQ=0.0) |
| Sets the friction-feedforward coefficients. | |
| std::vector< double > | friction_constants_get () |
| Returns {kS, kV, kQ}. | |
| double | friction_ff (double v_target) |
| Computes the friction-feedforward term for a target motor-cmd-unit velocity. | |
| void | slew_swing_constants_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for swing movements. | |
| void | slew_swing_constants_forward_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for forward swing movements. | |
| void | slew_swing_constants_backward_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for backward swing movements. | |
| void | slew_swing_constants_set (okapi::QAngle distance, int min_speed) |
| Sets constants for slew for swing movements. | |
| void | slew_swing_constants_forward_set (okapi::QAngle distance, int min_speed) |
| Sets constants for slew for swing forward movements. | |
| void | slew_swing_constants_backward_set (okapi::QAngle distance, int min_speed) |
| Sets constants for slew for swing backward movements. | |
| void | slew_turn_constants_set (okapi::QAngle distance, int min_speed) |
| Sets constants for slew for turns. | |
| void | slew_drive_constants_forward_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for driving forward. | |
| void | slew_drive_constants_backward_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for driving backward. | |
| void | slew_drive_constants_set (okapi::QLength distance, int min_speed) |
| Sets constants for slew for driving. | |
| void | slew_drive_set (bool slew_on) |
| Sets the default slew for drive forwards and backwards motions, can be overwritten in movement functions. | |
| void | slew_drive_forward_set (bool slew_on) |
| Sets the default slew for drive forward motions, can be overwritten in movement functions. | |
| bool | slew_drive_forward_get () |
| Returns true if slew is enabled for all drive forward movements, false otherwise. | |
| void | slew_drive_backward_set (bool slew_on) |
| Sets the default slew for drive backward motions, can be overwritten in movement functions. | |
| bool | slew_drive_backward_get () |
| Returns true if slew is enabled for all drive backward movements, false otherwise. | |
| void | slew_swing_set (bool slew_on) |
| Sets the default slew for swing forward and backward motions, can be overwritten in movement functions. | |
| void | slew_swing_forward_set (bool slew_on) |
| Sets the default slew for swing forward motions, can be overwritten in movement functions. | |
| bool | slew_swing_forward_get () |
| Returns true if slew is enabled for all swing forward motions, false otherwise. | |
| void | slew_swing_backward_set (bool slew_on) |
| Sets the default slew for swing backward motions, can be overwritten in movement functions. | |
| bool | slew_swing_backward_get () |
| Returns true if slew is enabled for all swing backward motions, false otherwise. | |
| void | slew_turn_set (bool slew_on) |
| Sets the default slew for turn motions, can be overwritten in movement functions. | |
| bool | slew_turn_get () |
| Returns true if slew is enabled for all turn motions, false otherwise. | |
| void | slew_odom_reenable (bool reenable) |
| Allows slew to reenable when the new input speed is larger than the current speed during pure pursuits. | |
| bool | slew_odom_reenabled () |
| Returns if slew will reenable when the new input speed is larger than the current speed during pure pursuits. | |
| void | drive_mode_set (e_mode p_mode, bool stop_drive=true) |
| Sets current mode of drive. | |
| e_mode | drive_mode_get () |
| Returns current mode of drive. | |
| void | initialize () |
| Calibrates imu and initializes sd card to curve. | |
| 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. | |
| 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. | |
| 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 | drive_defaults_set () |
| Sets drive defaults. | |
| void | ez_tracking_task () |
| Tasks for tracking. | |
| void | odom_enable (bool input) |
| Enables / disables tracking. | |
| bool | odom_enabled () |
| Returns whether the bot is tracking with odometry. | |
| void | drive_width_set (double input) |
| Sets the width of the drive. | |
| void | drive_width_set (okapi::QLength p_input) |
| Sets the width of the drive. | |
| double | drive_width_get () |
| Returns the width of the drive. | |
| void | odom_x_set (double x) |
| Sets the current X coordinate of the robot. | |
| void | odom_x_set (okapi::QLength p_x) |
| Sets the current X coordinate of the robot. | |
| double | odom_x_get () |
| Returns the current X coordinate of the robot in inches. | |
| void | odom_y_set (double y) |
| Sets the current Y coordinate of the robot. | |
| void | odom_y_set (okapi::QLength p_y) |
| Sets the current Y coordinate of the robot. | |
| double | odom_y_get () |
| Returns the current Y coordinate of the robot in inches. | |
| void | odom_theta_set (double a) |
| Sets the current angle of the robot. | |
| void | odom_theta_set (okapi::QAngle p_a) |
| Sets the current Theta of the robot. | |
| double | odom_theta_get () |
| Returns the current Theta of the robot in degrees. | |
| void | odom_pose_set (pose itarget) |
| Sets the current pose of the robot. | |
| void | odom_pose_set (united_pose itarget) |
| Sets the current pose of the robot. | |
| void | odom_xy_set (double x, double y) |
| Sets the current X and Y coordinate for the robot. | |
| void | odom_xy_set (okapi::QLength p_x, okapi::QLength p_y) |
| Sets the current X and Y coordinate for the robot. | |
| void | odom_xyt_set (double x, double y, double t) |
| Sets the current X, Y, and Theta values for the robot. | |
| 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. | |
| pose | odom_pose_get () |
| Returns the current pose of the robot. | |
| void | odom_reset () |
| Resets xyt to 0. | |
| void | odom_x_flip (bool flip=true) |
| Flips the X axis. | |
| bool | odom_x_direction_get () |
| Checks if X axis is flipped. | |
| void | odom_y_flip (bool flip=true) |
| Flips the Y axis. | |
| bool | odom_y_direction_get () |
| Checks if Y axis is flipped. | |
| void | odom_theta_flip (bool flip=true) |
| Flips the rotation axis. | |
| bool | odom_theta_direction_get () |
| Checks if the rotation axis is flipped. | |
| void | odom_boomerang_dlead_set (double input) |
| Sets a new dlead. | |
| double | odom_boomerang_dlead_get () |
| Returns the current dlead. | |
| void | odom_boomerang_distance_set (double distance) |
| Sets how far away the carrot point can be from the target point. | |
| void | odom_boomerang_distance_set (okapi::QLength p_distance) |
| Sets how far away the carrot point can be from the target point. | |
| double | odom_boomerang_distance_get () |
| Returns how far away the carrot point can be from target. | |
| void | odom_turn_bias_set (double bias) |
| A proportion of how prioritized turning is during odometry motions. | |
| double | odom_turn_bias_get () |
| Returns the proportion of how prioritized turning is during odometry motions. | |
| void | odom_path_spacing_set (double spacing) |
| Sets the spacing between points when points get injected into the path. | |
| void | odom_path_spacing_set (okapi::QLength p_spacing) |
| Sets the spacing between points when points get injected into the path. | |
| double | odom_path_spacing_get () |
| Returns the spacing between points when points get injected into the path. | |
| void | odom_path_smooth_constants_set (double weight_smooth, double weight_data, double tolerance) |
| Sets the constants for smoothing out a path. | |
| std::vector< double > | odom_path_smooth_constants_get () |
| Returns the constants for smoothing out a path. | |
| void | odom_path_print () |
| Prints the current path the robot is following. | |
| void | odom_look_ahead_set (double distance) |
| Sets how far away the robot looks in the path during pure pursuits. | |
| void | odom_look_ahead_set (okapi::QLength p_distance) |
| Sets how far away the robot looks in the path during pure pursuits. | |
| double | odom_look_ahead_get () |
| Returns how far away the robot looks in the path during pure pursuits. | |
| void | odom_tracker_left_set (tracking_wheel *input) |
| Sets the parallel left tracking wheel for odometry. | |
| void | odom_tracker_right_set (tracking_wheel *input) |
| Sets the parallel right tracking wheel for odometry. | |
| void | odom_tracker_front_set (tracking_wheel *input) |
| Sets the perpendicular front tracking wheel for odometry. | |
| void | odom_tracker_back_set (tracking_wheel *input) |
| Sets the perpendicular back tracking wheel for odometry. | |
| void | pid_angle_behavior_set (e_angle_behavior behavior) |
| Sets the default behavior for turns in odom, swinging, and turning. | |
| void | pid_turn_behavior_set (e_angle_behavior behavior) |
| Sets the default behavior for turns in turning movements. | |
| void | pid_swing_behavior_set (e_angle_behavior behavior) |
| Sets the default behavior for turns in swinging movements. | |
| void | pid_odom_behavior_set (e_angle_behavior behavior) |
| Sets the default behavior for turns in odom turning movements. | |
| e_angle_behavior | pid_turn_behavior_get () |
| Returns the turn behavior for turns. | |
| e_angle_behavior | pid_swing_behavior_get () |
| Returns the turn behavior for swings. | |
| e_angle_behavior | pid_odom_behavior_get () |
| Returns the turn behavior for odom turns. | |
| 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 behavior. | |
| 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 behavior. | |
| 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 behavior. | |
| 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. | |
| 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 | opcontrol_tank () |
| Sets the chassis to controller joysticks using tank control. | |
| 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 | opcontrol_arcade_flipped (e_type stick_type) |
| Sets the chassis to controller joysticks using flipped arcade control, where right stick is fwd/rev. | |
| void | opcontrol_curve_sd_initialize () |
| Initializes left and right curves with the SD card, recommended to run in initialize(). | |
| void | opcontrol_curve_default_set (double left, double right=0) |
| Sets the default joystick curves. | |
| std::vector< double > | opcontrol_curve_default_get () |
| Gets the default joystick curves, in {left, right}. | |
| 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 | opcontrol_drive_activebrake_get () |
| Returns kP for active brake. | |
| PID::Constants | opcontrol_drive_activebrake_constants_get () |
| Returns all PID constants for active brake. | |
| void | opcontrol_curve_buttons_toggle (bool toggle) |
| Enables/disables modifying the joystick input curves with the controller. | |
| bool | opcontrol_curve_buttons_toggle_get () |
| Gets the current state of the toggle. | |
| 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. | |
| 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, increase}. | |
| 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. | |
| 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, increase}. | |
| double | opcontrol_curve_left (double x) |
| Outputs a curve from 5225A In the Zone. | |
| double | opcontrol_curve_right (double x) |
| Outputs a curve from 5225A In the Zone. | |
| void | opcontrol_joystick_threshold_set (int threshold) |
| Sets a new threshold for the joystick. | |
| int | opcontrol_joystick_threshold_get () |
| Gets the threshold for the joystick. | |
| void | opcontrol_drive_sensors_reset () |
| Resets drive sensors at the start of opcontrol. | |
| void | opcontrol_joystick_threshold_iterate (int l_stick, int r_stick) |
| Sets minimum value distance constants. | |
| bool | pto_check (pros::Motor check_if_pto) |
| Checks if the motor is currently in pto_list. | |
| void | pto_add (std::vector< pros::Motor > pto_list) |
| Adds motors to the pto list, removing them from the drive. | |
| void | pto_remove (std::vector< pros::Motor > pto_list) |
| Removes motors from the pto list, adding them to the drive. | |
| void | pto_toggle (std::vector< pros::Motor > pto_list, bool toggle) |
| Adds/removes motors from drive. | |
| void | drive_set (int left, int right) |
| Sets the chassis to voltage. | |
| std::vector< int > | drive_get () |
| Gets the chassis to voltage, -127 to 127. | |
| 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. | |
| pros::motor_brake_mode_e_t | drive_brake_get () |
| Returns the brake mode of the drive in pros_brake_mode_e_t_. | |
| void | drive_current_limit_set (int mA) |
| Sets the limit for the current on the drive. | |
| int | drive_current_limit_get () |
| Gets the limit for the current on the drive. | |
| void | pid_drive_toggle (bool toggle) |
| Toggles set drive in autonomous. | |
| bool | pid_drive_toggle_get () |
| Gets the current state of the toggle. | |
| void | pid_print_toggle (bool toggle) |
| Toggles printing in autonomous. | |
| bool | pid_print_toggle_get () |
| Gets the current state of the toggle. | |
| double | drive_sensor_right () |
| The position of the right sensor in inches. | |
| int | drive_sensor_right_raw () |
| The position of the right sensor. | |
| int | drive_velocity_right () |
| The velocity of the right motor. | |
| double | drive_mA_right () |
| The watts of the right motor. | |
| bool | drive_current_right_over () |
| Return true when the motor is over current. | |
| double | drive_sensor_left () |
| The position of the left sensor in inches. | |
| int | drive_sensor_left_raw () |
| The position of the left sensor. | |
| int | drive_velocity_left () |
| The velocity of the left motor. | |
| double | drive_mA_left () |
| The watts of the left motor. | |
| bool | drive_current_left_over () |
| Return true when the motor is over current. | |
| void | drive_sensor_reset () |
| Reset all the chassis motors and tracking wheels, recommended to run at the start of your autonomous routine. | |
| void | drive_imu_reset (double new_heading=0) |
| Resets the current imu value. | |
| double | drive_imu_get () |
| Returns the current imu rotation value in degrees. | |
| double | drive_imu_accel_get () |
| Returns the current imu accel x + accel y value. | |
| void | drive_imu_scaler_set (double scaler) |
| Sets a new imu scaling factor. | |
| double | drive_imu_scaler_get () |
| Returns the current imu scaling factor. | |
| bool | drive_imu_calibrate (bool run_loading_animation=true) |
| Calibrates the IMU, recommended to run in initialize(). | |
| bool | drive_imu_calibrated () |
| Checks if the imu calibrated successfully or if it took longer than expected. | |
| void | drive_imu_display_loading (int iter) |
| Loading display while the IMU calibrates. | |
| void | opcontrol_joystick_practicemode_toggle (bool toggle) |
| Practice mode for driver practice that shuts off the drive if you go max speed. | |
| bool | opcontrol_joystick_practicemode_toggle_get () |
| Gets current state of the toggle. | |
| void | opcontrol_drive_reverse_set (bool toggle) |
| Reversal for drivetrain in opcontrol that flips the left and right side and the direction of the drive. | |
| bool | opcontrol_drive_reverse_get () |
| Gets current state of the toggle. | |
| 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 | 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. | |
| 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. | |
| 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. | |
| void | pid_odom_set (odom imovement) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_set (odom imovement, bool slew_on) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_ptp_set (odom imovement) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_ptp_set (odom imovement, bool slew_on) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_boomerang_set (odom imovement) |
| Takes in an odom movement to go to a single point using boomerang. | |
| 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_odom_boomerang_set (united_odom p_imovement) |
| Takes in an odom movement to go to a single point using boomerang. | |
| 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. | |
| void | pid_odom_ptp_set (united_odom p_imovement) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_ptp_set (united_odom p_imovement, bool slew_on) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_set (united_odom p_imovement) |
| Takes in an odom movement to go to a single point. | |
| void | pid_odom_set (united_odom p_imovement, bool slew_on) |
| Takes in an odom movement to go to a single point. | |
| 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_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 | pid_odom_pp_set (std::vector< odom > imovements) |
| Takes in odom movements to go through multiple points. | |
| void | pid_odom_pp_set (std::vector< odom > imovements, bool slew_on) |
| Takes in odom movements to go through multiple points. | |
| 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_injected_pp_set (std::vector< odom > imovements, bool slew_on) |
| Takes in odom movements to go through multiple points, will inject into the path. | |
| 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 | 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 | 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_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 | 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. | |
| 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_odom_pp_set (std::vector< united_odom > p_imovements) |
| Takes in odom movements to go through multiple points. | |
| void | pid_odom_pp_set (std::vector< united_odom > p_imovements, bool slew_on) |
| Takes in odom movements to go through multiple points. | |
| 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. | |
| 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_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_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 | 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_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_turn_set (pose itarget, drive_directions dir, int speed) |
| Sets the robot to turn face a point using PID and odometry. | |
| 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_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. | |
| 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_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_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. | |
| 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 | 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 | pid_turn_set (double target, int speed) |
| Sets the robot to turn relative to initial heading using PID. | |
| void | pid_turn_set (double target, int speed, e_angle_behavior behavior) |
| Sets the robot to turn relative to initial heading using PID. | |
| 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 | 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. | |
| void | pid_turn_set (okapi::QAngle p_target, int speed) |
| Sets the robot to turn relative to initial heading using PID with okapi units. | |
| 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. | |
| 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 for this motion. | |
| 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 for this motion. | |
| 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 globally enabled. | |
| 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 globally enabled. | |
| 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 for this 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 for this motion. | |
| 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 globally enabled. | |
| 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 globally enabled. | |
| 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 enabled for this motion. | |
| 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 enabled for this motion. | |
| 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 units, only using slew if globally enabled. | |
| 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 units, only using slew if globally enabled. | |
| 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 units, using slew if enabled for this motion. | |
| 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 units, using slew if enabled for this motion. | |
| 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 units, only using slew if globally enabled. | |
| 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 units, only using slew if globally enabled. | |
| 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 units, using slew if enabled for this motion. | |
| 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 units, using slew if enabled for this 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, only using slew if globally enabled. | |
| 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, only using slew if globally enabled. | |
| 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, using slew if enabled for this motion. | |
| 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, using slew if enabled for this motion. | |
| 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, only using slew if globally enabled. | |
| 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, only using slew if globally enabled. | |
| 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, using slew if enabled for this motion. | |
| 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 okapi units, using slew if enabled for this motion. | |
| 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 okapi units, only using slew if globally enabled. | |
| 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 okapi units, only using slew if globally enabled. | |
| 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 okapi units, using slew if enabled for this motion. | |
| 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 okapi units, using slew if enabled for this motion. | |
| 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 okapi units, only using slew if globally enabled. | |
| 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 okapi units, only using slew if globally enabled. | |
| 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 okapi units, using slew if enabled for this motion. | |
| 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 okapi units, using slew if enabled for this motion. | |
| 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 without okapi units, only using slew if globally enabled. | |
| 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 without okapi units, only using slew if globally enabled. | |
| 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 without okapi units, using slew if enabled for this motion. | |
| 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 without okapi units, using slew if enabled for this motion. | |
| 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 without okapi units, only using slew if globally enabled. | |
| 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 without okapi units, only using slew if globally enabled. | |
| 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 without okapi units, using slew if enabled for this motion. | |
| 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 without okapi units, using slew if enabled for this motion. | |
| void | pid_targets_reset () |
| Resets all PID targets to 0. | |
| void | drive_angle_set (okapi::QAngle p_angle) |
| Sets heading of imu and target of PID, okapi angle. | |
| void | drive_angle_set (double angle) |
| Sets heading of imu and target of PID, takes double as an angle. | |
| void | pid_wait () |
| Lock the code in a while loop until the robot has settled. | |
| 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. | |
| 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_wait_until (double target) |
| Lock the code in a while loop until this position has passed for driving without okapi units. | |
| void | pid_wait_quick () |
| Lock the code in a while loop until the robot has settled. | |
| void | pid_wait_quick_chain () |
| Lock the code in a while loop until the robot has settled. | |
| void | pid_wait_until_index (int index) |
| Lock the code in a while loop until this point has been passed. | |
| void | pid_wait_until_index_started (int index) |
| Lock the code in a while loop until this point becomes the target. | |
| void | pid_wait_until_point (pose target) |
| Lock the code in a while loop until this point has been passed. | |
| 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_wait_until (pose target) |
| Lock the code in a while loop until this point has been passed. | |
| void | pid_wait_until (united_pose target) |
| Lock the code in a while loop until this point has been passed, with okapi units. | |
| void | drive_ratio_set (double ratio) |
| Set the ratio of the robot. | |
| void | drive_rpm_set (double rpm) |
| Set the cartridge/wheel rpm of the robot. | |
| double | drive_ratio_get () |
| Returns the ratio of the drive. | |
| double | drive_rpm_get () |
| Returns the current cartridge / wheel rpm. | |
| void | pid_speed_max_set (int speed) |
| Changes max speed during a drive motion. | |
| int | pid_speed_max_get () |
| Returns max speed of drive during autonomous. | |
| 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. | |
| PID::Constants | pid_turn_constants_get () |
| Returns PID constants with PID::Constants. | |
| 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_chain_constant_set (double input) |
| Sets the amount that the PID will overshoot target by to maintain momentum into the next motion. | |
| double | pid_turn_chain_constant_get () |
| Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for turning. | |
| 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. | |
| PID::Constants | pid_swing_constants_get () |
| Returns PID constants with PID::Constants. | |
| 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. | |
| PID::Constants | pid_swing_constants_forward_get () |
| Returns PID constants with PID::Constants. | |
| 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. | |
| PID::Constants | pid_swing_constants_backward_get () |
| Returns PID constants with PID::Constants. | |
| 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_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 | 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. | |
| 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 | 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. | |
| double | pid_swing_chain_forward_constant_get () |
| Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for swinging forward. | |
| 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. | |
| double | pid_swing_chain_backward_constant_get () |
| Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for swinging backward. | |
| 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. | |
| PID::Constants | pid_heading_constants_get () |
| Returns PID constants with PID::Constants. | |
| 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. | |
| PID::Constants | pid_drive_constants_get () |
| Returns PID constants with PID::Constants. | |
| 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. | |
| PID::Constants | pid_drive_constants_forward_get () |
| Returns PID constants with PID::Constants. | |
| 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. | |
| PID::Constants | pid_drive_constants_backward_get () |
| Returns PID constants with PID::Constants. | |
| 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 | 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. | |
| 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_drive_chain_constant_set (double input) |
| Sets the amount that the PID will overshoot target by to maintain momentum into the next motion. | |
| 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. | |
| double | pid_drive_chain_forward_constant_get () |
| Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for driving forward. | |
| 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. | |
| double | pid_drive_chain_backward_constant_get () |
| Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for driving backward. | |
| void | pid_swing_min_set (int min) |
| Sets minimum power for swings when kI and startI are enabled. | |
| void | pid_turn_min_set (int min) |
| The minimum power for turns when kI and startI are enabled. | |
| int | pid_swing_min_get () |
| Returns minimum power for swings when kI and startI are enabled. | |
| int | pid_turn_min_get () |
| Returns minimum power for turns when kI and startI are enabled. | |
| 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_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_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. | |
| 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_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_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. | |
| 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. | |
| 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 | 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. | |
| 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 | 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_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. | |
| double | drive_tick_per_inch () |
| Returns current tick_per_inch. | |
| void | opcontrol_curve_buttons_iterate () |
| Iterates modifying controller curves with the controller. | |
| void | pid_tuner_enable () |
| Enables PID Tuner. | |
| void | pid_tuner_disable () |
| Disables PID Tuner. | |
| void | pid_tuner_toggle () |
| Toggles PID tuner between enabled and disabled. | |
| bool | pid_tuner_enabled () |
| Checks if PID Tuner is enabled. | |
| void | pid_tuner_iterate () |
| Iterates through controller inputs to modify PID constants. | |
| void | pid_tuner_print_brain_set (bool input) |
| Toggle for printing the display of the PID Tuner to the brain. | |
| void | pid_tuner_print_terminal_set (bool input) |
| Toggle for printing the display of the PID Tuner to the terminal. | |
| bool | pid_tuner_print_terminal_enabled () |
| Returns true if printing to terminal is enabled. | |
| bool | pid_tuner_print_brain_enabled () |
| Returns true if printing to brain is enabled. | |
| void | pid_tuner_increment_p_set (double p) |
| Sets the value that PID Tuner increments P. | |
| void | pid_tuner_increment_i_set (double i) |
| Sets the value that PID Tuner increments I. | |
| void | pid_tuner_increment_d_set (double d) |
| Sets the value that PID Tuner increments D. | |
| void | pid_tuner_increment_start_i_set (double start_i) |
| Sets the value that PID Tuner increments Start I. | |
| double | pid_tuner_increment_p_get () |
| Returns the value that PID Tuner increments P. | |
| double | pid_tuner_increment_i_get () |
| Returns the value that PID Tuner increments I. | |
| double | pid_tuner_increment_d_get () |
| Returns the value that PID Tuner increments D. | |
| double | pid_tuner_increment_start_i_get () |
| Returns the value that PID Tuner increments Start I. | |
| void | pid_tuner_full_enable (bool enable) |
| Enables the full PID tuner with unique fwd/rev constants. | |
| bool | pid_tuner_full_enabled () |
| Returns if the full PID tuner with unique fwd/rev constants is enabled. | |
| void | opcontrol_speed_max_set (int speed) |
| Sets the max speed for user control. | |
| int | opcontrol_speed_max_get () |
| Returns the max speed for user control. | |
| void | opcontrol_arcade_scaling (bool enable) |
| Toggles vector scaling for arcade control. | |
| bool | opcontrol_arcade_scaling_enabled () |
| Returns if vector scaling for arcade control is enabled. | |
Public Attributes | |
| int | JOYSTICK_THRESHOLD |
| Joysticks will return 0 when they are within this number. | |
| pros::motor_brake_mode_e_t | CURRENT_BRAKE = pros::E_MOTOR_BRAKE_COAST |
| Global current brake mode. | |
| int | CURRENT_MA = 2500 |
| Global current mA. | |
| e_swing | current_swing |
| Current swing type. | |
| std::vector< pros::Motor > | left_motors |
| Vector of pros motors for the left chassis. | |
| std::vector< pros::Motor > | right_motors |
| Vector of pros motors for the right chassis. | |
| std::vector< int > | pto_active |
| Vector of pros motors that are disconnected from the drive. | |
| pros::Imu | imu |
| Inertial sensor. | |
| pros::adi::Encoder | left_tracker |
| Deprecated left tracking wheel. | |
| pros::adi::Encoder | right_tracker |
| Deprecated right tracking wheel. | |
| pros::Rotation | left_rotation |
| Deprecated left rotation tracker. | |
| pros::Rotation | right_rotation |
| Deprecated right rotation tracker. | |
| tracking_wheel * | odom_tracker_left |
| Left vertical tracking wheel. | |
| tracking_wheel * | odom_tracker_right |
| Right vertical tracking wheel. | |
| tracking_wheel * | odom_tracker_front |
| Front horizontal tracking wheel. | |
| tracking_wheel * | odom_tracker_back |
| Back horizontal tracking wheel. | |
| PID | headingPID |
| PID objects. | |
| PID | turnPID |
| PID | leftPID |
| PID | rightPID |
| PID | forward_drivePID |
| PID | backward_drivePID |
| PID | fwd_rev_drivePID |
| PID | swingPID |
| PID | forward_swingPID |
| PID | backward_swingPID |
| PID | fwd_rev_swingPID |
| PID | xyPID |
| PID | current_a_odomPID |
| PID | boomerangPID |
| PID | odom_angularPID |
| PID | internal_leftPID |
| PID | internal_rightPID |
| PID | left_activebrakePID |
| PID | right_activebrakePID |
| light::slew | slew_left |
| Slew objects. | |
| light::slew | slew_right |
| light::slew | slew_forward |
| light::slew | slew_backward |
| light::slew | slew_turn |
| light::slew | slew_swing_forward |
| light::slew | slew_swing_backward |
| light::slew | slew_swing |
| double | friction_kS = 0.0 |
| Friction-feedforward coefficients in motor-command units (-127..127). | |
| double | friction_kV = 0.0 |
| double | friction_kQ = 0.0 |
| e_mode | mode |
| Current mode of the drive. | |
| pros::Task | ez_auto |
| Tasks for autonomous. | |
| bool | interfered = false |
| Autonomous interference detection. | |
| std::vector< const_and_name > | pid_tuner_pids |
| Vector used for a simplified PID Tuner. | |
| std::vector< const_and_name > | pid_tuner_full_pids |
| Vector used for the full PID Tuner. | |
Tank-drive chassis class.
Owns the left/right motor groups, IMU, optional tracking wheels, and the full PID/slew tuning surface. After construction, autonomous moves are dispatched via the pid_drive_set / pid_turn_set / pid_swing_set / pid_odom_set family with paired pid_wait* calls, and the opcontrol loop is driven by opcontrol_* helpers.
initialize() (or use the LightLib chassis_initialize() wrapper) early in PROS initialize().default_constants()).| light::Drive::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.
| left_motor_ports | input {1, -2...}. make ports negative if reversed |
| right_motor_ports | input {-3, 4...}. make ports negative if reversed |
| imu_port | port the IMU is plugged into |
| wheel_diameter | diameter of your drive wheels |
| ticks | motor cartridge RPM |
| ratio | external gear ratio, wheel gear / motor gear |
| light::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 | ||
| ) | const |
Creates a Drive Controller using encoders plugged into the brain.
| left_motor_ports | input {1, -2...}. make ports negative if reversed |
| right_motor_ports | input {-3, 4...}. make ports negative if reversed |
| imu_port | port the IMU is plugged into |
| wheel_diameter | diameter of your sensored wheel |
| ticks | ticks per revolution of your encoder |
| ratio | external gear ratio, wheel gear / sensor gear |
| left_tracker_ports | input {1, 2}. make ports negative if reversed |
| right_tracker_ports | input {3, 4}. make ports negative if reversed |
| light::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 | ||
| ) | const |
Creates a Drive Controller using encoders plugged into a 3 wire expander.
| left_motor_ports | input {1, -2...}. make ports negative if reversed |
| right_motor_ports | input {-3, 4...}. make ports negative if reversed |
| imu_port | port the IMU is plugged into |
| wheel_diameter | diameter of your sensored wheel |
| ticks | ticks per revolution of your encoder |
| ratio | external gear ratio, wheel gear / sensor gear |
| left_tracker_ports | input {1, 2}. make ports negative if reversed |
| right_tracker_ports | input {3, 4}. make ports negative if reversed |
| expander_smart_port | port the expander is plugged into |
| light::Drive::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 | ||
| ) | const |
Creates a Drive Controller using rotation sensors.
| left_motor_ports | input {1, -2...}. make ports negative if reversed |
| right_motor_ports | input {-3, 4...}. make ports negative if reversed |
| imu_port | port the IMU is plugged into |
| wheel_diameter | diameter of your sensored wheel |
| ratio | external gear ratio, wheel gear / sensor gear |
| left_tracker_port | make ports negative if reversed |
| right_tracker_port | make ports negative if reversed |
| void light::Drive::drive_angle_set | ( | double | angle | ) |
Sets heading of imu and target of PID, takes double as an angle.
| void light::Drive::drive_angle_set | ( | okapi::QAngle | p_angle | ) |
Sets heading of imu and target of PID, okapi angle.
| pros::motor_brake_mode_e_t light::Drive::drive_brake_get | ( | ) |
Returns the brake mode of the drive in pros_brake_mode_e_t_.
| void light::Drive::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.
| brake_type | the 'brake mode' of the motor e.g. 'pros::E_MOTOR_BRAKE_COAST' 'pros::E_MOTOR_BRAKE_BRAKE' 'pros::E_MOTOR_BRAKE_HOLD' |
| bool light::Drive::drive_current_left_over | ( | ) |
Return true when the motor is over current.
| int light::Drive::drive_current_limit_get | ( | ) |
Gets the limit for the current on the drive.
| void light::Drive::drive_current_limit_set | ( | int | mA | ) |
Sets the limit for the current on the drive.
| mA | input in milliamps |
| bool light::Drive::drive_current_right_over | ( | ) |
Return true when the motor is over current.
| void light::Drive::drive_defaults_set | ( | ) |
Sets drive defaults.
| std::vector< int > light::Drive::drive_get | ( | ) |
Gets the chassis to voltage, -127 to 127.
Returns {left, right}.
| double light::Drive::drive_imu_accel_get | ( | ) |
Returns the current imu accel x + accel y value.
| bool light::Drive::drive_imu_calibrate | ( | bool | run_loading_animation = true | ) |
Calibrates the IMU, recommended to run in initialize().
| run_loading_animation | true runs the animation, false doesn't |
| bool light::Drive::drive_imu_calibrated | ( | ) |
Checks if the imu calibrated successfully or if it took longer than expected.
Returns true if calibrated successfully, and false if unsuccessful.
| void light::Drive::drive_imu_display_loading | ( | int | iter | ) |
Loading display while the IMU calibrates.
| double light::Drive::drive_imu_get | ( | ) |
Returns the current imu rotation value in degrees.
| void light::Drive::drive_imu_reset | ( | double | new_heading = 0 | ) |
Resets the current imu value.
Defaults to 0, recommended to run at the start of your autonomous routine.
| new_heading | new heading value |
| double light::Drive::drive_imu_scaler_get | ( | ) |
Returns the current imu scaling factor.
| void light::Drive::drive_imu_scaler_set | ( | double | scaler | ) |
Sets a new imu scaling factor.
This value is multiplied by the imu to change its output.
| scaler | factor to scale the imu by |
| double light::Drive::drive_mA_left | ( | ) |
The watts of the left motor.
| double light::Drive::drive_mA_right | ( | ) |
The watts of the right motor.
| e_mode light::Drive::drive_mode_get | ( | ) |
Returns current mode of drive.
| void light::Drive::drive_mode_set | ( | e_mode | p_mode, |
| bool | stop_drive = true |
||
| ) |
Sets current mode of drive.
| p_mode | the new drive mode |
| stop_drive | if the drive will stop when p_mode is DISABLED |
| double light::Drive::drive_ratio_get | ( | ) |
Returns the ratio of the drive.
| void light::Drive::drive_ratio_set | ( | double | ratio | ) |
Set the ratio of the robot.
| ratio | ratio of the gears |
| double light::Drive::drive_rpm_get | ( | ) |
Returns the current cartridge / wheel rpm.
| void light::Drive::drive_rpm_set | ( | double | rpm | ) |
Set the cartridge/wheel rpm of the robot.
| rpm | rpm of the cartridge or wheel |
| double light::Drive::drive_sensor_left | ( | ) |
The position of the left sensor in inches.
If you have two parallel tracking wheels, this will return tracking wheel position. Otherwise this returns motor position.
| int light::Drive::drive_sensor_left_raw | ( | ) |
The position of the left sensor.
If you have two parallel tracking wheels, this will return tracking wheel position. Otherwise this returns motor position.
| void light::Drive::drive_sensor_reset | ( | ) |
Reset all the chassis motors and tracking wheels, recommended to run at the start of your autonomous routine.
| double light::Drive::drive_sensor_right | ( | ) |
The position of the right sensor in inches.
If you have two parallel tracking wheels, this will return tracking wheel position. Otherwise this returns motor position.
| int light::Drive::drive_sensor_right_raw | ( | ) |
The position of the right sensor.
If you have two parallel tracking wheels, this will return tracking wheel position. Otherwise this returns motor position.
| void light::Drive::drive_set | ( | int | left, |
| int | right | ||
| ) |
Sets the chassis to voltage.
Disables PID when called.
| left | voltage for left side, -127 to 127 |
| right | voltage for right side, -127 to 127 |
| double light::Drive::drive_tick_per_inch | ( | ) |
Returns current tick_per_inch.
| int light::Drive::drive_velocity_left | ( | ) |
The velocity of the left motor.
| int light::Drive::drive_velocity_right | ( | ) |
The velocity of the right motor.
| double light::Drive::drive_width_get | ( | ) |
Returns the width of the drive.
| void light::Drive::drive_width_set | ( | double | input | ) |
Sets the width of the drive.
This is used for tracking.
| input | a unit in inches, from center of the wheel to center of the wheel |
| void light::Drive::drive_width_set | ( | okapi::QLength | p_input | ) |
Sets the width of the drive.
This is used for tracking.
| input | an okapi unit, from center of the wheel to center of the wheel |
| void light::Drive::ez_tracking_task | ( | ) |
Tasks for tracking.
| std::vector< double > light::Drive::friction_constants_get | ( | ) |
Returns {kS, kV, kQ}.
| void light::Drive::friction_constants_set | ( | double | kS, |
| double | kV = 0.0, |
||
| double | kQ = 0.0 |
||
| ) |
Sets the friction-feedforward coefficients.
Pass all zeros to disable.
| kS | static break-away (motor-cmd units, -127..127) |
| kV | viscous coefficient |
| kQ | quadratic-drag coefficient |
| double light::Drive::friction_ff | ( | double | v_target | ) |
Computes the friction-feedforward term for a target motor-cmd-unit velocity.
Returns 0 when all coefficients are 0.
| void light::Drive::initialize | ( | ) |
Calibrates imu and initializes sd card to curve.
| double light::Drive::odom_boomerang_distance_get | ( | ) |
Returns how far away the carrot point can be from target.
| void light::Drive::odom_boomerang_distance_set | ( | double | distance | ) |
Sets how far away the carrot point can be from the target point.
| distance | distance in inches |
| void light::Drive::odom_boomerang_distance_set | ( | okapi::QLength | p_distance | ) |
Sets how far away the carrot point can be from the target point.
| distance | distance as an okapi unit |
| double light::Drive::odom_boomerang_dlead_get | ( | ) |
Returns the current dlead.
| void light::Drive::odom_boomerang_dlead_set | ( | double | input | ) |
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 light::Drive::odom_enable | ( | bool | input | ) |
Enables / disables tracking.
| input | true enables tracking, false disables tracking |
| bool light::Drive::odom_enabled | ( | ) |
Returns whether the bot is tracking with odometry.
True means tracking is enabled, false means tracking is disabled.
| double light::Drive::odom_look_ahead_get | ( | ) |
Returns how far away the robot looks in the path during pure pursuits.
| void light::Drive::odom_look_ahead_set | ( | double | distance | ) |
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 light::Drive::odom_look_ahead_set | ( | okapi::QLength | p_distance | ) |
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 light::Drive::odom_path_print | ( | ) |
Prints the current path the robot is following.
| std::vector< double > light::Drive::odom_path_smooth_constants_get | ( | ) |
Returns the constants for smoothing out a path.
In order of:
| void light::Drive::odom_path_smooth_constants_set | ( | double | weight_smooth, |
| double | weight_data, | ||
| double | tolerance | ||
| ) |
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 |
| double light::Drive::odom_path_spacing_get | ( | ) |
Returns the spacing between points when points get injected into the path.
| void light::Drive::odom_path_spacing_set | ( | double | spacing | ) |
Sets the spacing between points when points get injected into the path.
| spacing | a small number in inches |
| void light::Drive::odom_path_spacing_set | ( | okapi::QLength | p_spacing | ) |
Sets the spacing between points when points get injected into the path.
| spacing | a small number in okapi units |
| pose light::Drive::odom_pose_get | ( | ) |
Returns the current pose of the robot.
| void light::Drive::odom_pose_set | ( | pose | itarget | ) |
Sets the current pose of the robot.
| itarget | {x, y, t} units in inches and degrees |
| void light::Drive::odom_pose_set | ( | united_pose | itarget | ) |
Sets the current pose of the robot.
| itarget | {x, y, t} as an okapi unit |
| void light::Drive::odom_reset | ( | ) |
Resets xyt to 0.
| bool light::Drive::odom_theta_direction_get | ( | ) |
Checks if the rotation axis is flipped.
True means counterclockwise is positive, false means clockwise is positive.
| void light::Drive::odom_theta_flip | ( | bool | flip = true | ) |
Flips the rotation axis.
| flip | true means counterclockwise is positive, false means clockwise is positive |
| double light::Drive::odom_theta_get | ( | ) |
Returns the current Theta of the robot in degrees.
| void light::Drive::odom_theta_set | ( | double | a | ) |
Sets the current angle of the robot.
| a | new angle in degrees |
| void light::Drive::odom_theta_set | ( | okapi::QAngle | p_a | ) |
Sets the current Theta of the robot.
| p_a | new angle as an okapi unit |
| void light::Drive::odom_tracker_back_set | ( | tracking_wheel * | input | ) |
Sets the perpendicular back tracking wheel for odometry.
| input | an light::tracking_wheel |
| void light::Drive::odom_tracker_front_set | ( | tracking_wheel * | input | ) |
Sets the perpendicular front tracking wheel for odometry.
| input | an light::tracking_wheel |
| void light::Drive::odom_tracker_left_set | ( | tracking_wheel * | input | ) |
Sets the parallel left tracking wheel for odometry.
| input | an light::tracking_wheel |
| void light::Drive::odom_tracker_right_set | ( | tracking_wheel * | input | ) |
Sets the parallel right tracking wheel for odometry.
| input | an light::tracking_wheel |
| double light::Drive::odom_turn_bias_get | ( | ) |
Returns the proportion of how prioritized turning is during odometry motions.
| void light::Drive::odom_turn_bias_set | ( | double | bias | ) |
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 |
| bool light::Drive::odom_x_direction_get | ( | ) |
Checks if X axis is flipped.
True means left is positive X, false means right is positive X.
| void light::Drive::odom_x_flip | ( | bool | flip = true | ) |
Flips the X axis.
| flip | true means left is positive x, false means right is positive x |
| double light::Drive::odom_x_get | ( | ) |
Returns the current X coordinate of the robot in inches.
| void light::Drive::odom_x_set | ( | double | x | ) |
Sets the current X coordinate of the robot.
| x | new x coordinate in inches |
| void light::Drive::odom_x_set | ( | okapi::QLength | p_x | ) |
Sets the current X coordinate of the robot.
| p_x | new x coordinate as an okapi unit |
| void light::Drive::odom_xy_set | ( | double | x, |
| double | y | ||
| ) |
Sets the current X and Y coordinate for the robot.
| x | new x value, in inches |
| y | new y value, in inches |
| void light::Drive::odom_xy_set | ( | okapi::QLength | p_x, |
| okapi::QLength | p_y | ||
| ) |
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 light::Drive::odom_xyt_set | ( | double | x, |
| double | y, | ||
| double | t | ||
| ) |
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 light::Drive::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.
| p_x | new x value, okapi unit |
| p_y | new y value, okapi unit |
| p_t | new theta value, okapi unit |
| bool light::Drive::odom_y_direction_get | ( | ) |
Checks if Y axis is flipped.
True means down is positive Y, false means up is positive Y.
| void light::Drive::odom_y_flip | ( | bool | flip = true | ) |
Flips the Y axis.
| flip | true means down is positive y, false means up is positive y |
| double light::Drive::odom_y_get | ( | ) |
Returns the current Y coordinate of the robot in inches.
| void light::Drive::odom_y_set | ( | double | y | ) |
Sets the current Y coordinate of the robot.
| y | new y coordinate in inches |
| void light::Drive::odom_y_set | ( | okapi::QLength | p_y | ) |
Sets the current Y coordinate of the robot.
| p_y | new y coordinate as an okapi unit |
| void light::Drive::opcontrol_arcade_flipped | ( | e_type | stick_type | ) |
Sets the chassis to controller joysticks using flipped arcade control, where right stick is fwd/rev.
Run in usercontrol.
This passes the controller through the curve functions, but is disabled by default. Use opcontrol_curve_buttons_toggle() to enable it.
| stick_type | light::SINGLE or light::SPLIT control |
| void light::Drive::opcontrol_arcade_scaling | ( | bool | enable | ) |
Toggles vector scaling for arcade control.
True enables, false disables.
| bool | true enables, false disables |
| bool light::Drive::opcontrol_arcade_scaling_enabled | ( | ) |
Returns if vector scaling for arcade control is enabled.
True enables, false disables.
| void light::Drive::opcontrol_arcade_standard | ( | e_type | stick_type | ) |
Sets the chassis to controller joysticks using standard arcade control, where left stick is fwd/rev.
Run in usercontrol.
This passes the controller through the curve functions, but is disabled by default. Use opcontrol_curve_buttons_toggle() to enable it.
| stick_type | light::SINGLE or light::SPLIT control |
| void light::Drive::opcontrol_curve_buttons_iterate | ( | ) |
Iterates modifying controller curves with the controller.
| std::vector< pros::controller_digital_e_t > light::Drive::opcontrol_curve_buttons_left_get | ( | ) |
Returns a vector of pros controller buttons user for the left joystick curve, in {decrease, increase}.
| void light::Drive::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.
| decrease | a pros button enumerator |
| increase | a pros button enumerator |
| std::vector< pros::controller_digital_e_t > light::Drive::opcontrol_curve_buttons_right_get | ( | ) |
Returns a vector of pros controller buttons user for the right joystick curve, in {decrease, increase}.
| void light::Drive::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.
| decrease | a pros button enumerator |
| increase | a pros button enumerator |
| void light::Drive::opcontrol_curve_buttons_toggle | ( | bool | toggle | ) |
Enables/disables modifying the joystick input curves with the controller.
| input | true enables, false disables |
| bool light::Drive::opcontrol_curve_buttons_toggle_get | ( | ) |
Gets the current state of the toggle.
Enables/disables modifying the joystick input curves with the controller.
True enabled, false disabled.
| std::vector< double > light::Drive::opcontrol_curve_default_get | ( | ) |
Gets the default joystick curves, in {left, right}.
| void light::Drive::opcontrol_curve_default_set | ( | double | left, |
| double | right = 0 |
||
| ) |
Sets the default joystick curves.
| left | left default curve |
| right | right default curve |
| double light::Drive::opcontrol_curve_left | ( | double | x | ) |
Outputs a curve from 5225A In the Zone.
This gives more control over the robot at lower speeds.
| x | joystick input |
| double light::Drive::opcontrol_curve_right | ( | double | x | ) |
Outputs a curve from 5225A In the Zone.
This gives more control over the robot at lower speeds.
| x | joystick input |
| void light::Drive::opcontrol_curve_sd_initialize | ( | ) |
Initializes left and right curves with the SD card, recommended to run in initialize().
| PID::Constants light::Drive::opcontrol_drive_activebrake_constants_get | ( | ) |
Returns all PID constants for active brake.
| double light::Drive::opcontrol_drive_activebrake_get | ( | ) |
Returns kP for active brake.
| void light::Drive::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.
| kp | proportional term |
| ki | integral term |
| kd | derivative term |
| start_i | error threshold to start integral |
| bool light::Drive::opcontrol_drive_reverse_get | ( | ) |
Gets current state of the toggle.
Reversal for drivetrain in opcontrol that flips the left and right side and the direction of the drive.
| void light::Drive::opcontrol_drive_reverse_set | ( | bool | toggle | ) |
Reversal for drivetrain in opcontrol that flips the left and right side and the direction of the drive.
| toggle | true if you want your drivetrain reversed and false if you do not |
| void light::Drive::opcontrol_drive_sensors_reset | ( | ) |
Resets drive sensors at the start of opcontrol.
| void light::Drive::opcontrol_joystick_practicemode_toggle | ( | bool | toggle | ) |
Practice mode for driver practice that shuts off the drive if you go max speed.
| toggle | true enables, false disables |
| bool light::Drive::opcontrol_joystick_practicemode_toggle_get | ( | ) |
Gets current state of the toggle.
True is enabled, false is disabled.
| int light::Drive::opcontrol_joystick_threshold_get | ( | ) |
Gets the threshold for the joystick.
| void light::Drive::opcontrol_joystick_threshold_iterate | ( | int | l_stick, |
| int | r_stick | ||
| ) |
Sets minimum value distance constants.
| l_stick | input for left joystick |
| r_stick | input for right joystick |
| void light::Drive::opcontrol_joystick_threshold_set | ( | int | threshold | ) |
Sets a new threshold for the joystick.
The joysticks wil not return a value if they are within this.
| threshold | new threshold |
| int light::Drive::opcontrol_speed_max_get | ( | ) |
Returns the max speed for user control.
| void light::Drive::opcontrol_speed_max_set | ( | int | speed | ) |
Sets the max speed for user control.
| int | the speed limit |
| void light::Drive::opcontrol_tank | ( | ) |
Sets the chassis to controller joysticks using tank control.
Run in usercontrol.
This passes the controller through the curve functions, but is disabled by default. Use opcontrol_curve_buttons_toggle() to enable it.
| e_angle_behavior light::Drive::pid_angle_behavior_bias_get | ( | ) |
Returns the behavior when a turn is within its tolerance, you can have it bias left or right.
| void light::Drive::pid_angle_behavior_bias_set | ( | e_angle_behavior | behavior | ) |
When a turn is within its tolerance, you can have it bias left or right.
| behavior | light::left or light::right |
| void light::Drive::pid_angle_behavior_set | ( | e_angle_behavior | behavior | ) |
Sets the default behavior for turns in odom, swinging, and turning.
| behavior | light::shortest, light::longest, light::left, light::right, light::raw |
| double light::Drive::pid_angle_behavior_tolerance_get | ( | ) |
Returns the wiggle room in shortest vs longest, so a 180.1 and 179.9 degree turns have consistent behavior.
| void light::Drive::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 behavior.
| p_tolerance | angle wiggle room, in degrees |
| void light::Drive::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 behavior.
| p_tolerance | angle wiggle room, an okapi unit |
| double light::Drive::pid_drive_chain_backward_constant_get | ( | ) |
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for driving backward.
| void light::Drive::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.
This only sets backward driving constants.
| input | distance in inches |
| void light::Drive::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.
This only sets backward driving constants.
| input | okapi length unit |
| void light::Drive::pid_drive_chain_constant_set | ( | double | input | ) |
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
This sets forward and backwards driving constants.
| input | distance in inches |
| void light::Drive::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.
This sets forward and backwards driving constants.
| input | okapi length unit |
| double light::Drive::pid_drive_chain_forward_constant_get | ( | ) |
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for driving forward.
| void light::Drive::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.
This only sets forward driving constants.
| input | distance in inches |
| void light::Drive::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.
This only sets forward driving constants.
| input | okapi length unit |
| PID::Constants light::Drive::pid_drive_constants_backward_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| PID::Constants light::Drive::pid_drive_constants_forward_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| PID::Constants light::Drive::pid_drive_constants_get | ( | ) |
Returns PID constants with PID::Constants.
Returns -1 if fwd and rev constants aren't the same!
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| void light::Drive::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.
| 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 light::Drive::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.
| 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 | velocity timer will start when velocity is 0, okapi unit |
| p_mA_timeout | mA timer will start when the motors are pulling too much current, okapi unit |
| use_imu | true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't |
| void light::Drive::pid_drive_set | ( | double | target, |
| int | speed | ||
| ) |
Sets the robot to move forward using PID without okapi units, only using slew if globally enabled.
| target | target value in inches |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
| target | target value in inches |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| toggle_heading | toggle for heading correction. true enables, false disables |
| void light::Drive::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.
| p_target | target okapi unit |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
| p_target | target okapi unit |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| toggle_heading | toggle for heading correction. true enables, false disables |
| void light::Drive::pid_drive_toggle | ( | bool | toggle | ) |
Toggles set drive in autonomous.
| toggle | true enables, false disables |
| bool light::Drive::pid_drive_toggle_get | ( | ) |
Gets the current state of the toggle.
This toggles set drive in autonomous.
True enabled, false disabled.
| PID::Constants light::Drive::pid_heading_constants_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| e_angle_behavior light::Drive::pid_odom_behavior_get | ( | ) |
Returns the turn behavior for odom turns.
| void light::Drive::pid_odom_behavior_set | ( | e_angle_behavior | behavior | ) |
Sets the default behavior for turns in odom turning movements.
| behavior | light::shortest, light::longest, light::left, light::right, light::raw |
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| void light::Drive::pid_odom_boomerang_set | ( | odom | imovement | ) |
Takes in an odom movement to go to a single point using boomerang.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| void light::Drive::pid_odom_boomerang_set | ( | odom | imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point using boomerang.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_boomerang_set | ( | united_odom | p_imovement | ) |
Takes in an odom movement to go to a single point using boomerang.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| void light::Drive::pid_odom_boomerang_set | ( | united_odom | p_imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point using boomerang.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| 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 light::Drive::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.
| 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 | velocity timer will start when velocity is 0, okapi unit |
| p_mA_timeout | mA timer will start when the motors are pulling too much current, okapi unit |
| use_imu | true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't |
| void light::Drive::pid_odom_injected_pp_set | ( | std::vector< odom > | imovements | ) |
Takes in odom movements to go through multiple points, will inject into the path.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_pp_set | ( | std::vector< odom > | imovements | ) |
Takes in odom movements to go through multiple points.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| void light::Drive::pid_odom_pp_set | ( | std::vector< odom > | imovements, |
| bool | slew_on | ||
| ) |
Takes in odom movements to go through multiple points.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_pp_set | ( | std::vector< united_odom > | p_imovements | ) |
Takes in odom movements to go through multiple points.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| void light::Drive::pid_odom_pp_set | ( | std::vector< united_odom > | p_imovements, |
| bool | slew_on | ||
| ) |
Takes in odom movements to go through multiple points.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_ptp_set | ( | odom | imovement | ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| void light::Drive::pid_odom_ptp_set | ( | odom | imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_ptp_set | ( | united_odom | p_imovement | ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| void light::Drive::pid_odom_ptp_set | ( | united_odom | p_imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_set | ( | double | target, |
| int | speed | ||
| ) |
Sets the robot to move forward using PID without okapi units, only using slew if globally enabled.
This function is actually odom.
| target | target value as a double, unit is inches |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
This function is actually odom
| target | target value as a double, unit is inches |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_set | ( | odom | imovement | ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| void light::Drive::pid_odom_set | ( | odom | imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
This function is actually odom
| target | target value in inches |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
This function is actually odom
| target | target value in inches |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| toggle_heading | toggle for heading correction. true enables, false disables |
| void light::Drive::pid_odom_set | ( | std::vector< odom > | imovements | ) |
Takes in odom movements to go through multiple points, will inject and smooth the path.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_set | ( | std::vector< united_odom > | p_imovements | ) |
Takes in odom movements to go through multiple points, will inject and smooth the path.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_set | ( | united_odom | p_imovement | ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if globally enabled.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| void light::Drive::pid_odom_set | ( | united_odom | p_imovement, |
| bool | slew_on | ||
| ) |
Takes in an odom movement to go to a single point.
If an angle is set, this will run boomerang. Uses slew if enabled for this motion.
| imovement | {{x, y, t}, fwd/rev, 1-127} an odom movement. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_odom_smooth_pp_set | ( | std::vector< odom > | imovements | ) |
Takes in odom movements to go through multiple points, will inject and smooth the path.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if globally enabled.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| void light::Drive::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.
If an angle is set, this will run boomerang for that point. Uses slew if enabled for this motion.
| imovements | {{{x, y, t}, fwd/rev, 1-127}, {{x, y, t}, fwd/rev, 1-127}} odom movements. values are united here with okapi units |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| 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 light::Drive::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.
| 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 | velocity timer will start when velocity is 0, okapi unit |
| p_mA_timeout | mA timer will start when the motors are pulling too much current, okapi unit |
| use_imu | true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't |
| void light::Drive::pid_print_toggle | ( | bool | toggle | ) |
Toggles printing in autonomous.
| toggle | true enables, false disables |
| bool light::Drive::pid_print_toggle_get | ( | ) |
Gets the current state of the toggle.
This toggles printing in autonomous.
True enabled, false disabled.
| int light::Drive::pid_speed_max_get | ( | ) |
Returns max speed of drive during autonomous.
| void light::Drive::pid_speed_max_set | ( | int | speed | ) |
Changes max speed during a drive motion.
| speed | new clipped speed, between 0 and 127 |
| e_angle_behavior light::Drive::pid_swing_behavior_get | ( | ) |
Returns the turn behavior for swings.
| void light::Drive::pid_swing_behavior_set | ( | e_angle_behavior | behavior | ) |
Sets the default behavior for turns in swinging movements.
| behavior | light::shortest, light::longest, light::left, light::right, light::raw |
| double light::Drive::pid_swing_chain_backward_constant_get | ( | ) |
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for swinging backward.
| void light::Drive::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.
This only sets backwards swing constants.
| input | angle in degrees |
| void light::Drive::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.
This only sets backward swing constants.
| input | okapi angle unit |
| void light::Drive::pid_swing_chain_constant_set | ( | double | input | ) |
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
This sets forward and backwards swing constants.
| input | angle in degrees |
| void light::Drive::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.
This sets forward and backwards swing constants.
| input | okapi angle unit |
| double light::Drive::pid_swing_chain_forward_constant_get | ( | ) |
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for swinging forward.
| void light::Drive::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.
This only sets forward constants.
| input | angle in degrees |
| void light::Drive::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.
This only sets forward swing constants.
| input | okapi angle unit |
| PID::Constants light::Drive::pid_swing_constants_backward_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| PID::Constants light::Drive::pid_swing_constants_forward_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| PID::Constants light::Drive::pid_swing_constants_get | ( | ) |
Returns PID constants with PID::Constants.
Returns -1 if fwd and rev constants aren't the same!
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| void light::Drive::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.
| 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 light::Drive::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.
| 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 | velocity timer will start when velocity is 0, okapi unit |
| p_mA_timeout | mA timer will start when the motors are pulling too much current, okapi unit |
| use_imu | true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't |
| int light::Drive::pid_swing_min_get | ( | ) |
Returns minimum power for swings when kI and startI are enabled.
| void light::Drive::pid_swing_min_set | ( | int | min | ) |
Sets minimum power for swings when kI and startI are enabled.
| min | new clipped speed |
| void light::Drive::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 without okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 without okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 without okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 without okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 without okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 without okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 without okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 without okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 okapi units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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 units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 units, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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 units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| void light::Drive::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, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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, only using slew if globally enabled.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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 okapi units, using slew if enabled for this motion.
| type | L_SWING or R_SWING |
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| opposite_speed | -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0 |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_targets_reset | ( | ) |
Resets all PID targets to 0.
| void light::Drive::pid_tuner_disable | ( | ) |
Disables PID Tuner.
| void light::Drive::pid_tuner_enable | ( | ) |
Enables PID Tuner.
| bool light::Drive::pid_tuner_enabled | ( | ) |
Checks if PID Tuner is enabled.
True is enabled, false is disabled.
| void light::Drive::pid_tuner_full_enable | ( | bool | enable | ) |
| bool light::Drive::pid_tuner_full_enabled | ( | ) |
| double light::Drive::pid_tuner_increment_d_get | ( | ) |
Returns the value that PID Tuner increments D.
| void light::Drive::pid_tuner_increment_d_set | ( | double | d | ) |
Sets the value that PID Tuner increments D.
| p | d will increase by this |
| double light::Drive::pid_tuner_increment_i_get | ( | ) |
Returns the value that PID Tuner increments I.
| void light::Drive::pid_tuner_increment_i_set | ( | double | i | ) |
Sets the value that PID Tuner increments I.
| p | i will increase by this |
| double light::Drive::pid_tuner_increment_p_get | ( | ) |
Returns the value that PID Tuner increments P.
| void light::Drive::pid_tuner_increment_p_set | ( | double | p | ) |
Sets the value that PID Tuner increments P.
| p | p will increase by this |
| double light::Drive::pid_tuner_increment_start_i_get | ( | ) |
Returns the value that PID Tuner increments Start I.
| void light::Drive::pid_tuner_increment_start_i_set | ( | double | start_i | ) |
Sets the value that PID Tuner increments Start I.
| p | start i will increase by this |
| void light::Drive::pid_tuner_iterate | ( | ) |
Iterates through controller inputs to modify PID constants.
| bool light::Drive::pid_tuner_print_brain_enabled | ( | ) |
Returns true if printing to brain is enabled.
| void light::Drive::pid_tuner_print_brain_set | ( | bool | input | ) |
Toggle for printing the display of the PID Tuner to the brain.
| input | true prints to brain, false doesn't |
| bool light::Drive::pid_tuner_print_terminal_enabled | ( | ) |
Returns true if printing to terminal is enabled.
| void light::Drive::pid_tuner_print_terminal_set | ( | bool | input | ) |
Toggle for printing the display of the PID Tuner to the terminal.
| input | true prints to terminal, false doesn't |
| void light::Drive::pid_tuner_toggle | ( | ) |
Toggles PID tuner between enabled and disabled.
| e_angle_behavior light::Drive::pid_turn_behavior_get | ( | ) |
Returns the turn behavior for turns.
| void light::Drive::pid_turn_behavior_set | ( | e_angle_behavior | behavior | ) |
Sets the default behavior for turns in turning movements.
| behavior | light::shortest, light::longest, light::left, light::right, light::raw |
| double light::Drive::pid_turn_chain_constant_get | ( | ) |
Returns the amount that the PID will overshoot target by to maintain momentum into the next motion for turning.
| void light::Drive::pid_turn_chain_constant_set | ( | double | input | ) |
Sets the amount that the PID will overshoot target by to maintain momentum into the next motion.
This sets turning constants.
| input | angle in degrees |
| void light::Drive::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.
This sets turning constants.
| input | okapi angle unit |
| PID::Constants light::Drive::pid_turn_constants_get | ( | ) |
Returns PID constants with PID::Constants.
| void light::Drive::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.
| p | proportional term |
| i | integral term |
| d | derivative term |
| p_start_i | error threshold to start integral |
| void light::Drive::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.
| 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 light::Drive::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.
| 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 | velocity timer will start when velocity is 0, okapi unit |
| p_mA_timeout | mA timer will start when the motors are pulling too much current, okapi unit |
| use_imu | true adds the imu for velocity calculation in conjunction with the main sensor, false doesn't |
| int light::Drive::pid_turn_min_get | ( | ) |
Returns minimum power for turns when kI and startI are enabled.
| void light::Drive::pid_turn_min_set | ( | int | min | ) |
The minimum power for turns when kI and startI are enabled.
| min | new clipped speed |
| void light::Drive::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 globally enabled.
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 enabled for this motion.
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 globally enabled.
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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 enabled for this motion.
| p_target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 globally enabled.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 for this motion.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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 globally enabled.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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 for this motion.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_turn_set | ( | double | target, |
| int | speed | ||
| ) |
Sets the robot to turn relative to initial heading using PID.
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_turn_set | ( | double | target, |
| int | speed, | ||
| e_angle_behavior | behavior | ||
| ) |
Sets the robot to turn relative to initial heading using PID.
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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.
| target | target value as a double, unit is degrees |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_turn_set | ( | okapi::QAngle | p_target, |
| int | speed | ||
| ) |
Sets the robot to turn relative to initial heading using PID with okapi units.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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 for this motion.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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 for this motion.
| p_target | target value in okapi angle units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_turn_set | ( | pose | itarget, |
| drive_directions | dir, | ||
| int | speed | ||
| ) |
Sets the robot to turn face a point using PID and odometry.
| target | {x, y} a target point to face |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
| target | {x, y} a target point to face |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| target | {x, y} a target point to face |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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.
| target | {x, y} a target point to face |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_turn_set | ( | united_pose | p_itarget, |
| drive_directions | dir, | ||
| int | speed | ||
| ) |
Sets the robot to turn face a point using PID and odometry.
| target | {x, y} a target point to face. this uses okapi units |
| speed | 0 to 127, max speed during motion |
| void light::Drive::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.
| target | {x, y} a target point to face. this uses okapi units |
| speed | 0 to 127, max speed during motion |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::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.
| target | {x, y} a target point to face. this uses okapi units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| void light::Drive::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.
| target | {x, y} a target point to face. this uses okapi units |
| speed | 0 to 127, max speed during motion |
| behavior | changes what direction the robot will turn. can be left, right, shortest, longest, raw |
| slew_on | ramp up from a lower speed to your target speed |
| void light::Drive::pid_wait | ( | ) |
Lock the code in a while loop until the robot has settled.
| void light::Drive::pid_wait_quick | ( | ) |
Lock the code in a while loop until the robot has settled.
Wrapper for pid_wait_until(target), target is your previously input target.
| void light::Drive::pid_wait_quick_chain | ( | ) |
Lock the code in a while loop until the robot has settled.
This also adds distance to target, and then exits with pid_wait_quick.
This will exit the motion while carrying momentum into the next motion.
| void light::Drive::pid_wait_until | ( | double | target | ) |
Lock the code in a while loop until this position has passed for driving without okapi units.
| target | for driving or turning, using a double. degrees for turns/swings, inches for driving |
| void light::Drive::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.
| target | for turning, using okapi units |
| void light::Drive::pid_wait_until | ( | okapi::QLength | target | ) |
Lock the code in a while loop until this position has passed for driving with okapi units.
| target | for driving, using okapi units |
| void light::Drive::pid_wait_until | ( | pose | target | ) |
Lock the code in a while loop until this point has been passed.
Wrapper for pid_wait_until_point.
| target | {x, y} a pose for the robot to pass through before the while loop is released |
| void light::Drive::pid_wait_until | ( | united_pose | target | ) |
Lock the code in a while loop until this point has been passed, with okapi units.
Wrapper for pid_wait_until_point.
| target | {x, y} a pose with units for the robot to pass through before the while loop is released |
| void light::Drive::pid_wait_until_index | ( | int | index | ) |
Lock the code in a while loop until this point has been passed.
| index | index of your input points, 0 is the first point in the index |
| void light::Drive::pid_wait_until_index_started | ( | int | index | ) |
Lock the code in a while loop until this point becomes the target.
| index | index of your input points, 0 is the first point in the index |
| void light::Drive::pid_wait_until_point | ( | pose | target | ) |
Lock the code in a while loop until this point has been passed.
| target | {x, y} pose for the robot to pass through before the while loop is released |
| void light::Drive::pid_wait_until_point | ( | united_pose | target | ) |
Lock the code in a while loop until this point has been passed, with okapi units.
| target | {x, y} pose with units for the robot to pass through before the while loop is released |
| void light::Drive::pto_add | ( | std::vector< pros::Motor > | pto_list | ) |
Adds motors to the pto list, removing them from the drive.
You cannot add the first index because it's used for autonomous.
| pto_list | list of motors to remove from the drive |
| bool light::Drive::pto_check | ( | pros::Motor | check_if_pto | ) |
Checks if the motor is currently in pto_list.
Returns true if it's already in pto_list.
| check_if_pto | motor to check |
| void light::Drive::pto_remove | ( | std::vector< pros::Motor > | pto_list | ) |
Removes motors from the pto list, adding them to the drive.
| pto_list | list of motors to add to the drive |
| void light::Drive::pto_toggle | ( | std::vector< pros::Motor > | pto_list, |
| bool | toggle | ||
| ) |
Adds/removes motors from drive.
You cannot add the first index because it's used for autonomous.
| pto_list | list of motors to add/remove from the drive |
| toggle | list of motors to add/remove from the drive |
| bool light::Drive::slew_drive_backward_get | ( | ) |
Returns true if slew is enabled for all drive backward movements, false otherwise.
| void light::Drive::slew_drive_backward_set | ( | bool | slew_on | ) |
Sets the default slew for drive backward motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_drive_constants_backward_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for driving backward.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_drive_constants_forward_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for driving forward.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_drive_constants_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for driving.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| bool light::Drive::slew_drive_forward_get | ( | ) |
Returns true if slew is enabled for all drive forward movements, false otherwise.
| void light::Drive::slew_drive_forward_set | ( | bool | slew_on | ) |
Sets the default slew for drive forward motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_drive_set | ( | bool | slew_on | ) |
Sets the default slew for drive forwards and backwards motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_odom_reenable | ( | bool | 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 |
| bool light::Drive::slew_odom_reenabled | ( | ) |
Returns if slew will reenable when the new input speed is larger than the current speed during pure pursuits.
| bool light::Drive::slew_swing_backward_get | ( | ) |
Returns true if slew is enabled for all swing backward motions, false otherwise.
| void light::Drive::slew_swing_backward_set | ( | bool | slew_on | ) |
Sets the default slew for swing backward motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_swing_constants_backward_set | ( | okapi::QAngle | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for swing backward movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi angle unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_swing_constants_backward_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for backward swing movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_swing_constants_forward_set | ( | okapi::QAngle | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for swing forward movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi angle unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_swing_constants_forward_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for forward swing movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_swing_constants_set | ( | okapi::QAngle | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for swing movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi angle unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| void light::Drive::slew_swing_constants_set | ( | okapi::QLength | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for swing movements.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi distance unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| bool light::Drive::slew_swing_forward_get | ( | ) |
Returns true if slew is enabled for all swing forward motions, false otherwise.
| void light::Drive::slew_swing_forward_set | ( | bool | slew_on | ) |
Sets the default slew for swing forward motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_swing_set | ( | bool | slew_on | ) |
Sets the default slew for swing forward and backward motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| void light::Drive::slew_turn_constants_set | ( | okapi::QAngle | distance, |
| int | min_speed | ||
| ) |
Sets constants for slew for turns.
Slew ramps up the speed of the robot until the set distance is traveled.
| distance | the distance the robot travels before reaching max speed, an okapi angle unit |
| min_speed | the starting speed for the movement, 0 - 127 |
| bool light::Drive::slew_turn_get | ( | ) |
Returns true if slew is enabled for all turn motions, false otherwise.
| void light::Drive::slew_turn_set | ( | bool | slew_on | ) |
Sets the default slew for turn motions, can be overwritten in movement functions.
| slew_on | true enables, false disables |
| pros::motor_brake_mode_e_t light::Drive::CURRENT_BRAKE = pros::E_MOTOR_BRAKE_COAST |
| double light::Drive::friction_kS = 0.0 |
Friction-feedforward coefficients in motor-command units (-127..127).
Default zero — when unset, friction_ff() returns 0 and behavior is unchanged from a pure PID. Identify with the "Char: Friction" auton.
ff(v) = kS * sgn(v) + kV * v + kQ * v * |v|
| bool light::Drive::interfered = false |
| int light::Drive::JOYSTICK_THRESHOLD |
Joysticks will return 0 when they are within this number.
Set with opcontrol_joystick_threshold_set()
| std::vector<pros::Motor> light::Drive::left_motors |
| pros::Rotation light::Drive::left_rotation |
| pros::adi::Encoder light::Drive::left_tracker |
| tracking_wheel* light::Drive::odom_tracker_back |
| tracking_wheel* light::Drive::odom_tracker_front |
| tracking_wheel* light::Drive::odom_tracker_left |
| tracking_wheel* light::Drive::odom_tracker_right |
| std::vector<const_and_name> light::Drive::pid_tuner_full_pids |
Vector used for the full PID Tuner.
| std::vector<const_and_name> light::Drive::pid_tuner_pids |
Vector used for a simplified PID Tuner.
| std::vector<int> light::Drive::pto_active |
| std::vector<pros::Motor> light::Drive::right_motors |
| pros::Rotation light::Drive::right_rotation |
| pros::adi::Encoder light::Drive::right_tracker |
| light::slew light::Drive::slew_backward |
| light::slew light::Drive::slew_forward |
| light::slew light::Drive::slew_left |
| light::slew light::Drive::slew_right |
| light::slew light::Drive::slew_swing |
| light::slew light::Drive::slew_swing_backward |
| light::slew light::Drive::slew_swing_forward |
| light::slew light::Drive::slew_turn |