环境
操作系统:Ubuntu 20.04
CPU:Intel® Xeon® Gold 6278C CPU @ 2.60GHz
内存:16GB
准备环境
Ubuntu与ROS版本对应关系
Ubuntu | ROS 1.0 | ROS2.0 |
---|---|---|
16.04 LTS | Kinetic LTS | Ardent |
18.04 LTS | Melodic LTS | Dashing LTS |
120.04 LTS | Noetic LTS | Foxy LTS |
安装Intel OneAPI HPC ToolKit(非必须)
sudo apt install gfortran
git clone https://github.com/xianyi/OpenBLAS
cd OpenBLAS
sudo make FC=gfortran
sudo make install
sudo ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libblas.so.3
sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.5 /usr/lib/libgfortran.so
安装ROS
小鱼一键安装(推荐)
网址:https://fishros.org.cn/forum/topic/20/小鱼的一键安装系列?lang=zh-CN
wget http://fishros.com/install -O fishros && . fishros
安装模拟器
安装环境依赖
```bash
sudo apt install libyaml-cpp-dev
sudo apt install libeigen3-dev
sudo apt install liblcm-dev
sudo apt install libglm-dev
catkin_ws初始化
mkdir catkin_ws
cd catkin_ws
mkdir src
cd src
git clone https://gitee.com/HUAWEI-ASCEND/quadruped-robot
cd ..
catkin_make
如果提示BLAS API问题或者BLAS问题
可以把quadruped-robot/model-control/quadruped/CMakeLists.txt文件中的BLAS相关代码注释掉
source环境变量
source devel/setup.bash
运行
运行Gazebo模拟器
roslaunch qr_gazebo gazebo_startup.launch wname:=earth
启动第一个机器人模型
roslaunch qr_gazebo model_spawn.launch rname:=a1 use_xacro:=true use_camera:=false
运行一个example
rosrun examples example_a1_sim
运行一个控制盘
rosrun examples example_keyboard
附录
常规安装(纯属笔记)
添加源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
设置秘钥
$ sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
安装ROS
sudo apt-get install ros-melodic-desktop-full
查看可使用的包
sudo apt-cache search ros-melodic
配置环境到系统
sudo apt-get install python-rosdep
sudo rosdep init
rosdep update
初始化环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
验证
roscore
安装 Gazebo
sudo apt-get update
sudo apt-get install lsb-release wget gnupg
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ignition-citadel