Public Member Functions | |
| MecaDrive (int frontLeftMotorPort, int frontRightMotorPort, int rearLeftMotorPort, int rearRightMotorPort, IMU imu) | |
| void | drive (double speedX, double speedY, double rotateSpeed) |
| void | printControlsOfCurrentMode () |
| Prints the controls of the current driving mode. | |
| void | cycleMotor () |
| Cycle between each motor during debug mode. | |
| void | printActiveMotorDebugMode () |
| prints the number of the currently activated motors during debug mode | |
| void | periodic () |
| void | updateOdometry () |
| Pose2d | getPose () |
| Returns the currently-estimated pose of the robot. | |
| double | getOdomX () |
| double | getOdomY () |
| double | getOdomHeading () |
| void | resetOdometry (Pose2d pose) |
| Resets the odometry to the specified pose. | |
Public Member Functions inherited from frc.robot.subsystems.DriveBase | |
| void | drive (double leftAnalogX, double leftAnalogY, double rightAnalogX, double rightAnalogY) |
| Drive the robot with controller input. | |
| void | drive (double leftAnalogX, double leftAnalogY, double rightAnalogX) |
| abstract void | printControlsOfCurrentMode () |
| Prints the controls of the current driving mode. | |
| void | increaseSpeedBracket () |
| The speed bracket controls the multiplier for al the speeds So when you change it, lets say, to 1/2 speed, all movement will be at 1/2 speed. | |
| void | decreaseSpeedBracket () |
| void | turnOnDefaultMode () |
| void | turnOnDebugMode () |
| void | turnOnStopMode () |
| should be overridden for actual functionality because depends on drive base specifc speeds (for tank drive, there is a left and right speed, whereas for mecanum there are 4) | |
| void | turnONPIDTuningMode () |
| abstract void | cycleMotor () |
| Needs to be implemented in sub classes becuase there might be different numbers of motors. | |
| void | AButtonPressed () |
| void | BButtonPressed () |
| void | XButtonPressed () |
| void | YButtonPressed () |
| void | leftBumperPressed () |
| void | rightBumperPressed () |
| Mode | getCurrentMode () |
| void | setCurrentMode (Mode currentMode) |
| int | getDebugEnabledMotor () |
| void | setDebugEnabledMotor (int debugEnabledMotor) |
| Trajectory | getCurrentTrajectory () |
| void | setCurrentTrajectory (Trajectory currentTrajectory) |
| TrajectoryConfig | getTrajectoryConfig () |
| RamseteController | getChassisController () |
| double | getCurrentTrajectoryTime () |
| void | resetCurrentTrajectoryTime () |
| void | incrementCurrentTrajectoryTime () |
Private Member Functions | |
| double | slowDown (double inputVelocity) |
| This will return a value lower than the input, and it is used to slow down the motors during stop mode. | |
| double | convertPosition (double rawPosition) |
| Converts raw position units to meters. | |
| double | convertVelocity (double rawVelocity) |
| Converts raw sensor velocity to meters/second. | |
Additional Inherited Members | |
Protected Attributes inherited from frc.robot.subsystems.DriveBase | |
| TrajectoryConfig | trajectoryConfig |
Definition at line 19 of file MecaDrive.java.
| frc.robot.subsystems.MecaDrive.MecaDrive | ( | int | frontLeftMotorPort, |
| int | frontRightMotorPort, | ||
| int | rearLeftMotorPort, | ||
| int | rearRightMotorPort, | ||
| IMU | imu | ||
| ) |
Definition at line 40 of file MecaDrive.java.
References frc.robot.Constants.maxAccelerationMetersPerSecond, frc.robot.Constants.maxVelocityMetersPerSecond, frc.robot.Constants.MECANUM_KINEMATICS, and frc.robot.subsystems.DriveBase.trajectoryConfig.
|
private |
Converts raw position units to meters.
| rawPosition | the position from an encoder in raw sensor units |
Definition at line 203 of file MecaDrive.java.
References frc.robot.Constants.FALCON_GEARBOX_RATIO, and frc.robot.Constants.MECANUM_WHEEL_DIAMETER.
|
private |
Converts raw sensor velocity to meters/second.
| rawVelocity | the velocity from an encoder in raw sensor units |
Definition at line 232 of file MecaDrive.java.
References frc.robot.Constants.FALCON_GEARBOX_RATIO, and frc.robot.Constants.MECANUM_WHEEL_DIAMETER.
| void frc.robot.subsystems.MecaDrive.cycleMotor | ( | ) |
Cycle between each motor during debug mode.
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 170 of file MecaDrive.java.
Referenced by frc.robot.Robot.checkForButtonPresses().
| void frc.robot.subsystems.MecaDrive.drive | ( | double | speedX, |
| double | speedY, | ||
| double | rotateSpeed | ||
| ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 76 of file MecaDrive.java.
References frc.robot.subsystems.MecaDrive.slowDown().
Referenced by frc.robot.subsystems.Autonomous.applyChassisSpeeds(), frc.robot.Robot.autonomousPeriodic(), and frc.robot.Robot.drive().
| double frc.robot.subsystems.MecaDrive.getOdomHeading | ( | ) |
Definition at line 270 of file MecaDrive.java.
Referenced by frc.robot.subsystems.BetterShuffleboard.pushOdom().
| double frc.robot.subsystems.MecaDrive.getOdomX | ( | ) |
Definition at line 262 of file MecaDrive.java.
Referenced by frc.robot.subsystems.BetterShuffleboard.pushOdom().
| double frc.robot.subsystems.MecaDrive.getOdomY | ( | ) |
Definition at line 266 of file MecaDrive.java.
Referenced by frc.robot.subsystems.BetterShuffleboard.pushOdom().
| Pose2d frc.robot.subsystems.MecaDrive.getPose | ( | ) |
Returns the currently-estimated pose of the robot.
Definition at line 258 of file MecaDrive.java.
Referenced by frc.robot.Robot.autonomousCheckForButtonPresses(), frc.robot.subsystems.Autonomous.getChassisSpeeds(), and frc.robot.subsystems.Autonomous.updateTrajectory().
| void frc.robot.subsystems.MecaDrive.periodic | ( | ) |
Definition at line 190 of file MecaDrive.java.
| void frc.robot.subsystems.MecaDrive.printActiveMotorDebugMode | ( | ) |
prints the number of the currently activated motors during debug mode
Definition at line 181 of file MecaDrive.java.
Referenced by frc.robot.Robot.checkForButtonPresses().
| void frc.robot.subsystems.MecaDrive.printControlsOfCurrentMode | ( | ) |
Prints the controls of the current driving mode.
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 142 of file MecaDrive.java.
| void frc.robot.subsystems.MecaDrive.resetOdometry | ( | Pose2d | pose | ) |
Resets the odometry to the specified pose.
| pose | The pose to which to set the odometry. |
Definition at line 283 of file MecaDrive.java.
|
private |
This will return a value lower than the input, and it is used to slow down the motors during stop mode.
| inputVelocity | between -1 and 1 (double) |
Definition at line 130 of file MecaDrive.java.
References frc.robot.Constants.SLOW_DOWN_CUTOFF, and frc.robot.Constants.SLOW_DOWN_FACTOR.
Referenced by frc.robot.subsystems.MecaDrive.drive().
| void frc.robot.subsystems.MecaDrive.updateOdometry | ( | ) |
Definition at line 194 of file MecaDrive.java.
References frc.robot.subsystems.IMU.getHeading().
Referenced by frc.robot.Robot.robotPeriodic().