[romi] Update Romi for parity with XRP (#7389)

This commit is contained in:
Kavin Muralikrishnan
2024-11-16 10:24:58 -05:00
committed by GitHub
parent 6eb652e10e
commit 1e545c38a8
11 changed files with 141 additions and 60 deletions

View File

@@ -15,6 +15,12 @@ class AutonomousDistance
: public frc2::CommandHelper<frc2::SequentialCommandGroup,
AutonomousDistance> {
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),

View File

@@ -14,6 +14,14 @@
class AutonomousTime
: public frc2::CommandHelper<frc2::SequentialCommandGroup, AutonomousTime> {
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));

View File

@@ -12,6 +12,14 @@
class DriveDistance : public frc2::CommandHelper<frc2::Command, DriveDistance> {
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 distance The distance 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);

View File

@@ -13,6 +13,14 @@
class DriveTime : public frc2::CommandHelper<frc2::Command, DriveTime> {
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);

View File

@@ -14,6 +14,14 @@
class TeleopArcadeDrive
: public frc2::CommandHelper<frc2::Command, TeleopArcadeDrive> {
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<double()> xaxisSpeedSupplier,
std::function<double()> zaxisRotateSupplier);

View File

@@ -13,6 +13,14 @@
class TurnDegrees : public frc2::CommandHelper<frc2::Command, TurnDegrees> {
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 degrees 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);

View File

@@ -13,6 +13,13 @@
class TurnTime : public frc2::CommandHelper<frc2::Command, TurnTime> {
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);