legged_mpc_control

所属分类:自动驾驶
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2022-12-10 06:38:21
上 传 者sh-1993
说明:  Unitree A1和Go1机器人的腿式机器人控制器,使用不同的MPC算法,
(A legged robot controller for Unitree A1 and Go1 robot using different MPC algorithms,)

文件列表:
.devcontainer/ (0, 2022-12-08)
.devcontainer/Dockerfile (12219, 2022-12-08)
.devcontainer/devcontainer.json (1328, 2022-12-08)
LICENSE (35149, 2022-12-08)
checklist.txt (1154, 2022-12-08)
gazebo_docker/ (0, 2022-12-08)
gazebo_docker/Dockerfile (4088, 2022-12-08)
gazebo_docker/run_gazebo_docker.bash (608, 2022-12-08)
plotJuggler_DebugLayout.xml (15009, 2022-12-08)
src/ (0, 2022-12-08)
src/legged_ctrl/ (0, 2022-12-08)
src/legged_ctrl/CMakeLists.txt (5326, 2022-12-08)
src/legged_ctrl/config/ (0, 2022-12-08)
src/legged_ctrl/config/default.yaml (240, 2022-12-08)
src/legged_ctrl/config/gait.info (3445, 2022-12-08)
src/legged_ctrl/config/gazebo_a1_convex.yaml (3365, 2022-12-08)
src/legged_ctrl/config/gazebo_a1_lci.yaml (2020, 2022-12-08)
src/legged_ctrl/config/gazebo_go1_convex.yaml (3164, 2022-12-08)
src/legged_ctrl/config/gazebo_go1_lci.yaml (2005, 2022-12-08)
src/legged_ctrl/config/hardware_a1_convex.yaml (3373, 2022-12-08)
src/legged_ctrl/config/hardware_a1_lci.yaml (282, 2022-12-08)
src/legged_ctrl/config/hardware_go1_convex.yaml (3379, 2022-12-08)
src/legged_ctrl/config/hardware_go1_lci.yaml (1994, 2022-12-08)
src/legged_ctrl/config/reference.info (708, 2022-12-08)
src/legged_ctrl/config/task.info (6084, 2022-12-08)
src/legged_ctrl/include/ (0, 2022-12-08)
src/legged_ctrl/include/LeggedParams.h (655, 2022-12-08)
src/legged_ctrl/include/LeggedState.h (6930, 2022-12-08)
src/legged_ctrl/include/estimation/ (0, 2022-12-08)
src/legged_ctrl/include/estimation/BasicKF.h (2789, 2022-12-08)
src/legged_ctrl/include/interfaces/ (0, 2022-12-08)
src/legged_ctrl/include/interfaces/BaseInterface.h (4039, 2022-12-08)
src/legged_ctrl/include/interfaces/GazeboInterface.h (3830, 2022-12-08)
src/legged_ctrl/include/interfaces/HardwareInterface.h (2411, 2022-12-08)
src/legged_ctrl/include/mpc_ctrl/ (0, 2022-12-08)
src/legged_ctrl/include/mpc_ctrl/LeggedMPC.h (237, 2022-12-08)
src/legged_ctrl/include/mpc_ctrl/ci_mpc/ (0, 2022-12-08)
... ...

# Introduction This repo contains controller support for our lab's research on MPC algorithms. The goal is 1. Provide an easy to use docker installation environment 2. Implement a good low-level controller that can track any traj generated by any MPC algorithms 3. Provide mechanism to benchmark different MPC algorithms. Currently we have - CIMPC - Convex MPC # Update Log 2022-11-21: Major update. An improved convex MPC controller; our CI-MPC controller can enable Go1 to trot, step on boxes, and lean against wall. # Installation ## Controller Setup We build, develop and test controller in a docker container. We also recommend to use VSCode devcontainer feature. !important: First thing you need to do after building the docker container: run "source ~/ocs2_ws/devel/setup.bash" in the container. (I don't know how to automate this yet ) ## Julia setup Since LCI MPC uses Julia, we need to config Julia environment after building the docker container. After docker is built, we first 1. git submodule update. Make sure src/legged_ctrl/src/mpc_ctrl/ci_mpc/lib has EmbeddedLciMpc.jl lib 2. go into src/legged_ctrl/src/mpc_ctrl/ci_mpc/lib/EmbeddedLciMpc.jl 3. start julia 4. pkg> activate . 5. pkg> instantiate 6. @v1.7) pkg> status ContactImplicitMPC (must be the local dir) 7. julia> include("scripts/precompile_sysimage.jl") ## Gazebo Setup The controller can control either a hardware Go1 robot or a simulation Go1/A1 robot. To start the gazebo simulation environment, we create another docker. On the host computer, build a second docker in "gazebo_docker" folder ```shell docker build -t a1_unitree_gazebo_image . ``` Now we need to be careful about the graphics card of the host computer. If the host computer uses Nvidia graphics card. Then we need to install nvidia-docker2. Read [this link](http://wiki.ros.org/action/login/docker/Tutorials/Hardware%20Acceleration) for more information. Assuming an Nvidia graphics card is used, and Nvidia driver is properly installed. First follow [this link](https://nvidia.github.io/nvidia-docker/) to add nvidia-docker repo to your host computer, then install the nvidia-docker2 follows [the instruction](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). ``` bash run_gazebo_docker.bash ``` Then on host computer, type ```shell xhost + ``` Then we run script **run_gazebo_docker.bash** once, later you can access the docker "a1_unitree_gazebo_docker" by ```shell docker start a1_unitree_gazebo_docker docker attach a1_unitree_gazebo_docker ``` If more terminals are needed, use the following command to add more terminals ```shell docker exec -it a1_unitree_gazebo_docker bash ``` In the docker container, run the following command to start the gazebo environment ```shell roslaunch unitree_gazebo normal.launch rname:=a1 wname:=earth ``` The gazebo window should be seen on the host computer. Check [the list of worlds](https://github.com/ShuoYangRobotics/unitree_ros/tree/master/unitree_gazebo/worlds) for different wname. ### Adjust the robot in the Gazebo During the development, we can let the robot stand up by two Unitree testing scripts. The following two commands are very handy. ```shell rosrun unitree_controller unitree_servo # let the robot stretch legs rosrun unitree_controller unitree_move_kinetic # place the robot back to origin ``` We oftern running the two commands alternatively by running one and ctrl-C after a while to adjust the pose of the robot. After the robot properly stands up, it is ready to be controlled. ## Run controllers The MPC controllers can be run using following commands after sucessful installation. (Again be careful to run "source ~/ocs2_ws/devel/setup.bash" in the container first after docker build) ```shell roslaunch legged_ctrl gazebo_a1_convex.launch # or roslaunch legged_ctrl gazebo_go1_convex.launch ```

近期下载者

相关文件


收藏者