mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Started working on documentation
This commit is contained in:
parent
4f82b3304c
commit
d35d8e95b4
@ -6,16 +6,44 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Drives the robot without a joystick
|
||||
*
|
||||
* Drives the robot given a timeout and joystick values
|
||||
*/
|
||||
class AutoDrive: public Command{
|
||||
private:
|
||||
double x, y;
|
||||
public:
|
||||
AutoDrive(double);
|
||||
/**
|
||||
* @brief Constructs AutoDrive
|
||||
*
|
||||
* @param double Timeout in seconds
|
||||
* @param double Joystick x value (default: 0.0)
|
||||
* @param double Joystick y value (default: 0.75)
|
||||
*/
|
||||
AutoDrive(double, double, double);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Drives the robot
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the drivetrain to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -6,8 +6,27 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief The autonomous period of the robot
|
||||
*
|
||||
* Contains three sequences selectable from the SmartDashboard
|
||||
* All sequences will wait for the SmartDashboard value "Auto Wait Time"
|
||||
*
|
||||
* Sequence 0: Used for testing only
|
||||
*
|
||||
* Sequence 1: Drives forward "Auto Zone Distance" at -0.8 power
|
||||
*
|
||||
* Sequence 2: Collects a tote, turns, then drives to the auto zone
|
||||
*
|
||||
* Sequence 3: Collects two or three totes then drives to auto zone
|
||||
*/
|
||||
class Autonomous: public CommandGroup{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs Autonomous
|
||||
*
|
||||
* @param int The sequence to run
|
||||
*/
|
||||
Autonomous(int);
|
||||
};
|
||||
#endif
|
||||
|
@ -6,8 +6,16 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Collects one tote
|
||||
*
|
||||
* Rolls collector wheels in and drives forward in parallel
|
||||
*/
|
||||
class CollectTote: public CommandGroup{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs CollectTote
|
||||
*/
|
||||
CollectTote();
|
||||
};
|
||||
#endif
|
||||
|
@ -6,8 +6,16 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Releases one tote
|
||||
*
|
||||
* Rolls collector wheels out and drives backwards in parallel
|
||||
*/
|
||||
class ReleaseTote: public CommandGroup{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs ReleaseTote
|
||||
*/
|
||||
ReleaseTote();
|
||||
};
|
||||
#endif
|
||||
|
@ -6,15 +6,42 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Turns the robot
|
||||
*
|
||||
* Turns the robot until a timeout is reached
|
||||
*/
|
||||
class Turn: public Command{
|
||||
private:
|
||||
int degrees;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs Turn
|
||||
*
|
||||
* @param double Timeout in seconds
|
||||
*/
|
||||
Turn(double);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Turns the robot
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the drivetrain to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -4,13 +4,38 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Closes BinElevatorArms (NOT USED)
|
||||
*
|
||||
* Sets the solenoid to close the arms of the BinElevator
|
||||
*/
|
||||
class BinCloseArms: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs BinCloseArms
|
||||
*/
|
||||
BinCloseArms();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Sets the solenoid to close the arms
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Returns true to prevent solenoid damage
|
||||
*
|
||||
* @return True
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Ends the command
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
|
@ -4,15 +4,40 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Lowers the bin elevator until a timeout is reached
|
||||
*/
|
||||
class BinLower: public Command{
|
||||
private:
|
||||
float timeout;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs BinLower
|
||||
*
|
||||
* @param float Timeout in seconds
|
||||
*/
|
||||
BinLower(float);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Lowers the bin elevator at -1.0 power
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the bin elevator to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -6,13 +6,32 @@
|
||||
|
||||
class BinOpenArms: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs BinOpenArms
|
||||
*/
|
||||
BinOpenArms();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Sets the solenoid to open the arms
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Returns true to prevent solenoid damage
|
||||
*
|
||||
* @return True
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Ends the command
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -4,17 +4,41 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Raises the bin elevator until a timeout is reached
|
||||
*/
|
||||
class BinRaise: public Command{
|
||||
private:
|
||||
float timeout;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs BinRaise
|
||||
*
|
||||
* @param float Timeout in seconds
|
||||
*/
|
||||
BinRaise(float);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Raises the bin elevator at 1.0 power
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the bin elevator to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -6,17 +6,41 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Rolls collector motors in until a timeout is reached
|
||||
*/
|
||||
class RollIn: public Command{
|
||||
private:
|
||||
double rawSpeed;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs RollIn
|
||||
*
|
||||
* @param double Timeout in seconds
|
||||
*/
|
||||
RollIn(double);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Rolls the four collector motors in
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the collector to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -6,15 +6,37 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Rolls collector motors out until a timeout is reached
|
||||
*/
|
||||
class RollOut: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs RollOut
|
||||
*/
|
||||
RollOut();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Rolls the four collector motors out
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True only if the timeout was reached
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the collector to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -6,13 +6,38 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Drives the robot with a joystick
|
||||
*
|
||||
* Uses mechanum drive
|
||||
*/
|
||||
class Drive: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs Drive
|
||||
*/
|
||||
Drive();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Drives the robot with joysticks from OI
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return False
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Ends the command
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -4,13 +4,36 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Lowers the elevator until a timeout is reached
|
||||
*/
|
||||
class Lower: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs Lower
|
||||
*/
|
||||
Lower();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Lowers the elevator at -1.0 power
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True if the timeout was reached or if the bottom elevator sensor was triggered
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the elevator to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -4,15 +4,37 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief Raises the elevator until a timeout is reached
|
||||
*/
|
||||
class Raise: public Command{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs Raise
|
||||
*/
|
||||
Raise();
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief Raises the elevator at 1.0 power
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return True if the timeout was reached or if the top elevator was triggered or if the middle elevator is triggered
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief Sets the elevator to stop
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -6,15 +6,40 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
class CheckDrive: public CommandGroup{
|
||||
private:
|
||||
int motor;
|
||||
public:
|
||||
/**
|
||||
* @brief TODO
|
||||
*
|
||||
* @param int
|
||||
*/
|
||||
CheckDrive(int);
|
||||
/**
|
||||
* @brief Initializes the class
|
||||
*/
|
||||
void Initialize();
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
void Execute();
|
||||
/**
|
||||
* @brief Checks if the command is finished
|
||||
*
|
||||
* @return TODO
|
||||
*/
|
||||
bool IsFinished();
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
void End();
|
||||
/**
|
||||
* @brief Calls End()
|
||||
*/
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
||||
|
@ -6,8 +6,14 @@
|
||||
#include "../../DentRobot.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
class CheckRobot: public CommandGroup{
|
||||
public:
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
CheckRobot();
|
||||
};
|
||||
#endif
|
||||
|
31
OI.h
31
OI.h
@ -4,16 +4,45 @@
|
||||
#include "WPILib.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
/**
|
||||
* @brief Controls the robot with joysticks
|
||||
*/
|
||||
class OI
|
||||
{
|
||||
private:
|
||||
Joystick *leftStick, *rightStick;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs OI
|
||||
*/
|
||||
OI();
|
||||
Command *raise, *lower, *binLower, *binRaise;
|
||||
Command *raise, //!< Raise command
|
||||
*lower, //!< Lower command
|
||||
*binLower, //!< BinLower command
|
||||
*binRaise; //!< BinRaise command
|
||||
/**
|
||||
* @brief Returns the right joystick
|
||||
*
|
||||
* @return The right joystick
|
||||
*/
|
||||
Joystick* GetRightStick();
|
||||
/**
|
||||
* @brief Returns the left joystick
|
||||
*
|
||||
* @return The left joystick
|
||||
*/
|
||||
Joystick* GetLeftStick();
|
||||
/**
|
||||
* @brief Returns the left joystick throttle
|
||||
*
|
||||
* @return The left joystick throttle
|
||||
*/
|
||||
double GetLeftThrottle();
|
||||
/**
|
||||
* @brief Returns the right joystick throttle
|
||||
*
|
||||
* @return The right joystick throttle
|
||||
*/
|
||||
double GetRightThrottle();
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user