1516b Over Under 2.0
Codebase for 1516b over under season
Loading...
Searching...
No Matches
globals.h
Go to the documentation of this file.
1#pragma once
2#include "api.h"
3#include "lemlib/api.hpp"
4
5// The following files are imported in order to provide type definitions into the compiler that allows for the objecys to
6#include "robot/wings.h"
7
8
9
10/**
11 * @file globals.h
12 * @brief Contains global variables and type definitions for the Robot namespace.
13 */
14
15/**
16 * @namespace Robot
17 * @details In order to construct the robot, the Robot namespace is used to contain all of the objects that are used to control the robot. This includes the subsystems, methods, and global objects.
18 * We use PROS extensively for the robot, it can be found at <A HREF="https://pros.cs.purdue.edu">PROS</A>
19 * @authors Absozero, Jaytb
20 * @brief Contains all objects generated by the 1516B team - Contains all of the subsystems, methods, and global objects.
21 */
22namespace Robot {
23
24 /**
25 * @brief Contains global variables and type definitions for the Robot namespace.
26 * @details 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.
27 * 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
28 * the PID that lemlib uses, additionally.
29 */
30 namespace Globals {
31 extern pros::Controller controller;
32
33 extern Robot::Wings robotWings;
34
35 extern pros::Motor RightFront;
36 extern pros::Motor LeftFront;
37 extern pros::Motor LeftBack;
38 extern pros::Motor RightBack;
39 extern pros::Motor LeftMid;
40 extern pros::Motor PuncherMotor;
41 extern pros::Motor PuncherMotor2;
42 extern pros::Motor RightMid;
43 extern pros::Motor IntakeMotor;
44
45 extern pros::Imu inertial_sensor;
46 extern pros::Distance distance;
47
48
49 extern pros::ADIDigitalOut wing;
50 extern pros::ADIDigitalOut wing2;
51 extern pros::ADIDigitalOut pto_1;
52 extern pros::ADIDigitalOut pto_2;
53
54 extern pros::Motor_Group punchers;
55 extern pros::Motor_Group drive_left;
56 extern pros::Motor_Group drive_right;
57 // Used as a motor group meant to be passed into lemlib, a full drivetrain group.
58 extern pros::Motor_Group drive_;
59
60 extern lemlib::Drivetrain_t drivetrain;
61
62 extern lemlib::OdomSensors_t sensors;
63
64
65 // forward/backward PID
66 extern lemlib::ChassisController_t lateralController;
67
68 // turning PID
69 extern lemlib::ChassisController_t angularController;
70
71 extern lemlib::Chassis chassis;
72 }
73} // namespace Robot
The Wings class represents the wings of a robot.
Definition wings.h:11
Contains global variables and type definitions for the Robot namespace.
Definition globals.cpp:18
pros::Controller controller
lemlib::ChassisController_t angularController
Definition globals.cpp:73
pros::Motor LeftMid
pros::Motor IntakeMotor
pros::Distance distance
pros::Motor_Group drive_
pros::Imu inertial_sensor
pros::Motor RightBack
pros::ADIDigitalOut wing2
pros::Motor_Group drive_right
pros::Motor_Group drive_left
pros::Motor RightFront
pros::ADIDigitalOut wing
pros::ADIDigitalOut pto_2
pros::ADIDigitalOut pto_1
pros::Motor RightMid
lemlib::OdomSensors_t sensors
Definition globals.cpp:52
pros::Motor LeftFront
pros::Motor PuncherMotor2
lemlib::ChassisController_t lateralController
Definition globals.cpp:62
Robot::Wings robotWings
lemlib::Chassis chassis
pros::Motor PuncherMotor
lemlib::Drivetrain_t drivetrain
Definition globals.cpp:44
pros::Motor_Group punchers
pros::Motor LeftBack
Contains all objects generated by the 1516B team - Contains all of the subsystems,...
Definition globals.cpp:17