2024-10-10 21:22:58 +08:00
|
|
|
# RL Quadruped Controller
|
2024-10-03 20:51:33 +08:00
|
|
|
|
|
|
|
This repository contains the reinforcement learning based controllers for the quadruped robot.
|
|
|
|
|
|
|
|
Tested environment:
|
|
|
|
* Ubuntu 24.04
|
|
|
|
* ROS2 Jazzy
|
|
|
|
|
|
|
|
|
|
|
|
## 2. Build
|
|
|
|
### 2.1 Installing libtorch
|
|
|
|
```bash
|
|
|
|
cd ~/CLionProjects/
|
2024-10-07 11:57:32 +08:00
|
|
|
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 ./
|
|
|
|
```
|
|
|
|
```bash
|
|
|
|
cd ~/CLionProjects/
|
2024-10-04 20:14:34 +08:00
|
|
|
rm -rf libtorch-shared-with-deps-latest.zip
|
2024-10-03 20:51:33 +08:00
|
|
|
echo 'export Torch_DIR=~/CLionProjects/libtorch' >> ~/.bashrc
|
|
|
|
```
|
|
|
|
|
2024-10-10 21:22:58 +08:00
|
|
|
### 2.2 Build Controller
|
2024-10-03 20:51:33 +08:00
|
|
|
```bash
|
|
|
|
cd ~/ros2_ws
|
2024-10-10 21:22:58 +08:00
|
|
|
colcon build --packages-up-to rl_quadruped_controller
|
2024-10-03 20:51:33 +08:00
|
|
|
```
|
2024-10-04 20:14:34 +08:00
|
|
|
|
|
|
|
## 3. Launch
|
|
|
|
* Unitree A1 Robot
|
|
|
|
```bash
|
|
|
|
source ~/ros2_ws/install/setup.bash
|
|
|
|
ros2 launch a1_description rl_control.launch.py
|
|
|
|
```
|