def init(): global drive if drive is not None and not RobotBase.isSimulation(): raise RuntimeError("Subsystems already init'ed") drive = Nomad()
def init(): """ instansiates all subsystems. Needs to be a method so it isn't ran on import """ global tankdrive global sensors global arm global smartdashboard global infotable global is_init """ Some tests call startCompetition multiple times, so don't throw an error if called more than once in that case. """ if is_init and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') if is_init: return is_init = True tankdrive = TankDrive() sensors = Sensors() arm = Arm() smartdashboard = NetworkTables.getTable('SmartDashboard') infotable = NetworkTables.getTable('info')
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 init(): global drive if drive is not None and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') drive = Drive(robotmap.motors.L0, robotmap.motors.L1, robotmap.motors.R0, robotmap.motors.R1)
def init(): global drive, oi if oi is not None and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') drive = Drive() oi = OI()
def init(): ''' Creates all subsystems. You must run this before any commands are instantiated. Do not run it more than once. ''' global motor ''' Some tests call startCompetition multiple times, so don't throw an error if called more than once in that case. ''' if motor is not None and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') motor = SingleMotor()
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 ''' 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()
def init(): ''' Creates all subsystems. You must run this before any commands are instantiated. Do not run it more than once. ''' global drive, move ''' Some tests call startCompetition multiple times, so don't throw an error if called more than once in that case. ''' if (drive is not None) and (move is not None) and not RobotBase.isSimulation(): raise RuntimeError('Subsystems have already been initialized') drive = MechenumDrive() move = MechenumMove();
def init(): """ Creates all subsystems. You must run this before any commands are instantiated. Do not run it more than once. """ global motors, gear_mech, climbing_mech, dumper ''' Some tests call startCompetition multiple times, so don't throw an error if called more than once in that case. ''' if motors is not None and not RobotBase.isSimulation(): # pragma: no cover raise RuntimeError('Subsystems have already been initialized') motors = Motors() gear_mech = GearMech() climbing_mech = ClimbingMech() dumper = Dumper()