コード例 #1
0
def lock_carriage_move_elevator(speed: float) -> InstantCommand:
    def move():
        RobotMap.lifter_component.set_carriage_speed(-1)
        RobotMap.lifter_component.set_elevator_speed(speed)

    return InstantCommand(move)
コード例 #2
0
def move_down_instant() -> InstantCommand:
    target_position = LifterComponent.positions[
        RobotMap.lifter_component.prev_position()]
    return InstantCommand(
        lambda: RobotMap.lifter_component.lift_to_distance(target_position))
コード例 #3
0
def toggle_spread() -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.toggle_spread_state())
コード例 #4
0
def move_to_position_instant(position: str) -> InstantCommand:
    return InstantCommand(lambda: RobotMap.lifter_component.lift_to_distance(
        LifterComponent.positions[position]))
コード例 #5
0
def spread() -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.set_spread_state(True))
コード例 #6
0
def close() -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.set_spread_state(False))
コード例 #7
0
def stop() -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.set_motor_speeds(0, 0))
コード例 #8
0
def move_left_right(speed: float) -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.set_motor_speeds(speed, speed))
コード例 #9
0
def spit() -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.gripper_component.set_motor_speeds(-1, -1))
コード例 #10
0
def stop() -> InstantCommand:
    return InstantCommand(lambda: RobotMap.climb_component.stop())
コード例 #11
0
def set_low_gear() -> InstantCommand:
    return InstantCommand(RobotMap.driver_component.set_low_gear)
コード例 #12
0
def curve_drive(linear: float, angular: float) -> InstantCommand:
    return InstantCommand(
        lambda: RobotMap.driver_component.set_curve(linear, angular))
コード例 #13
0
def toggle_gear() -> InstantCommand:
    return InstantCommand(RobotMap.driver_component.toggle_gear)