def __init__(self, liftPos=-27, elevatorPos=-19.5): super().__init__(name="OneClimbG {}: {}".format(liftPos, elevatorPos)) self.addSequential(RaiseLiftElevator(liftPos, elevatorPos), 3) self.addSequential(LiftDrive(-1), 4) self.addSequential(MoveElevator(7)) self.addSequential(ActivateArms(IntakeOutput.Position.DOWN)) self.addParallel(LiftDrive(-1), 3.5) self.addSequential(Move(3.5), 0.3) self.addSequential(WaitCommand(1.0)) self.addParallel(Move(1), 0.1) self.addParallel(MoveLift(2.5)) self.addSequential(LiftDrive(-1), 1)
def build_move(self, text, params, line_num): # Check for proper placement of the words MOVE, TO, and POSTION if (not (params[0] == "MOVE" and params[2] == "TO" and params[3] == "POSITION")): return self.build_error_msg(text, params, line_num, "Syntax Error") # Check if the thing to move is actually LH or RH and not something else if (not params[1] in ["LH", "RH"]): return self.build_error_msg( text, params, line_num, "Unrecognized hand side: " + str(params[1])) # Check if the position to move to is either a number or a position reference if (not (params[4].isdigit() or params[4] in ["LHPOS", "RHPOS", "LHCARD", "RHCARD"])): return self.build_error_msg( text, params, line_num, str(params[4]) + " is not a recognized number or reference") num, num_spec = self.det_number(params[4]) right_hand = (params[1] == "RH") return Move(text, line_num, right_hand, num, num_spec)