def init(): print('Subsystems init called') ''' Creates all subsystems. You must run this before any commands are instantiated. Do not run it more than once. ''' global driveline global drivelift global elevator global ramp global cargograb global hatchgrab ''' Some tests call startCompetition multiple times, so don't throw an error if called more than once in that case. ''' if (driveline) is not None and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') driveline = TankDrive() drivelift = TankLift() elevator = Elevator() ramp = Ramp() cargograb = CargoGrab() hatchgrab = HatchGrab()
def robotInit(self): '''Initialize all subsystems.''' self.drivetrain = DriveTrain(self) self.puncher = Puncher() self.claw = Claw() self.arm = Arm() self.intake = Intake() self.elevator = Elevator() self.hatch = Hatch() self.intake_winch = IntakeWinch() self.oi = OI(self)
def robotInit(self): '''Initialize all subsystems.''' self.drivetrain = DriveTrain(self) self.rear_puncher = RearPuncher() self.arm = Arm() self.intake = Intake() self.elevator = Elevator() self.hatch = Hatch() self.intake_winch = IntakeWinch() self.lift = Lift() # The "front" of the robot (which end is facing forward) self.front = -1 self.oi = OI(self)
def robotInit(self): """This function is run when the robot is first started up and should be used for any initialization code.""" self.drivetrain = DriveTrain(self) self.elevator = Elevator(self) self.wrist = Wrist(self) self.claw = Claw() self.oi = OI(self) # instantiate the command used for the autonomous period self.autonomousCommand = Autonomous(self) # Show what command your subsystem is running on the SmartDashboard wpilib.SmartDashboard.putData(self.drivetrain) wpilib.SmartDashboard.putData(self.elevator) wpilib.SmartDashboard.putData(self.wrist) wpilib.SmartDashboard.putData(self.claw)
def robotInit(self): """ This function is called upon program startup and should be used for any initialization code. """ self.pneumaticControlModuleCANID = robotmap.PCM self.kDriveTrain = robotmap.DriveTrain self.kCubeGrabber = robotmap.CubeGrabber self.kElevator = robotmap.Elevator self.kSticks = robotmap.Sticks self.kClimber = robotmap.Climber self.dStick = Joystick(self.kSticks['drive']) self.cStick = Joystick(self.kSticks['control']) self.drive = Drive(self) self.cubeGrabber = cubeGrabber(self) self.elevator = Elevator(self) self.climber = Climber(self) self.sendableChooser()
def robotInit(self): """ This is a good place to set up your subsystems and anything else that you will need to access later. """ # All commands can get access to the subsystems here subsystems.LEDS = LEDs() subsystems.DRIVETRAIN = Drivetrain() subsystems.ELEVATOR = Elevator() subsystems.PAYLOAD = Payload() subsystems.SERIAL = SerialEvent() subsystems.PIGEON = Pigeon() self.compressor = wpilib.Compressor(0) self.compressor.setClosedLoopControl(True) #self.compressor.start() """ Since OI instantiates commands and commands need access to subsystems, OI must be initialized after subsystems. """ subsystems.JOYSTICK = oi.get_joystick() wpilib.CameraServer.launch()