Simulation verification and physical deployment of robot reinforcement learning algorithms, suitable for quadruped robots, wheeled robots, and humanoid robots. "sar" stands for "simulation and real"
Go to file
fan-ziqi 825b7c7449 translate 2024-03-07 11:54:33 +08:00
.github/workflows feat: add auto update 2024-03-06 17:49:50 +08:00
src fix: move rl modules 2024-03-06 18:24:05 +08:00
.gitignore feat: ignore gitignore 2024-03-06 18:24:37 +08:00
.gitmodules feat: add submodule unitree_ros 2024-03-06 17:18:12 +08:00
LICENCE add LICENCE 2024-03-06 19:43:41 +08:00
README.md translate 2024-03-07 11:54:33 +08:00
README_CN.md translate 2024-03-07 11:54:33 +08:00

README.md

rl_sim2sim

中文文档

Preparation

Pull the code (synchronously pull submodules)

git clone --recursive https://github.com/fan-ziqi/rl_sim2sim.git

If there are updates:

git pull
git submodule update --remote --recursive

Download and deploy libtorch at any location

cd /path/to/your/torchlib
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-2.0.1+cpu.zip -d ./
echo 'export Torch_DIR=/path/to/your/torchlib' >> ~/.bashrc

Install teleop-twist-keyboard

sudo apt install ros-noetic-teleop-twist-keyboard

Compilation

Customize the following two functions in the code to adapt to different models:

torch::Tensor forward() override;
torch::Tensor compute_observation() override;

Then compile in the root directory

cd ..
catkin build

Run

Copy the trained pt model file to sim2sim/src/unitree_rl/models

Open a new terminal, start the gazebo simulation environment

source devel/setup.bash
roslaunch unitree_rl start_env.launch

Open a new terminal, start the control program

source devel/setup.bash
rosrun unitree_rl unitree_rl

Open a new terminal, keyboard control program

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Part of the code refers to https://github.com/mertgungor/unitree_model_control