Maurice 2025
Team 668's robot for Reefscape
Loading...
Searching...
No Matches
RobotContainer Class Reference

Public Member Functions

None __init__ (self)
 
None configureButtonBindings (self)
 
commands2.Command getAutonomousCommand (self)
 

Public Attributes

 arm
 
 autoChooser = AutoBuilder.buildAutoChooser()
 
 climb = Climb()
 
 configController = commands2.button.CommandXboxController(constants.Global.kConfigControllerPort)
 
tuple drive
 
 driverController = commands2.button.CommandXboxController(constants.Global.kDriverControllerPort)
 
 elevator
 
 grabber = Grabber()
 
 limelight = Limelight(self.robotDrive)
 
 logger = Telemetry(constants.Global.max_speed)
 
 operatorController = commands2.button.CommandXboxController(constants.Global.kOperatorControllerPort)
 
 robotDrive
 
 score
 
 slewRateT = SlewRateLimiter(2, -3)
 
 slewRateX = SlewRateLimiter(2, -3)
 
 slewRateY = SlewRateLimiter(2, -3)
 
 wrist
 

Detailed Description

This class is where the bulk of the robot should be declared. Since Command-based is a
"declarative" paradigm, very little robot logic should actually be handled in the :class:`.Robot`
periodic methods (other than the scheduler calls). Instead, the structure of the robot (including
subsystems, commands, and button mappings) should be declared here.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)
The container for the robot. Contains subsystems, OI devices, and commands.

Member Function Documentation

◆ configureButtonBindings()

None configureButtonBindings ( self)
Use this method to define your button->command mappings. Buttons can be created via the button
factories on commands2.button.CommandGenericHID or one of its
subclasses (commands2.button.CommandJoystick or command2.button.CommandXboxController).

◆ getAutonomousCommand()

commands2.Command getAutonomousCommand ( self)
Use this to pass the autonomous command to the main :class:`.Robot` class.

:returns: the command to run in autonomous

Member Data Documentation

◆ arm

arm
Initial value:
= PositionalSubsystem(
"arm",
motorID=constants.Arm.id,
motorConfig=constants.Arm.config,
encoderID=constants.Arm.encoder,
encoderConfig=constants.Arm.encoderConfig,
sysidConf=constants.Arm.sysidConf,
limitWaitingDistance=3,
initialTarget=90
)

◆ autoChooser

autoChooser = AutoBuilder.buildAutoChooser()

◆ climb

climb = Climb()

◆ configController

configController = commands2.button.CommandXboxController(constants.Global.kConfigControllerPort)

◆ drive

tuple drive
Initial value:
= (
swerve.requests.FieldCentric()
.with_deadband(constants.Global.max_speed * 0.1)
.with_rotational_deadband(
rotationsToRadians(0.75) * 0.1
) # Add a 10% deadband
.with_drive_request_type(
swerve.SwerveModule.DriveRequestType.OPEN_LOOP_VOLTAGE
) # Use open-loop control for drive motors
)

◆ driverController

driverController = commands2.button.CommandXboxController(constants.Global.kDriverControllerPort)

◆ elevator

elevator
Initial value:
= PositionalSubsystem(
"elevate",
motorID=constants.Elevator.mainMotorId,
followerID=constants.Elevator.othrMotorId,
motorConfig=constants.Elevator.config,
conversionRate=constants.Elevator.turnsPerInch,
sysidConf=constants.Elevator.sysidConf,
initialTarget=1,
limitWaitingDistance=1
)

◆ grabber

grabber = Grabber()

◆ limelight

limelight = Limelight(self.robotDrive)

◆ logger

◆ operatorController

operatorController = commands2.button.CommandXboxController(constants.Global.kOperatorControllerPort)

◆ robotDrive

robotDrive
Initial value:
= CommandSwerveDrivetrain(
hardware.TalonFX,
hardware.TalonFX,
hardware.CANcoder,
constants.TunerConstants.drivetrain_constants,
[ constants.TunerConstants.front_left, constants.TunerConstants.front_right, constants.TunerConstants.back_left, constants.TunerConstants.back_right ],
)

◆ score

score
Initial value:
= Score(
elevator=self.elevator,
arm=self.arm,
wrist=self.wrist,
grabber=self.grabber
)

◆ slewRateT

slewRateT = SlewRateLimiter(2, -3)

◆ slewRateX

slewRateX = SlewRateLimiter(2, -3)

◆ slewRateY

slewRateY = SlewRateLimiter(2, -3)

◆ wrist

wrist
Initial value:
= PositionalSubsystem(
"wrist",
motorID=constants.Wrist.id,
motorConfig=constants.Wrist.config,
conversionRate=constants.Wrist.gearRatio/360,
encoderID=constants.Wrist.encoder,
initialPosition=0.0,
encoderConfig=constants.Wrist.encoderConfig,
sysidConf=constants.Wrist.sysidConf,
limitWaitingDistance=3,
positionSetErrorBounds=5
)

The documentation for this class was generated from the following file: