赞
踩
参考文章:硕哥大佬知乎文章又一个开源的四足机器人控制器 - 知乎 (zhihu.com)
热心网友开源环境配置:解析A1-QP-MPC-Controller (matheecs.tech)
代码可以从知乎文章中跳转至github下载
本文主要用于说明如何搭建宇树科技开源代码运行环境,环境配置比较复杂,需要提前准备好一个游戏手柄,键盘无法控制机器狗运动
原始仓库采用 Docker 安装依赖环境,其实不用 Docker 也能跑,只需要按照 A1-QP-MPC-Controller/docker/Dockerfile
文件里的指令一步步执行。假设你已经安装好了 ROS,那么还需要完成以下步骤:
- sudo apt-get update && apt-get install -y \
- vim \
- libatlas-base-dev \
- libeigen3-dev \
- libgoogle-glog-dev \
- libsuitesparse-dev \
- python-catkin-tools \
- python3-matplotlib \
- gfortran \
- autoconf \
- coinor-libipopt-dev \
- libgfortran3 \
- curl \
- libopenmpi-dev \
- apt-utils \
- software-properties-common \
- build-essential \
- libssl-dev \
- ros-${ROS_DISTRO}-ros-control \
- ros-${ROS_DISTRO}-gazebo-ros \
- ros-${ROS_DISTRO}-joy \
- ros-${ROS_DISTRO}-ros-controllers \
- ros-${ROS_DISTRO}-robot-state-publisher
安装 OSQP
- cd ~
- git clone --recursive https://github.com/oxfordcontrol/osqp
- cd osqp
- mkdir build
- cd build
- cmake ..
- make -j
- sudo make install
安装 osqp-eigen
- cd ~
- git clone https://github.com/robotology/osqp-eigen.git
- cd osqp-eigen
- mkdir build
- cd build
- cmake ..
- make -j
- sudo make install
安装 LCM
- cd ~
- git clone https://github.com/lcm-proj/lcm.git
- cd lcm
- mkdir build
- cd build
- cmake ..
- make -j
- sudo make install
编译(无需安装) unitree_legged_sdk & aliengo_sdk
- cd ~
- git clone https://github.com/unitreerobotics/unitree_legged_sdk.git
- cd unitree_legged_sdk
- git checkout v3.2
- mkdir build
- cd build
- cmake ..
- make -j
- cd ~
- git clone https://github.com/unitreerobotics/aliengo_sdk.git
- cd aliengo_sdk
- mkdir build
- cd build
- cmake ..
- make -j
修改 ~/.bashrc
文件,末尾添加
- source /opt/ros/${ROS_DISTRO}/setup.bash
- source ~/catkin_ws/devel/setup.bash
- export UNITREE_LEGGED_SDK_PATH=~/unitree_legged_sdk
- export ALIENGO_SDK_PATH=~/aliengo_sdk
- #amd64, arm32, arm64
- export UNITREE_PLATFORM="amd64"
最后安装 unitree_ros (假设 ROS 工作空间路径为 ~/catkin_ws
) 和 A1-QP-MPC-Controller
- cd catkin_ws/src
- git clone https://github.com/ShuoYangRobotics/unitree_ros.git
- git clone https://github.com/ShuoYangRobotics/A1-QP-MPC-Controller.git
- cd ~/catkin_ws
- catkin_make
顺利执行完以上指令后,就可以启动程序啦。以
- # 启动 Gazebo 仿真环境
- $ roslaunch unitree_gazebo normal.launch rname:=a1 wname:=stairs_single
- # 初始化机器人位姿
- $ rosrun unitree_controller unitree_servo # let the robot stretch legs
- $ rosrun unitree_controller unitree_move_kinetic # place the robot back to origin
- # 启动手柄声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/556532推荐阅读
相关标签
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。