north_c9.joysticks¶
-
class
north_c9.joysticks.N9Joystick(controller: north_c9.controller.C9Controller, velocity: int = 40000, acceleration: int = 100000, moving: bool = False, ignore_missing_joystick: bool = False, z_offset: float = 170.0, use_thread: bool = True, joystick_names: List[str] = ['Wireless Controller', 'PS4 Controller'])¶ Bases:
north_utils.mixins.RunnableAllows the North Robotics C9 to be controlled with a joystick. The C9Controller class creates an N9Joystick instance that can be used to capture positions and control the N9. It can be started with:
>>> from north_c9.controller import C9Controller
>>> c9 = C9Controller()
>>> c9.joystick.start_moving()
-
COLUMN_AXIS= 3¶
-
ELBOW_AXIS= 1¶
-
GRIPPER_AXIS= 0¶
-
GRIPPER_OUTPUT= 0¶
-
PROBE_OUTPUT= 1¶
-
SHOULDER_AXIS= 2¶
-
X_AXIS= 1¶
-
Y_AXIS= 2¶
-
Z_AXIS= 3¶
-
axis_value(value: float) → float¶
-
static
find_joystick_name(names: List[str]) → str¶
-
get_current_position()¶
-
mappings= {0: <function N9Joystick.on_x_axis>, 1: <function N9Joystick.on_y_axis>, 3: <function N9Joystick.on_z_axis>, 4: <function N9Joystick.on_gripper_right_axis>, 5: <function N9Joystick.on_gripper_left_axis>, 150: <function N9Joystick.on_precise_x_axis_map>, 151: <function N9Joystick.on_precise_y_axis_map>, 200: <function N9Joystick.on_probe_toggle_button>, 201: <function N9Joystick.on_gripper_toggle_button>, 202: <function N9Joystick.on_spin_gripper_button>, 203: <function N9Joystick.on_elbow_swap_button>, 204: <function N9Joystick.on_slow_speed_button>, 205: <function N9Joystick.on_high_speed_button>, 208: <function N9Joystick.on_playback_mode_button>, 209: <function N9Joystick.on_record_button>, 212: <function N9Joystick.on_stop_button>, 213: <function N9Joystick.on_gripper_mode_button>}¶
-
on_gripper_left_axis(value: float)¶
-
on_gripper_precise_axis(value: float)¶
-
on_gripper_right_axis(value: float)¶
-
on_precise_x_axis_map(value: float)¶
-
on_precise_y_axis_map(value: float)¶
-
on_x_axis(value: float)¶
-
on_x_precise_axis(value: float)¶
-
on_y_axis(value: float)¶
-
on_y_precise_axis(value: float)¶
-
on_z_axis(value: float)¶
-
on_z_precise_axis(value: float)¶
-
record_position(message: str, use_probe: bool = False) → north_utils.location.Vector3¶
-
record_position_vector(message: str, use_probe: bool = False) → north_utils.location.Vector3¶
-
record_z(message, offset=None, use_probe: bool = False)¶
-
record_z_offset(message: str = 'Drive the robot until the laser is focused to a point on the deck and press Record / Start', use_probe: bool = False)¶
-
run()¶
-
start()¶
-
start_moving(pause_main_controller: bool = False)¶
-
stop()¶
-
stop_driving()¶
-
stop_moving()¶
-
tick()¶
-
update_current_position()¶
-
wrap_handler(handler)¶
-
-
exception
north_c9.joysticks.N9JoystickError¶ Bases:
Exception