1516b Over Under 2.0
Codebase for 1516b over under season
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1/**
2 * \file main.h
3 *
4 * Contains common definitions and header files used throughout your PROS
5 * project.
6 *
7 * \copyright Copyright (c) 2017-2023, Purdue University ACM SIGBots.
8 * All rights reserved.
9 *
10 * This Source Code Form is subject to the terms of the Mozilla Public
11 * License, v. 2.0. If a copy of the MPL was not distributed with this
12 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 */
14
15#ifndef _PROS_MAIN_H_
16#define _PROS_MAIN_H_
17
18/**
19 * If defined, some commonly used enums will have preprocessor macros which give
20 * a shorter, more convenient naming pattern. If this isn't desired, simply
21 * comment the following line out.
22 *
23 * For instance, E_CONTROLLER_MASTER has a shorter name: CONTROLLER_MASTER.
24 * E_CONTROLLER_MASTER is pedantically correct within the PROS styleguide, but
25 * not convenient for most student programmers.
26 */
27#define PROS_USE_SIMPLE_NAMES
28
29/**
30 * If defined, C++ literals will be available for use. All literals are in the
31 * pros::literals namespace.
32 *
33 * For instance, you can do `4_mtr = 50` to set motor 4's target velocity to 50
34 */
35#define PROS_USE_LITERALS
36
37#include "api.h"
38#include "robot/auton.h"
39#include "globals.h"
40#include "robot/drivetrain.h"
41#include "robot/puncher.h"
42#include "robot/intake.h"
43#include "robot/utility.h"
44
45/**
46 * You should add more #includes here
47 */
48//#include "okapi/api.hpp"
49//#include "pros/api_legacy.h"
50
51/**
52 * If you find doing pros::Motor() to be tedious and you'd prefer just to do
53 * Motor, you can use the namespace with the following commented out line.
54 *
55 * IMPORTANT: Only the okapi or pros namespace may be used, not both
56 * concurrently! The okapi namespace will export all symbols inside the pros
57 * namespace.
58 */
59// using namespace pros;
60// using namespace pros::literals;
61// using namespace okapi;
62
63/**
64 * Prototypes for the competition control tasks are redefined here to ensure
65 * that they can be called from user code (i.e. calling autonomous from a
66 * button press in opcontrol() for testing purposes).
67 */
68#ifdef __cplusplus
69extern "C" {
70#endif
71void autonomous(void);
72void initialize(void);
73void disabled(void);
74void competition_initialize(void);
75void opcontrol(void);
76#ifdef __cplusplus
77}
78#endif
79
80#ifdef __cplusplus
81/**
82 * You can add C++-only headers here
83 */
84//#include <iostream>
85#endif
86
87#endif // _PROS_MAIN_H_
88;
The Autonomous class contains classes and functions related to the robot's autonomous behavior.
Definition auton.h:11
void AutoDrive(Puncher &puncher, bool autono)
Drives the robot autonomously.
Definition auton.cpp:60
Represents the drivetrain of the robot.
Definition drivetrain.h:23
void run()
Runs the drivetrain.
The Intake class represents a robot intake system.
Definition intake.h:8
void run()
Runs the main function of the intake system.
Definition intake.cpp:7
Represents a Puncher mechanism for a robot.
Definition puncher.h:12
void run(int autonVal)
Runs the puncher based on the given autonomous value.
Definition puncher.cpp:15
The Wings class represents the wings of a robot.
Definition wings.h:11
void run()
Runs the wings.
Definition wings.cpp:7
void initialize()
Definition main.cpp:59
void autonomous()
Definition main.cpp:121
void disabled()
Definition main.cpp:84
void competition_initialize()
Definition main.cpp:95
void opcontrol()
Definition main.cpp:144
void toggles()
Definition main.cpp:48
Contains global variables and type definitions for the Robot namespace.
Definition globals.cpp:18
lemlib::Chassis chassis
Contains utility functions for controlling the screen and toggling subsystems.
Definition utility.h:13
void displayLocation()
Displays current position of the robot.
Definition utility.cpp:42
void toggleSubsystemOptions(Autonomous &auton, Drivetrain &drive, Puncher &punch)
Toggles subsystems, drive mode auton routine, and puncher.
Definition utility.cpp:10
void displayMotorVel()
Displays current velocity of the robot.
Definition utility.cpp:28
Contains all objects generated by the 1516B team - Contains all of the subsystems,...
Definition globals.cpp:17
Structure that holds instances of all robot subsystems.
Definition main.cpp:31
Robot::Puncher puncher
Definition main.cpp:35
Robot::Drivetrain drivetrain
Definition main.cpp:33
Robot::Autonomous autonomous
Definition main.cpp:32
Robot::Wings wings
Definition main.cpp:34
Robot::Intake intake
Definition main.cpp:36