Skip to main content

Quick Start (Simulation)

This article introduces the quick start process for controlling the robot in simulation using the Fourier Aurora SDK.


Environment Dependencies

Simulation development can be carried out on an external PC. Our development environment is provided as a Docker image, so Docker must be installed. If Docker is not installed, please refer to the official Docker installation guide: Get Docker.


Install Aurora Service

First, you need to install the Aurora service on your PC. We provide a Docker image for easy installation. For detailed Aurora installation instructions, see the Installation Guide.


Download Fourier Aurora SDK

Run the following command:

git clone https://github.com/FFTAI/fourier_aurora_sdk.git

Connect Joystick

Connect your joystick to the computer. Aurora uses the Linux built-in driver joystick.h to read user joystick data. To verify that the device has been correctly 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.

For more information on joystick usage, please refer to the Joystick Tutorial.

Start the Container

You can start the container by running the following command in a terminal at the root directory of the repository. If necessary, modify the Docker image in docker_run.bash. You may need to use the (sudo) docker images command to check the available Docker images on your system.

(sudo) bash docker_run.bash

Note: Please ensure you have the correct Docker image. For details, refer to the Installation Guide.

Start MuJoCo Simulation

For simulation, you need to open another terminal and use the following command to enter the container you just started:

(sudo) docker exec -it fourier_aurora_server bash

Then, you need to start the simulation environment by running the following command:

python3 sim/start_simulate_root.py

After running, operation prompts will appear in the terminal. Select the robot number and terrain number. Enter "2" for the robot number (gr2). The terrain can be specified; here, using FLAT as an example, enter "0". After input, a UI interface as shown below will appear.

Start Aurora

Before running Aurora, you need to determine the startup configuration items. The configuration file is located at config/config.yaml.

Config:
RobotName: gr2 # gr1 / gr2 / gr3
HardwareType: null
RunType: 0 # 0 run simulator / 1 control real robot
UseJoyStick: true # use as default
DomainID: 123 # use as default

  • RobotName: The robot model, here you should select gr2.
  • RunType: Operation mode. 0 means running in the simulator, 1 means controlling the real robot. Here you should select 0.
  • UseJoyStick: Whether to use joystick control. true enables it, false disables it. Since a joystick control demonstration will follow, select true.
  • DomainID: The DDS communication domain ID, used to distinguish different communication domains within the same network environment. The default value is 123. It can be changed to a different value to avoid conflicts during multi-robot collaboration.

After confirming the configuration file, run the following command to start Aurora:

AuroraCore --config <path_to_your_config_file>

If the program runs successfully, the following message will appear in the terminal:

[info] FSM state run, enter "Default" mode by default

Control the Robot

The Aurora SDK provides two methods for robot control: joystick control and client control. This article will introduce how to achieve robot standing and walking in the simulation environment using these two control methods respectively.

1. Control the Robot Using a Joystick

After starting Aurora and the simulation environment, press the joystick buttons LB + B. The terminal display will switch from the "default" state to the "Pdstand" state. In simulation, because the robot is not in a stable standing position on the ground when entering the "Pdstand" state, the robot is in the Hanging State. The robot lies on the ground and begins adjusting joint postures to prepare for standing.

After clicking Reset in the MuJoCo UI interface, the robot stands on the ground, and the terminal indicates the robot is in the Stance State.

Press the joystick buttons RB + A. The terminal display will switch from the Pdstand state to the RLLocomotion state. The terminal display is as follows:

At this point, we can control the robot's speed using the left and right joysticks. Push the vertical axis of the left joystick forward, and the robot starts walking forward.

At this point, you have successfully used a joystick to control the robot to stand and walk in the simulation environment. This tutorial only demonstrates some functions of the standing and walking states. For more information on the functions of other states, please refer to the Developer Guide.

2. Control the Robot Using the Client

You can also use the Python client provided by the SDK to control the robot. For an introduction to client usage, please refer to the Client Usage Introduction.

Install the Client

The client can be used inside the Docker image or in a local Python environment.

Open another terminal, enter the container you just started or your local Python environment, and run the following commands to install the Aurora client:

sudo apt install python3-pip
pip install fourier-aurora-client

⚠️ Note:

If using a Python environment, the Python version must be 3.9 or higher.

Run demo_quick_start

Enter the image or virtual environment where fourier-aurora-client is installed, navigate to the Fourier Aurora SDK directory, and run the following command:

python3 python/example/gr2/demo_quick_start.py

After running, the terminal will display communication matching prompts, as shown below:

According to the prompt in the client startup terminal "Press Enter to switch to PdStand...", press the Enter key. The Aurora startup terminal will show the state switching from "default" to "Pdstand". In simulation, because the robot is not in a stable standing position on the ground when entering the "Pdstand" state, the robot is in the Hanging State. The robot lies on the ground and begins adjusting joint postures to prepare for standing.

After clicking Reset in the MuJoCo UI interface, the robot stands on the ground, and the terminal indicates the robot is in the Stance State.

According to the prompt in the client startup terminal "Press Enter to enter walk task...", press the Enter key. The Aurora terminal will show the state switching from "Pdstand" to "RLLocomotion".

According to the prompt in the client startup terminal "Press Enter to walk...", press the Enter key. This calls the set_velocity function, sending a forward speed command of 0.2m/s to the Aurora service, and the robot starts walking.

At this point, you have successfully used the client to control the robot to stand and walk in the simulation environment. This tutorial only demonstrates some functions of the standing and walking states. For more information on the functions of other states, please refer to the Developer Guide. [file content end]