|
Maurice 2025
Team 668's robot for Reefscape
|
Public Member Functions | |
| None | __init__ (self, type drive_motor_type, type steer_motor_type, type encoder_type, swerve.SwerveDrivetrainConstants drivetrain_constants, list[swerve.SwerveModuleConstants] modules) |
| Command | apply_request (self, Callable[[], swerve.requests.SwerveRequest] request) |
| periodic (self) | |
| slowly (self, bool do) | |
| Command | sys_id_dynamic (self, SysIdRoutine.Direction direction) |
| Command | sys_id_quasistatic (self, SysIdRoutine.Direction direction) |
Public Attributes | |
| autonpid | |
| reset_pose | |
| bool | slow = False |
Protected Member Functions | |
| _configure_auto_builder (self) | |
| _start_sim_thread (self) | |
Protected Attributes | |
| _apply_robot_speeds = swerve.requests.ApplyRobotSpeeds() | |
| bool | _has_applied_operator_perspective = False |
| units.second | _last_sim_time = 0.0 |
| _rotation_characterization = swerve.requests.SysIdSwerveRotation() | |
| Notifier|None | _sim_notifier = None |
| _steer_characterization = swerve.requests.SysIdSwerveSteerGains() | |
| _sys_id_routine_rotation | |
| _sys_id_routine_steer | |
| _sys_id_routine_to_apply = self._sys_id_routine_translation | |
| _sys_id_routine_translation | |
| _translation_characterization = swerve.requests.SysIdSwerveTranslation() | |
Static Protected Attributes | |
| _BLUE_ALLIANCE_PERSPECTIVE_ROTATION = Rotation2d.fromDegrees(0) | |
| _RED_ALLIANCE_PERSPECTIVE_ROTATION = Rotation2d.fromDegrees(180) | |
| units | _SIM_LOOP_PERIOD = 0.005 |
Class that extends the Phoenix 6 SwerveDrivetrain class and implements Subsystem so it can easily be used in command-based projects.
| None __init__ | ( | self, | |
| type | drive_motor_type, | ||
| type | steer_motor_type, | ||
| type | encoder_type, | ||
| swerve.SwerveDrivetrainConstants | drivetrain_constants, | ||
| list[swerve.SwerveModuleConstants] | modules ) |
Constructs a CTRE SwerveDrivetrain using the specified constants. This constructs the underlying hardware devices, so users should not construct the devices themselves. If they need the devices, they can access them through getters in the classes. :param drive_motor_type: Type of the drive motor :type drive_motor_type: type :param steer_motor_type: Type of the steer motor :type steer_motor_type: type :param encoder_type: Type of the azimuth encoder :type encoder_type: type :param drivetrain_constants: Drivetrain-wide constants for the swerve drive :type drivetrain_constants: swerve.SwerveDrivetrainConstants :param modules: Constants for each specific module :type modules: list[swerve.SwerveModuleConstants]
|
protected |
|
protected |
| Command apply_request | ( | self, | |
| Callable[[], swerve.requests.SwerveRequest] | request ) |
Returns a command that applies the specified control request to this swerve drivetrain. :param request: Lambda returning the request to apply :type request: Callable[[], swerve.requests.SwerveRequest] :returns: Command to run :rtype: Command
| periodic | ( | self | ) |
| slowly | ( | self, | |
| bool | do ) |
| Command sys_id_dynamic | ( | self, | |
| SysIdRoutine.Direction | direction ) |
Runs the SysId Dynamic test in the given direction for the routine specified by self.sys_id_routine_to_apply. :param direction: Direction of the SysId Dynamic test :type direction: SysIdRoutine.Direction :returns: Command to run :rtype: Command
| Command sys_id_quasistatic | ( | self, | |
| SysIdRoutine.Direction | direction ) |
Runs the SysId Quasistatic test in the given direction for the routine specified by self.sys_id_routine_to_apply. :param direction: Direction of the SysId Quasistatic test :type direction: SysIdRoutine.Direction :returns: Command to run :rtype: Command
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| autonpid |
| reset_pose |
| bool slow = False |