TR-mbed 1.0
Loading...
Searching...
No Matches
ShooterSubsystem.h
Go to the documentation of this file.
1
2
3#pragma once
4
8#include "Subsystem.h"
9
10// Constants
11constexpr int NUM_BALLS_SHOT = 3;
12constexpr int FLYWHEEL_VELO = 5500;
13constexpr int HERO_FLYWHEEL_VELO = 7475;
14
15// enum for states
17
18// struct for config
20{
21public:
23
42
43 ShooterSubsystem(config configuration);
44
45 void setState(ShootState shoot_state);
46
47 void periodic(int curr_heat, int heat_limit);
48
49private:
50 unsigned long shooter_time;
51 bool invert_flywheel;
52
53 DJIMotor flywheelL, flywheelR, indexer;
54
55 ShootState shoot;
56 ShooterType shooter_type;
57
58 int barrel_heat;
59 int barrel_heat_limit;
60 bool shootReady;
61
62 int shootTargetPosition;
63};
constexpr int NUM_BALLS_SHOT
Definition ShooterSubsystem.h:11
constexpr int HERO_FLYWHEEL_VELO
Definition ShooterSubsystem.h:13
constexpr int FLYWHEEL_VELO
Definition ShooterSubsystem.h:12
ShootState
Definition ShooterSubsystem.h:16
@ SHOOT
Definition ShooterSubsystem.h:16
@ OFF
Definition ShooterSubsystem.h:16
@ FLYWHEEL
Definition ShooterSubsystem.h:16
CANBus
Definition CANHandler.h:45
Definition DJIMotor.h:47
Definition ShooterSubsystem.h:20
ShooterType
Definition ShooterSubsystem.h:22
@ BURST
Definition ShooterSubsystem.h:22
@ AUTO
Definition ShooterSubsystem.h:22
Definition Subsystem.h:5
void setState()
void periodic()
Definition PID.h:154
Definition ShooterSubsystem.h:25
PID::config flywheelL_PID
Definition ShooterSubsystem.h:33
short flywheelL_id
Definition ShooterSubsystem.h:29
ShooterType type
Definition ShooterSubsystem.h:26
bool invert
Definition ShooterSubsystem.h:40
short indexer_id
Definition ShooterSubsystem.h:31
PID::config flywheelR_PID
Definition ShooterSubsystem.h:34
CANHandler::CANBus canBus
Definition ShooterSubsystem.h:38
PID::config indexer_PID_vel
Definition ShooterSubsystem.h:35
int heat_limit
Definition ShooterSubsystem.h:27
short flywheelR_id
Definition ShooterSubsystem.h:30
PID::config indexer_PID_pos
Definition ShooterSubsystem.h:36