Skip to main content

Joystick Usage Tutorial

Aurora uses a joystick as the default input device. Users can input control commands and switch system states via the joystick.

This tutorial will guide you on how to set up and use a joystick in the Aurora system.

Joystick Initial Setup

  1. Connect your joystick to the computer. Aurora uses the Linux built-in driver joystick.h to read user joystick data. To verify if the device is properly loaded into the system, run the following command in the terminal:

    ls /dev/input

    You should see a device file named js0. Aurora reads joystick data through this device file.

  2. Start Aurora and check the log output. If you don't see the following error messages, it means the joystick is successfully connected to Aurora:

    [error] joystick init fail
    [error] task enter failed: JoyStickTask

    If the above error messages appear, please try redoing the initial setup process.

Joystick Button Introduction

Currently, the Aurora SDK supports two configurations: X-Box and PlayStation. This document uses an X-Box configuration joystick as a template to introduce the various buttons.

Joystick Usage in Aurora

The joystick in Aurora mainly has two functions: switching Aurora states and inputting control commands in specific states.

State Switching

In Aurora, each FSM (Finite State Machine) state corresponds to a specific button combination. The following table shows the joystick button mapping for each FSM state:

State NameJoystick MappingLink
DefaultLB+RBInitial State
Security ProtectionLT+RTSecurity Protection State
Joint StandLB+AJoint Stand State
PdStandLB+BPd Stand State
RL LocomotionRB+ARL Locomotion State

Control Command Input

In the Pd Stand and RL Locomotion states, the joystick can be used to input control commands.

Pd Stand

After the robot enters Pd Stand, use the direction buttons on the joystick to control the robot's standing posture.

  • Press the Up or Down direction buttons to control the robot's base height.
  • Press the Left or Right direction buttons to control the robot's base pitch angle.
  • Press the right joystick's Left or Right to control the robot's base yaw angle.

RL Locomotion

After the robot enters RL Locomotion, use the left and right joysticks to control the robot's walking speed.

  • Left joystick vertical axis: Move forward and backward
  • Left joystick horizontal axis: Move left and right
  • Right joystick horizontal axis: Turn left and right