赞
踩
- 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:
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啦!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。