def initialize(self): """ Read in and apply current drive choices. """ DriveHuman.setupDashboardControls() global modeChooser self.mode = modeChooser.getSelected() self.quickTurn = SmartDashboard.getBoolean("Quick Turn", self.quickTurn) self.squareInputs = SmartDashboard.getBoolean("Square Inputs", self.squareInputs) self.fixedLeft = SmartDashboard.getNumber("Fixed Left", self.fixedLeft) self.fixedRight = SmartDashboard.getNumber("Fixed Right", self.fixedRight) self.rotationGain = SmartDashboard.getNumber("Rotation Gain", self.rotationGain) self.slowGain = SmartDashboard.getNumber("Slow Gain", self.slowGain)
def _update_sd(self): SmartDashboard.putNumber("Left Encoder Position", self.left_talon0.getEncPosition()) SmartDashboard.putNumber("Right Encoder Position", self.right_talon0.getEncPosition()) SmartDashboard.putNumber("heading", self.get_gyro_angle()) self.reversed = SmartDashboard.getBoolean("Reversed", False) self.turn_controller.setPID(self.turning_P.value, self.turning_I.value, self.turning_D.value, 0)
def approach(self, state_tm): if SmartDashboard.getBoolean("Vision/Found Hook"): self.next_state('found_hook') else: if state_tm < self.forward_time: self.drive.arcade_drive(0, 0.25) else: self.next_state('stop')
def LeftStickX(self): creep_mode = SmartDashboard.getBoolean("Creep", False) if creep_mode: return self.conditonAxis( self.getRawAxis(robotmap.XBOX_LEFT_X_AXIS), self.creep_x_deadband, self.creep_x_rate, self.creep_x_expo, self.creep_x_power, self.creep_x_min, self.creep_x_max) else: return self.conditonAxis( self.getRawAxis(robotmap.XBOX_LEFT_X_AXIS), self.left_x_deadband, self.left_x_rate, self.left_x_expo, self.left_x_power, self.left_x_min, self.left_x_max)
def reverse(self): SmartDashboard.putBoolean("Reversed", not SmartDashboard.getBoolean("Reversed", False))