Ubuntu20.04 + ROS Noetic 安装 Projectory Dave 仿真环境
1.安装依赖
这里可以参照官方给出的参考:Project DAVE
(1)Upgrade to the latest packages:
sudo apt update
sudo apt full-upgrade
(2)Install required tools:
sudo apt install -y build-essential cmake cppcheck curl git gnupg libeigen3-dev libgles2-mesa-dev lsb-release pkg-config protobuf-compiler python3-dbg python3-pip python3-venv qtbase5-dev ruby software-properties-common sudo wget
2.下载源码并编译
创建一个新的workspace:
mkdir -p ~/uuv_ws/src
Clone Dave
cd ~/uuv_ws/src
git clone https://github.com/Field-Robotics-Lab/dave.git
完成后,原文档是这样说的
VCSTOOL的地址: vcstool
但是这个方法对网络要求很高,推荐自己clone各个包,第一次运行时这里会有如下的报错:
=== ./dave (git) ===
Skipped existing repository with different URL
=== ./dockwater (git) ===
Skipped existing directory
=== ./ds_msgs (git) ===
Skipped existing directory
=== ./ds_sim (git) ===
Skipped existing directory
=== ./eca_a9 (git) ===
Skipped existing directory
=== ./rexrov2 (git) ===
Skipped existing directory
=== ./uuv_manipulators (git) ===
Skipped existing directory
=== ./uuv_simulator (git) ===
Skipped existing directory
这里需要做一些修改,针对
~/uuv_ws/src/dave/extras/repos/dave_sim.repos
将gist@github.com: 换成 https://github.com/
这里列出需要安装的模块:
https://github.com/Field-Robotics-Lab/dave.git
https://github.com/Field-Robotics-Lab/dockwater.git
https://github.com/Field-Robotics-Lab/ds_msgs.git
https://github.com/Field-Robotics-Lab/ds_sim.git
https://github.com/uuvsimulator/eca_a9.git
https://github.com/uuvsimulator/rexrov2.git
https://github.com/field-robotics-lab/uuv_manipulators
https://github.com/field-robotics-lab/uuv_simulator
如果有使用Multibeam sonar的需求,那么同样将dave/extras/repos/multibeam_sim.repos里的gist@github.com: 换成 https://github.com/
需要安装的模块:
https://github.com/field-robotics-lab/nps_uw_multibeam_sonar
https://github.com/apl-ocean-engineering/hydrographic_msgs.git
目前安装Multibeam sonar模块后编译会出错。
3.构建仿真环境
只要保证前面的步骤都按照要求走了,这一步不太可能会出错。
现在只需要:
cd ~/uuv_ws
catkin build
这里强烈推荐使用catkin build命令
如果之前没使用过,那么可以运行下列代码来安装这个模块:
sudo apt-get update
sudo apt-get install python3-catkin-tools
catkin build
编译完成后,别忘了
source ~/uuv_ws/devel/setup.bash
为了方便后续使用,这里可以选择写入.bashrc文件
接下来测试安装是否成功
在一个新的终端里运行
roslaunch dave_demo_launch dave_demo.launch
4.运行仿真
这里在运行demo时会有一个报错:
ERROR: cannot launch node of type [joy/joy_node]: joy
这里是解决方法: 记录编译ros编译bug
但是编译时可能又会报错如下:
joystick_drivers/spacenav_node/src/spacenav_node.cpp:38:19: fatal error: spnav.h: 没有那个文件或目录
这里是解决方法:joystick_drivers/spacenav_node/src/spacenav_node.cpp:38:19: fatal error: spnav.h: 没有那个文件或目录
编译完成后就可以通过手柄操控机器人了