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
-
Connect your joystick to the computer. Aurora uses the Linux built-in driver
joystick.hto read user joystick data. To verify if the device is properly loaded into the system, run the following command in the terminal:ls /dev/inputYou should see a device file named
js0. Aurora reads joystick data through this device file. -
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: JoyStickTaskIf 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 Name | Joystick Mapping | Link |
|---|---|---|
| Default | LB+RB | Initial State |
| Security Protection | LT+RT | Security Protection State |
| Joint Stand | LB+A | Joint Stand State |
| PdStand | LB+B | Pd Stand State |
| RL Locomotion | RB+A | RL 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
UporDowndirection buttons to control the robot's base height. - Press the
LeftorRightdirection buttons to control the robot's base pitch angle. - Press the right joystick's
LeftorRightto control the robot's base yaw angle.
RL Locomotion
After the robot enters RL Locomotion, use the left and right rocker 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