docs: del auto checkout

This commit is contained in:
fan-ziqi 2024-03-14 12:42:00 +08:00
parent ef0d98c606
commit bef47f7f71
2 changed files with 23 additions and 18 deletions

View File

@ -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 ## Preparation
Pull the code (synchronously pull submodules) Clone the code (sync submodules)
```bash ```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: 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 echo 'export Torch_DIR=/path/to/your/torchlib' >> ~/.bashrc
``` ```
Install `teleop-twist-keyboard` Install `teleop-twist-keyboard`
```bash ```bash
sudo apt install ros-noetic-teleop-twist-keyboard sudo apt install ros-noetic-teleop-twist-keyboard
@ -34,7 +36,7 @@ sudo apt install ros-noetic-teleop-twist-keyboard
## Compilation ## 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 ```cpp
torch::Tensor forward() override; torch::Tensor forward() override;
@ -48,30 +50,39 @@ cd ..
catkin build 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 ```bash
source devel/setup.bash source devel/setup.bash
roslaunch unitree_rl start_env.launch roslaunch unitree_rl start_env.launch
``` ```
Open a new terminal, start the control program Open a new terminal, run the control program
```bash ```bash
source devel/setup.bash source devel/setup.bash
rosrun unitree_rl unitree_rl rosrun unitree_rl unitree_rl
``` ```
Open a new terminal, keyboard control program Open a new terminal, run the keyboard control program
```bash ```bash
rosrun teleop_twist_keyboard teleop_twist_keyboard.py 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

View File

@ -12,12 +12,6 @@
git clone --recursive https://github.com/fan-ziqi/rl_sar.git 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 ```bash