Simulation
fourier_aurora_sdk provides the GR2 robot motion control interface and Mujoco simulation environment. This document uses the demo_walk (fourier_aurora_sdk/python/example/gr2/demo_walk.py) from this repository as an example to demonstrate the process of using this SDK to perform simulation verification of an RL policy in the Mujoco simulator.
Installation Dependencies
- The Aurora and its dependencies are provided via a Docker image. Please refer to Installation Tutorial for the installation tutorial.
- fourier_aurora_sdk provides a Python client for deploying policies in the Mujoco environment simulation. Please refer to Aurora Client Introduction for its installation tutorial.
Connect a joystick
This demo requires a connected joystick. The robot’s walking speed is controlled using the joystick.
Start Container
Run the following command in the root directory of the fourier_aurora_sdk repository to start the container:
bash docker_run.bash
Note: Please ensure that fourier-aurora and related modules have been installed in the Docker image according to the installation guide.
Start the Simulator
- After entering the docker image, open a new terminal and enter the started container:
(sudo) docker exec -it fourier_aurora_sdk bash - Start the simulation environment:
Follow the prompts. The simulation environment will start, and the robot will be placed in the starting position.
python3 sim/start_simulate_root.py
Start Aurora
-
Edit the configuration file
config/config.yaml. Please ensure the RunType field is correctly set to 0 (simulator). -
Run in the terminal:
AuroraCore --config config/config.yaml -
If started successfully, the terminal will display the following information:
[info] FSM state run, enter "Default" mode by default
Using the Python Client
-
Enter the Python virtual environment that already has fourier_aurora_client installed:
conda activate your_env_name -
The model trained by Wiki-GRx-Gym is located at
fourier_aurora_sdk/python/example/gr2/policy_jit.pt. Run the deployment demo:cd fourier_aurora_sdk/python/example/gr2/
python3 demo_walk.py
Running Effect
Run the demo, and the terminal will prompt you to press Enter to switch to the PD Stand Task.
After entering the PD Stand Task, click the Reset button in the Mujoco simulator to make the robot stand on the ground, then press Enter again to switch to the user command mode.
Once in user command mode, you can control the robot’s walking with the controller joysticks.
The left joystick (vertical axis) controls forward and backward movement.
The left joystick (horizontal axis) controls lateral (sideways) movement.
The right joystick (horizontal axis) controls yaw (rotation).
