mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
Continued work on documentation
This commit is contained in:
parent
5d6897fb88
commit
123898882c
@ -19,9 +19,9 @@ class AutoDrive: public Command{
|
|||||||
/**
|
/**
|
||||||
* @brief Constructs AutoDrive
|
* @brief Constructs AutoDrive
|
||||||
*
|
*
|
||||||
* @param double Timeout in seconds
|
* @param duration Timeout in seconds
|
||||||
* @param double Joystick x value (default: 0.0)
|
* @param xtmp Joystick x value (default: 0.0)
|
||||||
* @param double Joystick y value (default: 0.75)
|
* @param ytmp Joystick y value (default: 0.75)
|
||||||
*/
|
*/
|
||||||
AutoDrive(double duration, double xtmp = 0.0, double ytmp = -0.75);
|
AutoDrive(double duration, double xtmp = 0.0, double ytmp = -0.75);
|
||||||
/**
|
/**
|
||||||
|
@ -4,8 +4,16 @@
|
|||||||
#include "Commands/Command.h"
|
#include "Commands/Command.h"
|
||||||
#include "WPILib.h"
|
#include "WPILib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Opens bin arms (unused)
|
||||||
|
*/
|
||||||
class BinOpenArms: public Command{
|
class BinOpenArms: public Command{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs BinOpenArms
|
||||||
|
*
|
||||||
|
* @param double The timeout
|
||||||
|
*/
|
||||||
BinOpenArms(double);
|
BinOpenArms(double);
|
||||||
/**
|
/**
|
||||||
* @brief Constructs BinOpenArms
|
* @brief Constructs BinOpenArms
|
||||||
|
@ -45,7 +45,7 @@ class DentRobot: public IterativeRobot {
|
|||||||
*/
|
*/
|
||||||
static BinElevator* binElevator;
|
static BinElevator* binElevator;
|
||||||
/**
|
/**
|
||||||
* @brief The Pneumatics system (UNUSED)
|
* @brief The Pneumatics system (unused)
|
||||||
*/
|
*/
|
||||||
static Pneumatics* pneumatics;
|
static Pneumatics* pneumatics;
|
||||||
/**
|
/**
|
||||||
|
@ -3,18 +3,53 @@
|
|||||||
|
|
||||||
#include "WPILib.h"
|
#include "WPILib.h"
|
||||||
#include "Commands/PIDSubsystem.h"
|
#include "Commands/PIDSubsystem.h"
|
||||||
|
/**
|
||||||
|
* @brief Controls the bin elevator
|
||||||
|
*/
|
||||||
class BinElevator{
|
class BinElevator{
|
||||||
private:
|
private:
|
||||||
CANTalon *motor;
|
CANTalon *motor; //<! The bin elevator motor
|
||||||
Encoder *elevatorEncoder;
|
Encoder *elevatorEncoder; //<! The bin elevator encoder (unused)
|
||||||
DigitalInput *elevatorBottom, *elevatorTop;
|
DigitalInput *elevatorBottom, //<! The bottom bin elevator sensor (unused)
|
||||||
|
*elevatorTop; //<! The top bin elevator sensor (unuesd)
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs BinElevator
|
||||||
|
*/
|
||||||
BinElevator();
|
BinElevator();
|
||||||
|
/**
|
||||||
|
* @brief No action
|
||||||
|
*/
|
||||||
void InitDefaultCommand();
|
void InitDefaultCommand();
|
||||||
|
/**
|
||||||
|
* @brief Runs the bin elevator
|
||||||
|
*
|
||||||
|
* @param double The power to run the bin elevator
|
||||||
|
*
|
||||||
|
* Ranges from -1.0 to 1.0
|
||||||
|
*/
|
||||||
void Run(double);
|
void Run(double);
|
||||||
|
/**
|
||||||
|
* @brief Sets the encoder value to 0 (unused)
|
||||||
|
*/
|
||||||
void ResetEncoder();
|
void ResetEncoder();
|
||||||
|
/**
|
||||||
|
* @brief Gets the height of the bin elevator
|
||||||
|
*
|
||||||
|
* @return The height of the bin elevator
|
||||||
|
*/
|
||||||
double GetHeight();
|
double GetHeight();
|
||||||
|
/**
|
||||||
|
* @brief Gets the status of the top sensor
|
||||||
|
*
|
||||||
|
* @return True if the sensor is activated
|
||||||
|
*/
|
||||||
bool GetElevatorTop();
|
bool GetElevatorTop();
|
||||||
|
/**
|
||||||
|
* @brief Gets the status of the bottom sensor
|
||||||
|
*
|
||||||
|
* @return True if the sensor is activated
|
||||||
|
*/
|
||||||
bool GetElevatorBottom();
|
bool GetElevatorBottom();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,11 +15,11 @@ class Collector: public Subsystem
|
|||||||
*collectorMotorRamp, //<! Ramp collctor motor
|
*collectorMotorRamp, //<! Ramp collctor motor
|
||||||
*collectorMotorRight; //<! Right collector motor
|
*collectorMotorRight; //<! Right collector motor
|
||||||
/**
|
/**
|
||||||
* @brief Analog input for sonar (UNUSED)
|
* @brief Analog input for sonar (unused)
|
||||||
*/
|
*/
|
||||||
AnalogInput *sonarAnalog;
|
AnalogInput *sonarAnalog;
|
||||||
/**
|
/**
|
||||||
* @brief Digital output for sonar (UNUSED)
|
* @brief Digital output for sonar (unused)
|
||||||
*/
|
*/
|
||||||
DigitalOutput *sonarDigital;
|
DigitalOutput *sonarDigital;
|
||||||
public:
|
public:
|
||||||
@ -38,7 +38,7 @@ class Collector: public Subsystem
|
|||||||
*/
|
*/
|
||||||
void MoveRollers(double);
|
void MoveRollers(double);
|
||||||
/**
|
/**
|
||||||
* @brief Gets the distance of the sonar (UNUSED)
|
* @brief Gets the distance of the sonar (unused)
|
||||||
*
|
*
|
||||||
* @return The sonar distance
|
* @return The sonar distance
|
||||||
*/
|
*/
|
||||||
|
@ -2,21 +2,58 @@
|
|||||||
#define DRIVETRAIN_H
|
#define DRIVETRAIN_H
|
||||||
|
|
||||||
#include "WPILib.h"
|
#include "WPILib.h"
|
||||||
|
/**
|
||||||
|
* @brief Drives the robot
|
||||||
|
*
|
||||||
|
* 4 wheel mecanum drive
|
||||||
|
*/
|
||||||
class Drivetrain: public Subsystem{
|
class Drivetrain: public Subsystem{
|
||||||
private:
|
private:
|
||||||
CANTalon *rightFront, *leftFront, *rightRear, *leftRear;
|
CANTalon *rightFront, //<! Front right motor
|
||||||
RobotDrive *drive;
|
*leftFront, //<! Front left motor
|
||||||
|
*rightRear, //<! Back right motor
|
||||||
|
*leftRear; //<! Back left motor
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs Drivetrain
|
||||||
|
*/
|
||||||
Drivetrain();
|
Drivetrain();
|
||||||
|
/**
|
||||||
|
* @brief Current motor to test
|
||||||
|
*/
|
||||||
enum e_motors{
|
enum e_motors{
|
||||||
FRONTRIGHT,
|
FRONTRIGHT, //<! Front right motor
|
||||||
FRONTLEFT,
|
FRONTLEFT, //<! Front left motor
|
||||||
BACKRIGHT,
|
BACKRIGHT, //<! Back right motor
|
||||||
BACKLEFT
|
BACKLEFT //<! Back left motor
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* @brief No action
|
||||||
|
*/
|
||||||
void InitDefaultCommand();
|
void InitDefaultCommand();
|
||||||
|
/**
|
||||||
|
* @brief Drives the robot with mecanum
|
||||||
|
*
|
||||||
|
* @param double Joystick x value (-1.0 to 1.0)
|
||||||
|
* @param double Joystick y value (-1.0 to 1.0)
|
||||||
|
* @param double Joystick z value (-1.0 to 1.0)
|
||||||
|
* @param double Sensitivity (0.0 to 1.0)
|
||||||
|
* @param double Gyro value (unused)
|
||||||
|
*/
|
||||||
void DriveMecanum(double, double, double, double, double);
|
void DriveMecanum(double, double, double, double, double);
|
||||||
|
/**
|
||||||
|
* @brief Drives the robot with arcade drive
|
||||||
|
*
|
||||||
|
* @param double Joystick x value (-1.0 to 1.0)
|
||||||
|
* @param double Joystick y value (-1.0 to 1.0)
|
||||||
|
*/
|
||||||
void DriveArcade(double, double);
|
void DriveArcade(double, double);
|
||||||
|
/**
|
||||||
|
* @brief Tests one motor
|
||||||
|
*
|
||||||
|
* @param e_motors Motor to test
|
||||||
|
* @param double Power to set motor
|
||||||
|
*/
|
||||||
void TestMotor(e_motors, double);
|
void TestMotor(e_motors, double);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -8,7 +8,6 @@ Elevator::Elevator(){
|
|||||||
elevatorTop=new DigitalInput(ELEVATOR_TOP_DIO);
|
elevatorTop=new DigitalInput(ELEVATOR_TOP_DIO);
|
||||||
// Checks if the elevator is drifting
|
// Checks if the elevator is drifting
|
||||||
useEncoder=false;
|
useEncoder=false;
|
||||||
stoppedAtSensor=false;
|
|
||||||
}
|
}
|
||||||
void Elevator::InitDefaultCommand(){
|
void Elevator::InitDefaultCommand(){
|
||||||
}
|
}
|
||||||
|
@ -2,24 +2,71 @@
|
|||||||
#define ELEVATOR_H
|
#define ELEVATOR_H
|
||||||
|
|
||||||
#include "WPILib.h"
|
#include "WPILib.h"
|
||||||
#include "Commands/PIDSubsystem.h"
|
/**
|
||||||
|
* @brief The main elevator for lifting totes
|
||||||
|
*/
|
||||||
class Elevator{
|
class Elevator{
|
||||||
private:
|
private:
|
||||||
CANTalon *motor;
|
CANTalon *motor; //<! The elevator motor
|
||||||
Encoder *elevatorEncoder;
|
Encoder *elevatorEncoder; //<! The elevator encoder (unused)
|
||||||
DigitalInput *elevatorBottom, *elevatorMiddle, *elevatorTop;
|
DigitalInput *elevatorBottom, //<! The bottom elevator sensor
|
||||||
bool useEncoder;
|
*elevatorMiddle, //<! The middle elevator sensor
|
||||||
|
*elevatorTop; //<! The top elevator sensor
|
||||||
|
bool useEncoder; //<! Use the elevator enoder (unused)
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs Elevator
|
||||||
|
*/
|
||||||
Elevator();
|
Elevator();
|
||||||
bool stoppedAtSensor;
|
/**
|
||||||
|
* @brief No action
|
||||||
|
*/
|
||||||
void InitDefaultCommand();
|
void InitDefaultCommand();
|
||||||
|
/**
|
||||||
|
* @brief Runs the elevator
|
||||||
|
*
|
||||||
|
* @param double The power to run the bin elevator (-1.0 to 1.0)
|
||||||
|
*/
|
||||||
void Run(double);
|
void Run(double);
|
||||||
|
/**
|
||||||
|
* @brief Sets the encoder value to 0 (unused)
|
||||||
|
*/
|
||||||
void ResetEncoder();
|
void ResetEncoder();
|
||||||
|
/**
|
||||||
|
* @brief Gets the height of the elevtor
|
||||||
|
*
|
||||||
|
* @return The hight of the elevator
|
||||||
|
*/
|
||||||
double GetHeight();
|
double GetHeight();
|
||||||
|
/**
|
||||||
|
* @brief Gets the status of the top sensor
|
||||||
|
*
|
||||||
|
* @return True if the sensor is activated
|
||||||
|
*/
|
||||||
bool GetElevatorTop();
|
bool GetElevatorTop();
|
||||||
|
/**
|
||||||
|
* @brief Gets the status of the middle sensor
|
||||||
|
*
|
||||||
|
* @return True if the sensor is activated
|
||||||
|
*/
|
||||||
bool GetElevatorMiddle();
|
bool GetElevatorMiddle();
|
||||||
|
/**
|
||||||
|
* @brief Gets the status of the bottom sensor
|
||||||
|
*
|
||||||
|
* @return True if the sensor is activated
|
||||||
|
*/
|
||||||
bool GetElevatorBottom();
|
bool GetElevatorBottom();
|
||||||
|
/**
|
||||||
|
* @brief Use the elevator encoder (unused)
|
||||||
|
*
|
||||||
|
* @param bool State to use encoder
|
||||||
|
*/
|
||||||
void SetUseEncoder(bool);
|
void SetUseEncoder(bool);
|
||||||
|
/**
|
||||||
|
* @brief Gets the state of useEncoder (unused)
|
||||||
|
*
|
||||||
|
* @return State of useEncoder
|
||||||
|
*/
|
||||||
bool GetUseEncoder();
|
bool GetUseEncoder();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,13 +2,29 @@
|
|||||||
#define PNEUMATICS_H
|
#define PNEUMATICS_H
|
||||||
|
|
||||||
#include "WPILib.h"
|
#include "WPILib.h"
|
||||||
class Pneumatics: public Subsystem
|
/**
|
||||||
{
|
* @brief Pneumatics on the robot (unused)
|
||||||
|
*
|
||||||
|
* For opening or closing the bin arms
|
||||||
|
*/
|
||||||
|
class Pneumatics: public Subsystem{
|
||||||
private:
|
private:
|
||||||
Solenoid *solenoid1, *solenoid2;
|
Solenoid *solenoid1, //<! Solenoid 1
|
||||||
|
*solenoid2; //<! Solenoid 3
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs Pneumatics
|
||||||
|
*/
|
||||||
Pneumatics();
|
Pneumatics();
|
||||||
|
/**
|
||||||
|
* @brief No action
|
||||||
|
*/
|
||||||
void InitDefaultCommand();
|
void InitDefaultCommand();
|
||||||
|
/**
|
||||||
|
* @brief Sets the state of the arms
|
||||||
|
*
|
||||||
|
* @param bool State of the arms
|
||||||
|
*/
|
||||||
void SetOpen(bool);
|
void SetOpen(bool);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user