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/ai_vision.h"
#include "pros/ai_vision.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, 10, 9}, pros::MotorGears::blue)
pros::MotorGroup leftMotors ({1,-3,-2,}, pros::MotorGears::blue)
pros::Imu imu (5)
pros::Rotation horizontal_tracking_sensor (13)
pros::Rotation vertical_tracking_sensor (-12)
lemlib::ControllerSettings lateral_controller (16.5, 0, 120, 4, 0.5, 75, 3, 200, 25)
lemlib::ControllerSettings angular_controller (3.2, 0.0, 25, 3, 0.5, 50, 3, 75, 0)
lemlib::ExpoDriveCurve throttle_curve (20, 10, 1.01)
lemlib::ExpoDriveCurve steer_curve (20, 10, 1.015)
lemlib::Chassis chassis (drivebase, lateral_controller, angular_controller, sensors, &throttle_curve, &steer_curve)
pros::Motor intakeMotor (18, pros::v5::MotorGears::blue)
pros::Motor topMotor (19, pros::v5::MotorGears::blue)
pros::Distance rightDistance (20)
pros::Distance leftDistance (15)
pros::Distance frontDistance (14)
pros::Distance backDistance (16)
pros::Distance frontDistance2 (17)
pros::adi::Pneumatics trapDoor ('A', false)
pros::adi::Pneumatics matchload ('E', false)
pros::adi::Pneumatics basket ('F', false)
pros::adi::Pneumatics descore ('D', false)
pros::adi::Pneumatics intakeFunnel ('B', true)
pros::adi::Pneumatics scoringBand ('C', false)
pros::adi::Pneumatics blockBlocker ('G', false)
pros::Optical color_sensor (7)
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
int ramp_up_time = 0
int low_ramp_down_time = 0

Function Documentation

◆ angular_controller()

lemlib::ControllerSettings angular_controller ( 3. 2,
0. 0,
25 ,
3 ,
0. 5,
50 ,
3 ,
75 ,
0  )

◆ backDistance()

pros::Distance backDistance ( 16 )

◆ basket()

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

Referenced by opcontrol().

◆ blockBlocker()

pros::adi::Pneumatics blockBlocker ( 'G' ,
false  )

◆ chassis()

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

◆ color_sensor()

pros::Optical color_sensor ( 7 )

Referenced by get_color(), and initialize().

◆ controller()

pros::Controller controller ( pros::E_CONTROLLER_MASTER )

◆ descore()

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

◆ frontDistance()

◆ frontDistance2()

pros::Distance frontDistance2 ( 17 )

Referenced by calculateAngle().

◆ horizontal_tracking_sensor()

pros::Rotation horizontal_tracking_sensor ( 13 )

◆ imu()

pros::Imu imu ( 5 )

◆ intakeFunnel()

pros::adi::Pneumatics intakeFunnel ( 'B' ,
true  )

◆ intakeMotor()

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

◆ lateral_controller()

lemlib::ControllerSettings lateral_controller ( 16. 5,
0 ,
120 ,
4 ,
0. 5,
75 ,
3 ,
200 ,
25  )

◆ leftDistance()

pros::Distance leftDistance ( 15 )

◆ leftMotors()

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

◆ matchload()

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

◆ rightDistance()

pros::Distance rightDistance ( 20 )

◆ rightMotors()

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

◆ scoringBand()

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

Referenced by opcontrol(), and score_longgoal_auton().

◆ steer_curve()

lemlib::ExpoDriveCurve steer_curve ( 20 ,
10 ,
1. 015 )

◆ throttle_curve()

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

◆ topMotor()

◆ trapDoor()

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

◆ vertical_tracking_sensor()

pros::Rotation vertical_tracking_sensor ( - 12)

◆ vision_sensor()

pros::Vision vision_sensor ( 16 )

Referenced by alignToGoal(), and calibrate_vision().

Variable Documentation

◆ allianceColor

◆ color_sort_enable

bool color_sort_enable = false

◆ horizontal_tracking_sensor

lemlib::TrackingWheel horizontal_tracking_wheel& horizontal_tracking_sensor

Definition at line 35 of file globals.cpp.

◆ leftMotors

lemlib::Drivetrain drivebase & leftMotors

◆ low_ramp_down_time

int low_ramp_down_time = 0

Definition at line 100 of file globals.cpp.

Referenced by opcontrol(), and outtake().

◆ midgoal_first

bool midgoal_first = false

Definition at line 98 of file globals.cpp.

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

◆ ramp_up_time

int ramp_up_time = 0

Definition at line 99 of file globals.cpp.

Referenced by opcontrol(), and score_midgoal().

◆ vertical_tracking_sensor

lemlib::TrackingWheel vertical_tracking_wheel& vertical_tracking_sensor

Definition at line 36 of file globals.cpp.

◆ vertical_tracking_wheel

lemlib::OdomSensors sensors& vertical_tracking_wheel

Definition at line 38 of file globals.cpp.