diff --git a/README.md b/README.md index 7b2b56d..971535c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -# rl_sim2sim +# rl_sar -[中文文档](README_CN.md) +[中文文档](README.md) + +Gazebo simulation verification and UnitreeA1 physical deployment for reinforcement learning. "sar" stands for "simulation and real". ## Preparation -Pull the code (synchronously pull submodules) +Clone the code (sync submodules) ```bash -git clone --recursive https://github.com/fan-ziqi/rl_sim2sim.git +git clone --recursive https://github.com/fan-ziqi/rl_sar.git ``` If there are updates: @@ -26,7 +28,7 @@ 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` +Install `teleop-twist-keyboard` ```bash sudo apt install ros-noetic-teleop-twist-keyboard @@ -34,7 +36,7 @@ sudo apt install ros-noetic-teleop-twist-keyboard ## Compilation -Customize the following two functions in the code to adapt to different models: +Customize the following two functions in your code to adapt to different models: ```cpp torch::Tensor forward() override; @@ -48,30 +50,39 @@ cd .. catkin build ``` -## Run +## Running -Copy the trained pt model file to `sim2sim/src/unitree_rl/models` +Before running, copy the trained pt model file to `rl_sar/src/unitree_rl/models` -Open a new terminal, start the gazebo simulation environment +### Simulation + +Open a new terminal, launch the gazebo simulation environment ```bash source devel/setup.bash roslaunch unitree_rl start_env.launch ``` -Open a new terminal, start the control program +Open a new terminal, run the control program ```bash source devel/setup.bash rosrun unitree_rl unitree_rl ``` -Open a new terminal, keyboard control program +Open a new terminal, run the keyboard control program ```bash rosrun teleop_twist_keyboard teleop_twist_keyboard.py ``` +### Physical Deployment +Open a new terminal, run the control program -> Part of the code refers to https://github.com/mertgungor/unitree_model_control +```bash +source devel/setup.bash +rosrun unitree_rl unitree_rl_real +``` + +> Some code references: https://github.com/mertgungor/unitree_model_control \ No newline at end of file diff --git a/README_CN.md b/README_CN.md index 9295ff9..37a3b2b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -12,12 +12,6 @@ git clone --recursive https://github.com/fan-ziqi/rl_sar.git ``` -UnitreeA1只能使用v3.2.1的unitree_ros_to_real以及v3.2的unitree_legged_sdk,使用以下命令切换分支 - -```bash -cd src/unitree_ros/unitree_ros_to_real && git checkout v3.2.1 && cd - && cd src/unitree_ros/unitree_ros_to_real/unitree_legged_sdk && git checkout v3.2 && cd - -``` - 如有更新: ```bash