当前位置:   article > 正文

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

project dave

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

安装依赖:

  1. sudo apt update
  2. sudo apt full-upgrade
  3. 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
  4. # Install required ROS and Gazebo Packages
  5. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros1-latest.list'
  6. sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  7. sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
  8. wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
  9. sudo apt update
  10. DIST=noetic
  11. GAZ=gazebo11
  12. 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

源码安装:

  1. mkdir -p ~/uuv_ws/src
  2. cd ~/uuv_ws/src
  3. git clone https://github.com/Field-Robotics-Lab/dave.git
  4. sudo apt install python3-vcstool
  5. cd ~/uuv_ws/src
  6. vcs import --skip-existing --input dave/extras/repos/dave_sim.repos .
  7. # 如果收到错误,请尝试遵循 Git Hub 错误权限被拒绝的公钥并删除克隆失败的空目录,然后重试Could not determine ref type of version:
  8. cd ~/uuv_ws/src
  9. rm -rf dockwater ds_msgs ds_sim eca_a9 rexrov2 uuv_manipulators uuv_simulator
  10. 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下来了!!

编译

  1. cd ~/uuv_ws
  2. catkin_make
  3. source ~/uuv_ws/devel/setup.bash
  4. # 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的支持:

  1. set(CMAKE_CXX_STANDARD 17)
  2. set(CMAKE_CXX_STANDARD_REQUIRED ON)

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

对于BuoyantObject.hh:

改为:

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

对于BuoyantObject.cc:

改为:

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

对于HydrodynamicModel.cc:修改为:

  1. // FIXME(mam0box) This is a work around the problem of the invalid bounding
  2. // box returned by Gazebo
  3. if (_sdf->HasElement("box"))
  4. {
  5. sdf::ElementPtr sdfModel = _sdf->GetElement("box");
  6. if (sdfModel->HasElement("width") && sdfModel->HasElement("length") &&
  7. sdfModel->HasElement("height"))
  8. {
  9. double width = sdfModel->Get<double>("width");
  10. double length = sdfModel->Get<double>("length");
  11. double height = sdfModel->Get<double>("height");
  12. ignition::math::AxisAlignedBox boundingBox = ignition::math::AxisAlignedBox(
  13. ignition::math::Vector3d(-width / 2, -length / 2, -height / 2),
  14. ignition::math::Vector3d(width / 2, length / 2, height / 2));
  15. // Setting the the bounding box from the given dimensions
  16. this->SetBoundingBox(boundingBox);
  17. }
  18. }

编译通过!

  1. [100%] Linking CXX shared library /home/asus/SLAM/uuv_ws/devel/lib/libdsros_ros_depth.so
  2. [100%] Built target dsros_ros_ins
  3. [100%] Built target uuv_gazebo_ros_pose_gt_plugin
  4. [100%] Built target dsros_ros_depth
  5. [100%] Built target dave_ocean_current_model_plugin
  6. [100%] Linking CXX shared library /home/asus/SLAM/uuv_ws/devel/lib/libdsros_ros_dvl.so
  7. [100%] Built target dsros_ros_dvl

【运行测试】

source以下工作空间

然后 :

roslaunch dave_demo_launch dave_demo.launch

就出现仿真的ROV啦!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/378983
推荐阅读
相关标签
  

闽ICP备14008679号