TR-mbed 1.0
Loading...
Searching...
No Matches
Classes | Functions | Variables
Sentry.cpp File Reference
#include "base_robot/BaseRobot.h"
#include "util/algorithms/general_functions.h"
#include "subsystems/ChassisSubsystem.h"
#include "subsystems/ShooterSubsystem.h"
#include "subsystems/TurretSubsystem.h"
#include "util/communications/CANHandler.h"
#include "util/communications/jetson/Jetson.h"
#include "util/motor/DJIMotor.h"
#include "util/peripherals/imu/BNO055.h"
#include "util/peripherals/encoder/MA4.h"
#include <algorithm>

Classes

class  Sentry
 

Functions

int main ()
 

Variables

constexpr auto IMU_I2C_SDA = PB_7
 
constexpr auto IMU_I2C_SCL = PB_8
 
constexpr auto IMU_RESET = PA_8
 
constexpr int pitch_zero_offset_ticks = 1500
 
constexpr float PITCH_LOWER_BOUND {-22.0}
 
constexpr float PITCH_UPPER_BOUND {20.0}
 
constexpr float JOYSTICK_YAW_SENSITIVITY_DPS = 600
 
constexpr float JOYSTICK_PITCH_SENSITIVITY_DPS = 300
 
constexpr float MOUSE_SENSITIVITY_YAW_DPS = 10.0
 
constexpr float MOUSE_SENSITIVITY_PITCH_DPS = 10.0
 
constexpr PID::config YAW_VEL_PID = {181, 3.655 * 10e-3, 4.51 * 2.25, 32000, 1000}
 
constexpr PID::config YAW_POS_PID = {1, 0, 0, 90, 2}
 
const float yaw_static_friction = -150
 
const float yaw_kinetic_friction = 0
 
constexpr PID::config PITCH_VEL_PID = {173.8994, 4.898 * 10e-9, 12.474 * 10, 16000, 1000}
 
constexpr PID::config PITCH_POS_PID = {1, 0, 0,30,2}
 
const float pitch_gravity_feedforward = -500
 
const float pitch_static_friction = 635.0 / 5
 
const float pitch_kinetic_friction = 0
 
constexpr PID::config FL_VEL_CONFIG = {3, 0, 0}
 
constexpr PID::config FR_VEL_CONFIG = {3, 0, 0}
 
constexpr PID::config BL_VEL_CONFIG = {3, 0, 0}
 
constexpr PID::config BR_VEL_CONFIG = {3, 0, 0}
 
constexpr PID::config FLYWHEEL_L_PID = {7.1849, 0.000042634, 0}
 
constexpr PID::config FLYWHEEL_R_PID = {7.1849, 0.000042634, 0}
 
constexpr PID::config INDEXER_PID_VEL = {2.7, 0.001, 0}
 
constexpr PID::config INDEXER_PID_POS = {0.1, 0, 0.001}
 
TurretSubsystem::config turret_config
 
ShooterSubsystem::config shooter_config
 
ChassisSpeeds des_chassis_state
 
TurretSubsystem::TurretInfo des_turret_state
 
ShootState des_shoot_state
 
int remoteTimer = 0
 
float pitch_desired_angle = 0.0
 
float yaw_desired_angle = 0.0
 
IMU::EulerAngles imuAngles
 

Function Documentation

◆ main()

int main ( )

Variable Documentation

◆ BL_VEL_CONFIG

constexpr PID::config BL_VEL_CONFIG = {3, 0, 0}
constexpr

◆ BR_VEL_CONFIG

constexpr PID::config BR_VEL_CONFIG = {3, 0, 0}
constexpr

◆ des_chassis_state

ChassisSpeeds des_chassis_state

◆ des_shoot_state

ShootState des_shoot_state

◆ des_turret_state

TurretSubsystem::TurretInfo des_turret_state

◆ FL_VEL_CONFIG

constexpr PID::config FL_VEL_CONFIG = {3, 0, 0}
constexpr

◆ FLYWHEEL_L_PID

constexpr PID::config FLYWHEEL_L_PID = {7.1849, 0.000042634, 0}
constexpr

◆ FLYWHEEL_R_PID

constexpr PID::config FLYWHEEL_R_PID = {7.1849, 0.000042634, 0}
constexpr

◆ FR_VEL_CONFIG

constexpr PID::config FR_VEL_CONFIG = {3, 0, 0}
constexpr

◆ IMU_I2C_SCL

constexpr auto IMU_I2C_SCL = PB_8
constexpr

◆ IMU_I2C_SDA

