Ubuntu20.04 配置安装运行 Dave (水下SLAM 仿真环境)

Directly on Host | Project DAVEWiki/Tutorial Documents for Project DAVEhttps://field-robotics-lab.github.io/dave.doc/contents/installation/Install-Directly-on-Host/

安装依赖:

sudo apt update
sudo apt full-upgrade

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

# Install required ROS and Gazebo Packages

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros1-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
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 https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt update
DIST=noetic
GAZ=gazebo11
sudo apt install -y ${GAZ} lib${GAZ}-dev python3-catkin-tools python3-rosdep python3-rosinstall python3-rosinstall-generator python3-vcstool ros-${DIST}-gazebo-plugins ros-${DIST}-gazebo-ros ros-${DIST}-gazebo-ros-control ros-${DIST}-gazebo-ros-pkgs ros-${DIST}-effort-controllers ros-${DIST}-geographic-info ros-${DIST}-hector-gazebo-plugins ros-${DIST}-image-view ros-${DIST}-joint-state-controller ros-${DIST}-joint-state-publisher ros-${DIST}-joy ros-${DIST}-joy-teleop ros-${DIST}-kdl-parser-py ros-${DIST}-key-teleop ros-${DIST}-move-base ros-${DIST}-moveit-commander ros-${DIST}-moveit-planners ros-${DIST}-moveit-simple-controller-manager ros-${DIST}-moveit-ros-visualization ros-${DIST}-pcl-ros ros-${DIST}-robot-localization ros-${DIST}-robot-state-publisher ros-${DIST}-ros-base ros-${DIST}-ros-controllers ros-${DIST}-rqt ros-${DIST}-rqt-common-plugins ros-${DIST}-rqt-robot-plugins ros-${DIST}-rviz ros-${DIST}-teleop-tools ros-${DIST}-teleop-twist-joy ros-${DIST}-teleop-twist-keyboard ros-${DIST}-tf2-geometry-msgs ros-${DIST}-tf2-tools ros-${DIST}-urdfdom-py ros-${DIST}-velodyne-gazebo-plugins ros-${DIST}-velodyne-simulator ros-${DIST}-xacro

源码安装:

mkdir -p ~/uuv_ws/src
cd ~/uuv_ws/src
git clone https://github.com/Field-Robotics-Lab/dave.git

sudo apt install python3-vcstool

cd ~/uuv_ws/src
vcs import --skip-existing --input dave/extras/repos/dave_sim.repos .

# 如果收到错误,请尝试遵循 Git Hub 错误权限被拒绝的公钥并删除克隆失败的空目录,然后重试Could not determine ref type of version: 

cd ~/uuv_ws/src
rm -rf dockwater ds_msgs ds_sim eca_a9 rexrov2 uuv_manipulators uuv_simulator
vcs import --skip-existing --input dave/extras/repos/dave_sim.repos .

好像还是会报错:

=== ./dave (git) ===
Skipped existing repository with different URL
=== ./dockwater (git) ===
Could not determine ref type of version: git@github.com: Permission denied (publickey).
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
 

【解决方法】

打开文件     ~/dave/extras/repos/dave_sim.repos

将所有的 git@github.com:

改为 https://github.com/

OK!所有依赖项目都可以git下来了!!

编译

cd ~/uuv_ws
catkin_make

source ~/uuv_ws/devel/setup.bash

# Optionally, you may wish to add source ~/uuv_ws/devel/setup.bash to your .bashrc file.

报错:主要是uuv_gazebo_plugins里的

【解决】

1、定位到uuv_gazebo_plugins的package,在其目录下的CMakeLists.txt中添加对c++17的支持:

   set(CMAKE_CXX_STANDARD 17)
   set(CMAKE_CXX_STANDARD_REQUIRED ON)

2、需要在BuoyantObject.hh,BuoyantObject.cc,HydrodynamicModel.cc中做出相应修正

对于BuoyantObject.hh:

改为:

public: void SetBoundingBox(const ignition::math::AxisAlignedBox &_bBox);
 
...
 
protected: ignition::math::AxisAlignedBox boundingBox;

对于BuoyantObject.cc:

改为:

void BuoyantObject::SetBoundingBox(const ignition::math::AxisAlignedBox &_bBox)
{
  this->boundingBox = ignition::math::AxisAlignedBox(_bBox);
 
  gzmsg << "New bounding box for " << this->link->GetName() << "::"
    << this->boundingBox << std::endl;
}

对于HydrodynamicModel.cc:修改为:

// FIXME(mam0box) This is a work around the problem of the invalid bounding
// box returned by Gazebo
  if (_sdf->HasElement("box"))
  {
    sdf::ElementPtr sdfModel = _sdf->GetElement("box");
    if (sdfModel->HasElement("width") && sdfModel->HasElement("length") &&
        sdfModel->HasElement("height"))
    {
      double width = sdfModel->Get<double>("width");
      double length = sdfModel->Get<double>("length");
      double height = sdfModel->Get<double>("height");
      ignition::math::AxisAlignedBox boundingBox = ignition::math::AxisAlignedBox(
        ignition::math::Vector3d(-width / 2, -length / 2, -height / 2),
        ignition::math::Vector3d(width / 2, length / 2, height / 2));
      // Setting the the bounding box from the given dimensions
      this->SetBoundingBox(boundingBox);
    }
  }

编译通过!

[100%] Linking CXX shared library /home/asus/SLAM/uuv_ws/devel/lib/libdsros_ros_depth.so
[100%] Built target dsros_ros_ins
[100%] Built target uuv_gazebo_ros_pose_gt_plugin
[100%] Built target dsros_ros_depth
[100%] Built target dave_ocean_current_model_plugin
[100%] Linking CXX shared library /home/asus/SLAM/uuv_ws/devel/lib/libdsros_ros_dvl.so
[100%] Built target dsros_ros_dvl

【运行测试】

source以下工作空间

然后 :

roslaunch dave_demo_launch dave_demo.launch

就出现仿真的ROV啦!!

  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 12
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值