1516X Push Back 1.0
1516X's robot code for the 2025-2026 VEX Robotics Competition
Loading...
Searching...
No Matches
globals.cpp File Reference
#include <sstream>
#include <string>
#include "lemlib/chassis/trackingWheel.hpp"
#include "pros/colors.hpp"
#include "pros/distance.hpp"
#include "pros/misc.h"
#include "lemlib/chassis/chassis.hpp"
#include "pros/adi.h"
#include "pros/adi.hpp"
#include "pros/motors.h"
#include "pros/optical.hpp"
#include "pros/vision.hpp"
#include "colorSort.h"

Go to the source code of this file.

Functions

pros::Controller controller (pros::E_CONTROLLER_MASTER)
 
pros::MotorGroup rightMotors ({8,-9, 10}, pros::MotorGears::blue)
 
pros::MotorGroup leftMotors ({-1, 2,-3}, pros::MotorGears::blue)
 
pros::Imu imu (19)
 
pros::Rotation horizontal_tracking_sensor (20)
 
pros::Rotation vertical_tracking_sensor (-16)
 
lemlib::ControllerSettings lateral_controller (11, 0, 40, 3, 0.5, 50, 3, 200, 35)
 
lemlib::ControllerSettings angular_controller (3, 0.0015, 24, 3, 1, 25, 3, 100, 0)
 
lemlib::ExpoDriveCurve throttle_curve (5, 10, 1.01)
 
lemlib::ExpoDriveCurve steer_curve (5, 10, 1.02)
 
lemlib::Chassis chassis (drivebase, lateral_controller, angular_controller, sensors, &throttle_curve, &steer_curve)
 
pros::Motor intakeMotor (18, pros::v5::MotorGears::blue)
 
pros::Motor topMotor (7, pros::v5::MotorGears::blue)
 
pros::Distance rightDistance (6)
 
pros::Distance leftDistance (12)
 
pros::Distance frontDistance (13)
 
pros::Distance backDistance (11)
 
pros::adi::Pneumatics trapDoor ('A', false)
 
pros::adi::Pneumatics matchload ('B', false)
 
pros::adi::Pneumatics basket ('C', false)
 
pros::adi::Pneumatics descore ('D', false)
 
pros::Optical color_sensor (5)
 
pros::Vision vision_sensor (16)
 

Variables

lemlib::Drivetrain drivebase & leftMotors
 
lemlib::TrackingWheel horizontal_tracking_wheelhorizontal_tracking_sensor
 
lemlib::TrackingWheel vertical_tracking_wheelvertical_tracking_sensor
 
lemlib::OdomSensors sensorsvertical_tracking_wheel
 
Color allianceColor = Color::RED
 
bool color_sort_enable = false
 
bool midgoal_first = false
 

Function Documentation

◆ angular_controller()

lemlib::ControllerSettings angular_controller ( 3 ,
0. 0015,
24 ,
3 ,
1 ,
25 ,
3 ,
100 ,
0  )

◆ backDistance()

pros::Distance backDistance ( 11 )

◆ basket()

pros::adi::Pneumatics basket ( 'C' ,
false  )

◆ chassis()

lemlib::Chassis chassis ( drivebase ,
lateral_controller ,
angular_controller ,
sensors ,
& throttle_curve,
& steer_curve )

◆ color_sensor()

pros::Optical color_sensor ( 5 )

Referenced by get_color(), and initialize().

◆ controller()

pros::Controller controller ( pros::E_CONTROLLER_MASTER )

◆ descore()

pros::adi::Pneumatics descore ( 'D' ,
false  )

◆ frontDistance()

◆ horizontal_tracking_sensor()

pros::Rotation horizontal_tracking_sensor ( 20 )

◆ imu()

pros::Imu imu ( 19 )

◆ intakeMotor()

pros::Motor intakeMotor ( 18 ,
pros::v5::MotorGears::blue  )

◆ lateral_controller()

lemlib::ControllerSettings lateral_controller ( 11 ,
0 ,
40 ,
3 ,
0. 5,
50 ,
3 ,
200 ,
35  )

◆ leftDistance()

pros::Distance leftDistance ( 12 )

◆ leftMotors()

pros::MotorGroup leftMotors ( {-1, 2,-3} ,
pros::MotorGears::blue  )

◆ matchload()

pros::adi::Pneumatics matchload ( 'B' ,
false  )

◆ rightDistance()

pros::Distance rightDistance ( 6 )

◆ rightMotors()

pros::MotorGroup rightMotors ( {8,-9, 10} ,
pros::MotorGears::blue  )

◆ steer_curve()

lemlib::ExpoDriveCurve steer_curve ( 5 ,
10 ,
1. 02 )

◆ throttle_curve()

lemlib::ExpoDriveCurve throttle_curve ( 5 ,
10 ,
1. 01 )

◆ topMotor()

pros::Motor topMotor ( 7 ,
pros::v5::MotorGears::blue  )

◆ trapDoor()

pros::adi::Pneumatics trapDoor ( 'A' ,
false  )

◆ vertical_tracking_sensor()

pros::Rotation vertical_tracking_sensor ( - 16)

◆ vision_sensor()

pros::Vision vision_sensor ( 16 )

Referenced by alignToGoal(), and calibrate_vision().

Variable Documentation

◆ allianceColor

Color allianceColor = Color::RED

◆ color_sort_enable

bool color_sort_enable = false

Definition at line 94 of file globals.cpp.

Referenced by opcontrol(), score_longgoal(), score_midgoal(), and skills_auton().

◆ horizontal_tracking_sensor

lemlib::TrackingWheel horizontal_tracking_wheel& horizontal_tracking_sensor

Definition at line 33 of file globals.cpp.

◆ leftMotors

lemlib::Drivetrain drivebase & leftMotors

◆ midgoal_first

bool midgoal_first = false

Definition at line 95 of file globals.cpp.

Referenced by opcontrol(), and score_midgoal().

◆ vertical_tracking_sensor

lemlib::TrackingWheel vertical_tracking_wheel& vertical_tracking_sensor

Definition at line 34 of file globals.cpp.

◆ vertical_tracking_wheel

lemlib::OdomSensors sensors& vertical_tracking_wheel

Definition at line 36 of file globals.cpp.