constexpr auto IMU_I2C_SDA = PB_7
constexpr

◆ IMU_RESET

constexpr auto IMU_RESET = PA_8
constexpr

◆ imuAngles

IMU::EulerAngles imuAngles

◆ INDEXER_PID_POS

constexpr PID::config INDEXER_PID_POS = {0.1, 0, 0.001}
constexpr

◆ INDEXER_PID_VEL

constexpr PID::config INDEXER_PID_VEL = {2.7, 0.001, 0}
constexpr

◆ JOYSTICK_PITCH_SENSITIVITY_DPS

constexpr float JOYSTICK_PITCH_SENSITIVITY_DPS = 300
constexpr

◆ JOYSTICK_YAW_SENSITIVITY_DPS

constexpr float JOYSTICK_YAW_SENSITIVITY_DPS = 600
constexpr

◆ MOUSE_SENSITIVITY_PITCH_DPS

constexpr float MOUSE_SENSITIVITY_PITCH_DPS = 10.0
constexpr

◆ MOUSE_SENSITIVITY_YAW_DPS

constexpr float MOUSE_SENSITIVITY_YAW_DPS = 10.0
constexpr

◆ pitch_desired_angle

float pitch_desired_angle = 0.0

◆ pitch_gravity_feedforward

const float pitch_gravity_feedforward = -500

◆ pitch_kinetic_friction

const float pitch_kinetic_friction = 0

◆ PITCH_LOWER_BOUND

constexpr float PITCH_LOWER_BOUND {-22.0}
constexpr

◆ PITCH_POS_PID

constexpr PID::config PITCH_POS_PID = {1, 0, 0,30,2}
constexpr

◆ pitch_static_friction

const float pitch_static_friction = 635.0 / 5

◆ PITCH_UPPER_BOUND

constexpr float PITCH_UPPER_BOUND {20.0}
constexpr

◆ PITCH_VEL_PID

constexpr PID::config PITCH_VEL_PID = {173.8994, 4.898 * 10e-9, 12.474 * 10, 16000, 1000}
constexpr

◆ pitch_zero_offset_ticks

constexpr int pitch_zero_offset_ticks = 1500
constexpr

◆ remoteTimer

int remoteTimer = 0

◆ shooter_config

ShooterSubsystem::config shooter_config
Initial value:
= {
0,
1,
2,
6,
true
}
constexpr PID::config INDEXER_PID_VEL
Definition Sentry.cpp:48
constexpr PID::config INDEXER_PID_POS
Definition Sentry.cpp:49
constexpr PID::config FLYWHEEL_R_PID
Definition Sentry.cpp:47
constexpr PID::config FLYWHEEL_L_PID
Definition Sentry.cpp:46
@ CANBUS_2
Definition CANHandler.h:45
@ BURST
Definition ShooterSubsystem.h:22

◆ turret_config

TurretSubsystem::config turret_config
Initial value:
= {
4,
8,
1,
(1.0 / 3.0),
}
@ M3508
Definition DJIMotor.h:43
const float pitch_kinetic_friction
Definition Sentry.cpp:39
const float pitch_gravity_feedforward
Definition Sentry.cpp:37
const float yaw_kinetic_friction
Definition Sentry.cpp:33
const float pitch_static_friction
Definition Sentry.cpp:38
constexpr int pitch_zero_offset_ticks
Definition Sentry.cpp:20
const float yaw_static_friction
Definition Sentry.cpp:32
constexpr PID::config PITCH_POS_PID
Definition Sentry.cpp:36
constexpr PID::config PITCH_VEL_PID
Definition Sentry.cpp:35
constexpr PID::config YAW_POS_PID
Definition Sentry.cpp:31
constexpr float PITCH_UPPER_BOUND
Definition Sentry.cpp:22
constexpr float PITCH_LOWER_BOUND
Definition Sentry.cpp:21
constexpr PID::config YAW_VEL_PID
Definition Sentry.cpp:30
@ CANBUS_1
Definition CANHandler.h:45

◆ yaw_desired_angle

float yaw_desired_angle = 0.0

◆ yaw_kinetic_friction

const float yaw_kinetic_friction = 0

◆ YAW_POS_PID

constexpr PID::config YAW_POS_PID = {1, 0, 0, 90, 2}
constexpr

◆ yaw_static_friction

const float yaw_static_friction = -150

◆ YAW_VEL_PID

constexpr PID::config YAW_VEL_PID = {181, 3.655 * 10e-3, 4.51 * 2.25, 32000, 1000}
constexpr