mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Fixed all doxygen errors, other slight modifications
This commit is contained in:
parent
4a2cf10c22
commit
49ad9dac39
@ -8,10 +8,11 @@ AutoDrive::AutoDrive(double duration, double xtmp, double ytmp): Command("AutoDr
|
|||||||
y=ytmp;
|
y=ytmp;
|
||||||
}
|
}
|
||||||
void AutoDrive::Initialize(){
|
void AutoDrive::Initialize(){
|
||||||
|
DentRobot::drivetrain->ResetGyro();
|
||||||
}
|
}
|
||||||
void AutoDrive::Execute(){
|
void AutoDrive::Execute(){
|
||||||
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
|
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
|
||||||
DentRobot::drivetrain->DriveMecanum(x, y, 0.0, 0.9);
|
DentRobot::drivetrain->DriveMecanum(x, y, 0.0, 0.9, true);
|
||||||
}
|
}
|
||||||
bool AutoDrive::IsFinished(){
|
bool AutoDrive::IsFinished(){
|
||||||
return IsTimedOut();
|
return IsTimedOut();
|
||||||
|
@ -13,7 +13,7 @@ class BinLower: public Command{
|
|||||||
/**
|
/**
|
||||||
* @brief Constructs BinLower
|
* @brief Constructs BinLower
|
||||||
*
|
*
|
||||||
* @param float The timeout
|
* @param timeout The timeout
|
||||||
*/
|
*/
|
||||||
BinLower(float timeout);
|
BinLower(float timeout);
|
||||||
/**
|
/**
|
||||||
|
@ -13,11 +13,10 @@ class RollIn: public Command{
|
|||||||
private:
|
private:
|
||||||
double rawSpeed; //<! Raw speed of the collector
|
double rawSpeed; //<! Raw speed of the collector
|
||||||
public:
|
public:
|
||||||
RollIn();
|
|
||||||
/**
|
/**
|
||||||
* @brief Constructs RollIn
|
* @brief Constructs RollIn
|
||||||
*
|
*
|
||||||
* @param double Speed to roll the collector
|
* @param speed Speed to roll the collector
|
||||||
*/
|
*/
|
||||||
RollIn(double speed);
|
RollIn(double speed);
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,6 @@ RollOut::RollOut(double timeout): Command("RollOut"){
|
|||||||
void RollOut::Initialize(){
|
void RollOut::Initialize(){
|
||||||
}
|
}
|
||||||
void RollOut::Execute(){
|
void RollOut::Execute(){
|
||||||
//TODO check this value to move the motors in the right direction
|
|
||||||
// Divide by 2 twice because this speed should be half the collector speed
|
// Divide by 2 twice because this speed should be half the collector speed
|
||||||
DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8);
|
DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8);
|
||||||
SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftThrottle());
|
SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftThrottle());
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
*/
|
*/
|
||||||
class Lower: public Command{
|
class Lower: public Command{
|
||||||
public:
|
public:
|
||||||
Lower(double timeout=3.0);
|
|
||||||
/**
|
/**
|
||||||
* @brief Constructs Lower
|
* @brief Constructs Lower
|
||||||
*/
|
*/
|
||||||
Lower();
|
Lower(double timeout=3.0);
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the class
|
* @brief Initializes the class
|
||||||
*/
|
*/
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
*/
|
*/
|
||||||
class Raise: public Command{
|
class Raise: public Command{
|
||||||
public:
|
public:
|
||||||
Raise(double timeout=3.5);
|
|
||||||
/**
|
/**
|
||||||
* @brief Constructs Raise
|
* @brief Constructs Raise
|
||||||
*/
|
*/
|
||||||
Raise();
|
Raise(double timeout=3.5);
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the class
|
* @brief Initializes the class
|
||||||
*/
|
*/
|
||||||
|
@ -16,7 +16,7 @@ class CheckDrive: public CommandGroup{
|
|||||||
/**
|
/**
|
||||||
* @brief TODO
|
* @brief TODO
|
||||||
*
|
*
|
||||||
* @param int
|
* @param motorID
|
||||||
*/
|
*/
|
||||||
CheckDrive(int);
|
CheckDrive(int);
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,6 @@ void DentRobot::RobotInit(){
|
|||||||
// If the robot will be picking up three totes in sequence 3
|
// If the robot will be picking up three totes in sequence 3
|
||||||
SmartDashboard::PutBoolean("Two totes", true);
|
SmartDashboard::PutBoolean("Two totes", true);
|
||||||
SmartDashboard::PutBoolean("Three totes", false);
|
SmartDashboard::PutBoolean("Three totes", false);
|
||||||
// TODO: Calibrate the following two values
|
|
||||||
// Distance (in time) to auto zone
|
// Distance (in time) to auto zone
|
||||||
SmartDashboard::PutNumber("Auto Zone Distance", 2.1);
|
SmartDashboard::PutNumber("Auto Zone Distance", 2.1);
|
||||||
// Distance (in time) to auto tote (used in sequence 3)
|
// Distance (in time) to auto tote (used in sequence 3)
|
||||||
@ -43,7 +42,7 @@ void DentRobot::RobotInit(){
|
|||||||
SmartDashboard::PutBoolean("Elevator Bottom", false);
|
SmartDashboard::PutBoolean("Elevator Bottom", false);
|
||||||
SmartDashboard::PutBoolean("Elevator Top", false);
|
SmartDashboard::PutBoolean("Elevator Top", false);
|
||||||
//Drive speed
|
//Drive speed
|
||||||
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2);
|
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
|
||||||
}
|
}
|
||||||
void DentRobot::DisabledPeriodic(){
|
void DentRobot::DisabledPeriodic(){
|
||||||
Scheduler::GetInstance()->Run();
|
Scheduler::GetInstance()->Run();
|
||||||
@ -66,7 +65,7 @@ void DentRobot::TeleopInit(){
|
|||||||
}
|
}
|
||||||
void DentRobot::TeleopPeriodic(){
|
void DentRobot::TeleopPeriodic(){
|
||||||
Scheduler::GetInstance()->Run();
|
Scheduler::GetInstance()->Run();
|
||||||
// TODO: Calibrate 1.0 to the height we want the elevator to automatically raise
|
//TODO: Calibrate 1.0 to the height we want the elevator to automatically raise
|
||||||
if(elevator->GetUseEncoder()&&elevator->GetHeight()<=-1.0){
|
if(elevator->GetUseEncoder()&&elevator->GetHeight()<=-1.0){
|
||||||
// Raise the elevator if it dips below elevatorTop
|
// Raise the elevator if it dips below elevatorTop
|
||||||
oi->raise->Start();
|
oi->raise->Start();
|
||||||
|
@ -24,11 +24,11 @@ class BinElevator{
|
|||||||
/**
|
/**
|
||||||
* @brief Runs the bin elevator
|
* @brief Runs the bin elevator
|
||||||
*
|
*
|
||||||
* @param double The power to run the bin elevator
|
* @param power The power to run the bin elevator
|
||||||
*
|
*
|
||||||
* Ranges from -1.0 to 1.0
|
* Ranges from -1.0 to 1.0
|
||||||
*/
|
*/
|
||||||
void Run(double);
|
void Run(double power);
|
||||||
/**
|
/**
|
||||||
* @brief Sets the encoder value to 0 (unused)
|
* @brief Sets the encoder value to 0 (unused)
|
||||||
*/
|
*/
|
||||||
|
@ -10,12 +10,12 @@ Collector::Collector(): Subsystem("Collector"){
|
|||||||
}
|
}
|
||||||
void Collector::InitDefaultCommand(){
|
void Collector::InitDefaultCommand(){
|
||||||
}
|
}
|
||||||
void Collector::MoveRollers(double a){
|
void Collector::MoveRollers(double power){
|
||||||
collectorMotorLeft->Set(a);
|
collectorMotorLeft->Set(power);
|
||||||
collectorMotorBottom->Set(-a);
|
collectorMotorBottom->Set(-power);
|
||||||
collectorMotorRamp->Set(a);
|
collectorMotorRamp->Set(power);
|
||||||
collectorMotorRight->Set(-a);
|
collectorMotorRight->Set(-power);
|
||||||
printf("Roller power: %f\n", a);
|
printf("Roller power: %f\n", power);
|
||||||
}
|
}
|
||||||
double Collector::GetSonarDistance(){
|
double Collector::GetSonarDistance(){
|
||||||
return sonarAnalog->GetAverageVoltage();
|
return sonarAnalog->GetAverageVoltage();
|
||||||
|
@ -33,9 +33,9 @@ class Collector: public Subsystem{
|
|||||||
/**
|
/**
|
||||||
* @brief Moves the collectors
|
* @brief Moves the collectors
|
||||||
*
|
*
|
||||||
* @param double The speed to run the collectors
|
* @param power The speed to run the collectors
|
||||||
*/
|
*/
|
||||||
void MoveRollers(double);
|
void MoveRollers(double power);
|
||||||
/**
|
/**
|
||||||
* @brief Gets the distance of the sonar (unused)
|
* @brief Gets the distance of the sonar (unused)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,7 @@ void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity,
|
|||||||
double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y);
|
double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y);
|
||||||
double correctZ;
|
double correctZ;
|
||||||
if(driveStraight){
|
if(driveStraight){
|
||||||
|
printf("Driving straight at: %f\n", -gyro->GetAngle()*kP);
|
||||||
correctZ = -gyro->GetAngle()*kP;
|
correctZ = -gyro->GetAngle()*kP;
|
||||||
}else{
|
}else{
|
||||||
correctZ = -z * 0.5;
|
correctZ = -z * 0.5;
|
||||||
|
@ -35,8 +35,8 @@ bool Elevator::GetElevatorTop(){
|
|||||||
SmartDashboard::PutBoolean("Elevator Top", !elevatorTop->Get());
|
SmartDashboard::PutBoolean("Elevator Top", !elevatorTop->Get());
|
||||||
return elevatorTop->Get();
|
return elevatorTop->Get();
|
||||||
}
|
}
|
||||||
void Elevator::SetUseEncoder(bool param){
|
void Elevator::SetUseEncoder(bool use){
|
||||||
useEncoder=param;
|
useEncoder=use;
|
||||||
}
|
}
|
||||||
bool Elevator::GetUseEncoder(){
|
bool Elevator::GetUseEncoder(){
|
||||||
return useEncoder;
|
return useEncoder;
|
||||||
|
@ -25,9 +25,9 @@ class Elevator{
|
|||||||
/**
|
/**
|
||||||
* @brief Runs the elevator
|
* @brief Runs the elevator
|
||||||
*
|
*
|
||||||
* @param double The power to run the bin elevator (-1.0 to 1.0)
|
* @param power The power to run the bin elevator (-1.0 to 1.0)
|
||||||
*/
|
*/
|
||||||
void Run(double);
|
void Run(double power);
|
||||||
/**
|
/**
|
||||||
* @brief Sets the encoder value to 0 (unused)
|
* @brief Sets the encoder value to 0 (unused)
|
||||||
*/
|
*/
|
||||||
@ -59,9 +59,9 @@ class Elevator{
|
|||||||
/**
|
/**
|
||||||
* @brief Use the elevator encoder (unused)
|
* @brief Use the elevator encoder (unused)
|
||||||
*
|
*
|
||||||
* @param bool State to use encoder
|
* @param use State to use encoder
|
||||||
*/
|
*/
|
||||||
void SetUseEncoder(bool);
|
void SetUseEncoder(bool use);
|
||||||
/**
|
/**
|
||||||
* @brief Gets the state of useEncoder (unused)
|
* @brief Gets the state of useEncoder (unused)
|
||||||
*
|
*
|
||||||
|
@ -23,9 +23,9 @@ class Pneumatics: public Subsystem{
|
|||||||
/**
|
/**
|
||||||
* @brief Sets the state of the arms
|
* @brief Sets the state of the arms
|
||||||
*
|
*
|
||||||
* @param bool State of the arms
|
* @param state State of the arms
|
||||||
*/
|
*/
|
||||||
void SetOpen(bool);
|
void SetOpen(bool state);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
// vim: ts=2:sw=2:et
|
// vim: ts=2:sw=2:et
|
||||||
|
Loading…
Reference in New Issue
Block a user