1516b Over Under 2.0
Codebase for 1516b over under season
Loading...
Searching...
No Matches
Robot::Globals Namespace Reference

Contains global variables and type definitions for the Robot namespace. More...

Functions

pros::Controller controller (pros::E_CONTROLLER_MASTER)
 
pros::Motor RightFront (6, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor LeftFront (-5, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor LeftBack (-7, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor RightBack (8, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor LeftMid (-2, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor PuncherMotor (-19, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor PuncherMotor2 (20, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor RightMid (3, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Motor IntakeMotor (-9, pros::E_MOTOR_GEARSET_18, false, pros::E_MOTOR_ENCODER_DEGREES)
 
pros::Imu inertial_sensor (15)
 
pros::Distance distance (18)
 
pros::ADIDigitalOut wing ('A')
 
pros::ADIDigitalOut wing2 ('D')
 
pros::ADIDigitalOut pto_1 ('B')
 
pros::ADIDigitalOut pto_2 ('C')
 
pros::Motor_Group punchers ({PuncherMotor, PuncherMotor2})
 
pros::Motor_Group drive_left ({LeftFront, LeftMid, LeftBack})
 
pros::Motor_Group drive_right ({RightFront, RightMid, RightBack})
 
pros::Motor_Group drive_ ({LeftFront, RightFront, LeftMid, RightMid, LeftBack, RightBack})
 
lemlib::Chassis chassis (drivetrain, lateralController, angularController, sensors)
 

Variables

lemlib::Drivetrain_t drivetrain
 
lemlib::OdomSensors_t sensors
 
lemlib::ChassisController_t lateralController
 
lemlib::ChassisController_t angularController
 
pros::Controller controller
 
Robot::Wings robotWings
 
pros::Motor RightFront
 
pros::Motor LeftFront
 
pros::Motor LeftBack
 
pros::Motor RightBack
 
pros::Motor LeftMid
 
pros::Motor PuncherMotor
 
pros::Motor PuncherMotor2
 
pros::Motor RightMid
 
pros::Motor IntakeMotor
 
pros::Imu inertial_sensor
 
pros::Distance distance
 
pros::ADIDigitalOut wing
 
pros::ADIDigitalOut wing2
 
pros::ADIDigitalOut pto_1
 
pros::ADIDigitalOut pto_2
 
pros::Motor_Group punchers
 
pros::Motor_Group drive_left
 
pros::Motor_Group drive_right
 
pros::Motor_Group drive_
 
lemlib::Chassis chassis
 

Detailed Description

Contains global variables and type definitions for the Robot namespace.

The majority of the global variables are defined in the Globals namespace. This is to allow for easy access to the variables from any file in the project. The Globals namespace is also used to hold lemlib objects that are used to control the autonomous functions of the robot. It contains parameters that are used to control the PID that lemlib uses, additionally.

Function Documentation

◆ chassis()

lemlib::Chassis Robot::Globals::chassis ( drivetrain ,
lateralController ,
angularController ,
sensors  )

◆ controller()

pros::Controller Robot::Globals::controller ( pros::E_CONTROLLER_MASTER )

◆ distance()

pros::Distance Robot::Globals::distance ( 18 )

◆ drive_()

pros::Motor_Group Robot::Globals::drive_ ( {LeftFront, RightFront, LeftMid, RightMid, LeftBack, RightBack} )

◆ drive_left()

pros::Motor_Group Robot::Globals::drive_left ( {LeftFront, LeftMid, LeftBack} )

References LeftBack, LeftFront, and LeftMid.

◆ drive_right()

pros::Motor_Group Robot::Globals::drive_right ( {RightFront, RightMid, RightBack} )

References RightBack, RightFront, and RightMid.

◆ inertial_sensor()

pros::Imu Robot::Globals::inertial_sensor ( 15 )

◆ IntakeMotor()

pros::Motor Robot::Globals::IntakeMotor ( - 9,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ LeftBack()

pros::Motor Robot::Globals::LeftBack ( - 7,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ LeftFront()

pros::Motor Robot::Globals::LeftFront ( - 5,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ LeftMid()

pros::Motor Robot::Globals::LeftMid ( - 2,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ pto_1()

pros::ADIDigitalOut Robot::Globals::pto_1 ( 'B' )

◆ pto_2()

pros::ADIDigitalOut Robot::Globals::pto_2 ( 'C' )

◆ PuncherMotor()

pros::Motor Robot::Globals::PuncherMotor ( - 19,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ PuncherMotor2()

pros::Motor Robot::Globals::PuncherMotor2 ( 20 ,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ punchers()

pros::Motor_Group Robot::Globals::punchers ( {PuncherMotor, PuncherMotor2} )

References PuncherMotor, and PuncherMotor2.

◆ RightBack()

pros::Motor Robot::Globals::RightBack ( 8 ,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ RightFront()

pros::Motor Robot::Globals::RightFront ( 6 ,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ RightMid()

pros::Motor Robot::Globals::RightMid ( 3 ,
pros::E_MOTOR_GEARSET_18 ,
false ,
pros::E_MOTOR_ENCODER_DEGREES  )

◆ wing()

pros::ADIDigitalOut Robot::Globals::wing ( 'A' )

◆ wing2()

pros::ADIDigitalOut Robot::Globals::wing2 ( 'D' )

Variable Documentation

◆ angularController

lemlib::ChassisController_t Robot::Globals::angularController
Initial value:
{
4,
40,
1,
100,
3,
500,
0
}

Definition at line 73 of file globals.cpp.

73 {
74 4, // kP
75 40, // kD
76 1, // smallErrorRange
77 100, // smallErrorTimeout
78 3, // largeErrorRange
79 500, // largeErrorTimeout
80 0 // slew rate
81};

◆ chassis

lemlib::Chassis Robot::Globals::chassis
extern

◆ controller

◆ distance

pros::Distance Robot::Globals::distance
extern

Referenced by Robot::Puncher::toShoot().

◆ drive_

pros::Motor_Group Robot::Globals::drive_
extern

◆ drive_left

pros::Motor_Group Robot::Globals::drive_left
extern

◆ drive_right

pros::Motor_Group Robot::Globals::drive_right
extern

◆ drivetrain

lemlib::Drivetrain_t Robot::Globals::drivetrain
Initial value:
{
11.75,
3.25,
360
}
pros::Motor_Group drive_right
pros::Motor_Group drive_left

Definition at line 44 of file globals.cpp.

44 {
45 &drive_left, // left drivetrain motors
46 &drive_right, // right drivetrain motors
47 11.75, // track width
48 3.25, // wheel diameter - 3.25 on competition bot, 4 on test drivetrain
49 360 // wheel rpm - 360 rpm for competition bot, 200 for test drivetrain
50};

◆ inertial_sensor

pros::Imu Robot::Globals::inertial_sensor
extern

◆ IntakeMotor

pros::Motor Robot::Globals::IntakeMotor
extern

Referenced by Robot::Intake::run().

◆ lateralController

lemlib::ChassisController_t Robot::Globals::lateralController
Initial value:
{
8,
30,
1,
100,
3,
500,
5
}

Definition at line 62 of file globals.cpp.

62 {
63 8, // kP
64 30, // kD
65 1, // smallErrorRange
66 100, // smallErrorTimeout
67 3, // largeErrorRange
68 500, // largeErrorTimeout
69 5 // slew rate
70};

◆ LeftBack

pros::Motor Robot::Globals::LeftBack
extern

◆ LeftFront

pros::Motor Robot::Globals::LeftFront
extern

◆ LeftMid

pros::Motor Robot::Globals::LeftMid
extern

◆ pto_1

pros::ADIDigitalOut Robot::Globals::pto_1
extern

◆ pto_2

pros::ADIDigitalOut Robot::Globals::pto_2
extern

◆ PuncherMotor

pros::Motor Robot::Globals::PuncherMotor
extern

Referenced by punchers().

◆ PuncherMotor2

pros::Motor Robot::Globals::PuncherMotor2
extern

Referenced by punchers().

◆ punchers

pros::Motor_Group Robot::Globals::punchers
extern

Referenced by Robot::Puncher::run().

◆ RightBack

pros::Motor Robot::Globals::RightBack
extern

◆ RightFront

pros::Motor Robot::Globals::RightFront
extern

◆ RightMid

pros::Motor Robot::Globals::RightMid
extern

◆ robotWings

Robot::Wings Robot::Globals::robotWings
extern

◆ sensors

lemlib::OdomSensors_t Robot::Globals::sensors
Initial value:
{
nullptr,
nullptr,
nullptr,
nullptr,
}
pros::Imu inertial_sensor

Definition at line 52 of file globals.cpp.

52 {
53 nullptr, // vertical tracking wheel 1
54 nullptr, // vertical tracking wheel 2
55 nullptr, // horizontal tracking wheel 1
56 nullptr, // we don't have a second tracking wheel, so we set it to nullptr
57 &inertial_sensor // inertial sensor
58};

◆ wing

pros::ADIDigitalOut Robot::Globals::wing
extern

Referenced by Robot::Wings::run().

◆ wing2

pros::ADIDigitalOut Robot::Globals::wing2
extern

Referenced by Robot::Wings::run().