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