diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.h index 8991ce60fe5..ef01bc4e679 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.h @@ -15,6 +15,12 @@ class AutonomousDistance : public frc2::CommandHelper { public: + /** + * Creates a new Autonomous Drive based on distance. This will drive out for a + * specified distance, turn around and drive back. + * + * @param drive The drivetrain subsystem on which this command will run + */ explicit AutonomousDistance(Drivetrain* drive) { AddCommands( DriveDistance(-0.5, 10_in, drive), TurnDegrees(-0.5, 180_deg, drive), diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.h index e25e5ea3af9..1666d47322f 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.h @@ -14,6 +14,14 @@ class AutonomousTime : public frc2::CommandHelper { public: + /** + * Creates a new Autonomous Drive based on time. This will drive out for a + * period of time, turn around for time (equivalent to time to turn around) + * and drive forward again. This should mimic driving out, turning around and + * driving back. + * + * @param drive The drive subsystem on which this command will run + */ explicit AutonomousTime(Drivetrain* drive) { AddCommands(DriveTime(-0.6, 2_s, drive), TurnTime(-0.5, 1.3_s, drive), DriveTime(-0.6, 2_s, drive), TurnTime(0.5, 1.3_s, drive)); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.h index 60115314010..41c5c12f72c 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.h @@ -12,6 +12,14 @@ class DriveDistance : public frc2::CommandHelper { public: + /** + * Creates a new DriveDistance. This command will drive your your robot for a + * desired distance at a desired speed. + * + * @param speed The speed at which the robot will drive + * @param inches The number of inches the robot will drive + * @param drive The drivetrain subsystem on which this command will run + */ DriveDistance(double speed, units::meter_t distance, Drivetrain* drive) : m_speed(speed), m_distance(distance), m_drive(drive) { AddRequirements(m_drive); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.h index 9dfd240447e..58753924f08 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.h @@ -13,6 +13,14 @@ class DriveTime : public frc2::CommandHelper { public: + /** + * Creates a new DriveTime. This command will drive your robot for a desired + * speed and time. + * + * @param speed The speed which the robot will drive. Negative is in reverse. + * @param time How much time to drive + * @param drive The drivetrain subsystem on which this command will run + */ DriveTime(double speed, units::second_t time, Drivetrain* drive) : m_speed(speed), m_duration(time), m_drive(drive) { AddRequirements(m_drive); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.h index fe2e2410287..c2c35b7d4b9 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.h @@ -14,6 +14,14 @@ class TeleopArcadeDrive : public frc2::CommandHelper { public: + /** + * Creates a new ArcadeDrive. This command will drive your robot according to + * the speed suppliers. This command does not terminate. + * + * @param drivetrain The drivetrain subsystem on which this command will run + * @param xaxisSpeedSupplier Supplier of forward/backward speed + * @param zaxisRotateSupplier Supplier of rotational speed + */ TeleopArcadeDrive(Drivetrain* subsystem, std::function xaxisSpeedSupplier, std::function zaxisRotateSupplier); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.h index c0f25b19002..e903c4dc83d 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.h @@ -13,6 +13,14 @@ class TurnDegrees : public frc2::CommandHelper { public: + /** + * Creates a new TurnDegrees. This command will turn your robot for a desired + * rotation (in degrees) and rotational speed. + * + * @param speed The speed which the robot will drive. Negative is in reverse. + * @param angle Degrees to turn. Leverages encoders to compare distance. + * @param drive The drive subsystem on which this command will run + */ TurnDegrees(double speed, units::degree_t angle, Drivetrain* drive) : m_speed(speed), m_angle(angle), m_drive(drive) { AddRequirements(m_drive); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.h index 3c478a834db..28a7b5fea74 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.h @@ -13,6 +13,13 @@ class TurnTime : public frc2::CommandHelper { public: + /** + * Creates a new TurnTime. + * + * @param speed The speed which the robot will turn. Negative is in reverse. + * @param time How much time to turn + * @param drive The drive subsystem on which this command will run + */ TurnTime(double speed, units::second_t time, Drivetrain* drive) : m_speed(speed), m_duration(time), m_drive(drive) { AddRequirements(m_drive); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.h b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.h index 050988e8821..5a5c550861f 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.h +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.h @@ -79,32 +79,44 @@ class Drivetrain : public frc2::SubsystemBase { units::meter_t GetAverageDistance(); /** - * Returns the acceleration along the X-axis, in m/s². + * The acceleration in the X-axis. + * + * @return The acceleration of the XRP along the X-axis. */ units::meters_per_second_squared_t GetAccelX(); /** - * Returns the acceleration along the Y-axis, in m/s². + * The acceleration in the Y-axis. + * + * @return The acceleration of the XRP along the Y-axis. */ units::meters_per_second_squared_t GetAccelY(); /** - * Returns the acceleration along the Z-axis, in m/s². + * The acceleration in the Z-axis. + * + * @return The acceleration of the XRP along the Z-axis. */ units::meters_per_second_squared_t GetAccelZ(); /** - * Returns the current angle of the Romi around the X-axis, in degrees. + * Current angle of the XRP around the X-axis. + * + * @return The current angle of the XRP. */ units::radian_t GetGyroAngleX(); /** - * Returns the current angle of the Romi around the Y-axis, in degrees. + * Current angle of the XRP around the Y-axis. + * + * @return The current angle of the XRP. */ units::radian_t GetGyroAngleY(); /** - * Returns the current angle of the Romi around the Z-axis, in degrees. + * Current angle of the XRP around the Z-axis. + * + * @return The current angle of the XRP. */ units::radian_t GetGyroAngleZ();