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 a6cf322ac1 add LICENCE 2024-03-06 19:43:41 +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 doc: add README 2024-03-06 17:32:15 +08:00

README.md

rl_sim2sim

准备

在任意位置下载并部署libtorch

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

安装 teleop-twist-keyboard

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

编译

自定义代码中的以下两个函数,以适配不同的模型:

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

然后到根目录编译

cd ..
catkin build

运行

将训练好的pt模型文件拷贝到sim2sim/src/unitree_rl/models

新建终端启动gazebo仿真环境

source devel/setup.bash
roslaunch unitree_rl start_env.launch

新建终端,启动控制程序

source devel/setup.bash
rosrun unitree_rl unitree_rl

新建终端,键盘控制程序

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

部分代码参考https://github.com/mertgungor/unitree_model_control