reimplement and clean globals
This commit is contained in:
parent
ce392d2db3
commit
f9dc19260f
49
CLOUDS/include/globals.hpp
Normal file
49
CLOUDS/include/globals.hpp
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
#include "Wings.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
|
||||||
|
#define TRACK_WIDTH 11.5
|
||||||
|
#define PLACEHOLDER_TC_OFFSET 2.5
|
||||||
|
#define WHEEL_SIZE 2.75
|
||||||
|
#define DRIVE_RATIO 0.75
|
||||||
|
#define DRIVE_RPM 450
|
||||||
|
|
||||||
|
namespace globals {
|
||||||
|
extern pros::Controller master;
|
||||||
|
|
||||||
|
extern pros::Motor motor_tlf;
|
||||||
|
extern pros::Motor motor_tlb;
|
||||||
|
extern pros::Motor motor_blf;
|
||||||
|
extern pros::Motor motor_blb;
|
||||||
|
extern pros::Motor motor_trf;
|
||||||
|
extern pros::Motor motor_trb;
|
||||||
|
extern pros::Motor motor_brf;
|
||||||
|
extern pros::Motor motor_brb;
|
||||||
|
|
||||||
|
extern pros::Imu inertial_sensor;
|
||||||
|
|
||||||
|
extern pros::Motor_Group left_drive;
|
||||||
|
extern pros::Motor_Group right_drive;
|
||||||
|
|
||||||
|
/* PNEUMATICS */
|
||||||
|
extern pros::ADIDigitalOut pto_piston;
|
||||||
|
extern pros::ADIDigitalOut left_wing_piston;
|
||||||
|
extern pros::ADIDigitalOut right_wing_piston;
|
||||||
|
extern pros::ADIDigitalOut climb_piston;
|
||||||
|
|
||||||
|
extern Wings wings;
|
||||||
|
extern Timer timer;
|
||||||
|
|
||||||
|
extern Drive chassis;
|
||||||
|
|
||||||
|
extern pros::Motor& intake_mtr;
|
||||||
|
extern pros::Motor& cata_mtr;
|
||||||
|
|
||||||
|
enum e_controlsch {
|
||||||
|
RENU,
|
||||||
|
RIA,
|
||||||
|
CHRIS
|
||||||
|
};
|
||||||
|
}
|
||||||
54
CLOUDS/src/globals.cpp
Normal file
54
CLOUDS/src/globals.cpp
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
globals.cpp
|
||||||
|
|
||||||
|
Contains all devices and electronics used for the robot
|
||||||
|
Holds other mechanicsm classes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "globals.hpp"
|
||||||
|
|
||||||
|
using namespace ary;
|
||||||
|
namespace globals {
|
||||||
|
// Chassis
|
||||||
|
pros::Controller master(CONTROLLER_MASTER);
|
||||||
|
|
||||||
|
/*
|
||||||
|
{-2, -6, 12, 5}, -> left
|
||||||
|
{-16, 1, 4, -3}, -> right
|
||||||
|
*/
|
||||||
|
|
||||||
|
pros::Motor motor_tlf(14, MOTOR_GEARSET_06, false);
|
||||||
|
pros::Motor motor_blb(9, MOTOR_GEARSET_06, true);
|
||||||
|
pros::Motor motor_blf(3, MOTOR_GEARSET_06, true);
|
||||||
|
pros::Motor motor_tlb(7, MOTOR_GEARSET_06, false);
|
||||||
|
pros::Motor motor_trf(15, MOTOR_GEARSET_06, true);
|
||||||
|
pros::Motor motor_trb(6, MOTOR_GEARSET_06, true);
|
||||||
|
pros::Motor motor_brf(12, MOTOR_GEARSET_06, false);
|
||||||
|
pros::Motor motor_brb(5, MOTOR_GEARSET_06, false);
|
||||||
|
|
||||||
|
pros::Imu inertial_sensor(11);
|
||||||
|
|
||||||
|
pros::Motor_Group left_drive({ motor_tlf, motor_tlb, motor_blf, motor_blb });
|
||||||
|
pros::Motor_Group right_drive({ motor_trf, motor_trb, motor_brf, motor_brb });
|
||||||
|
|
||||||
|
/* PNEUMATICS */
|
||||||
|
pros::ADIDigitalOut pto_piston('A');
|
||||||
|
pros::ADIDigitalOut left_wing_piston('E');
|
||||||
|
pros::ADIDigitalOut right_wing_piston('F');
|
||||||
|
pros::ADIDigitalOut climb_piston('B');
|
||||||
|
|
||||||
|
Wings wings;
|
||||||
|
Timer timer;
|
||||||
|
|
||||||
|
Drive chassis(
|
||||||
|
{14, -9, -3, 7},
|
||||||
|
{-15, 12, 5, -6},
|
||||||
|
18,
|
||||||
|
WHEEL_SIZE,
|
||||||
|
600,
|
||||||
|
DRIVE_RATIO
|
||||||
|
);
|
||||||
|
|
||||||
|
pros::Motor& intake_mtr = chassis.left_motors[3];
|
||||||
|
pros::Motor& cata_mtr = chassis.right_motors[3];
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user