最近准备学习一下ros,gazebo和一个水下rov模拟器。

uuv_simulator(https://github.com/uuvsimulator/uuv_simulator)是一个非常优秀的基于ROS&GAZEBO开源水下机器人仿真项目,能为水下机器人的应用与算法提供一个较为理想的仿真环境进行测试。更详细的内容请仔细研读项目的wiki资料。

项目的机器人模型有两款ROV:desistek_saga与rexrov2,两款AUV:eca_a9与lauv_gazebo。项目内都提供了链接。同时在RexROV2的项目中《Development and Commissioning of a DP system for ROV SF 30k》一文详细介绍了如何构建水下机器人模型,值得了解一下。

在这里要说明的是仿真环境毕竟是虚拟的,水下使用光学相机不可能有这么好的能见度。实际上uuv_simulator里是有水雾设定以模拟水下光的衰减的情况,具体可以阅读其论文。不过此次仿真测试没有使用。

最后简要说一下怎么安装和测试。

首先根据网上资料安装好ros noetic和gazebo,下面是针对uuv的导入:

安装:

mkdir -p xxx/src
    cd xxx/src
    git clone https://github.com/uuvsimulator/uuv_simulator.git
    git clone https://github.com/cabinx/cabin_auv_simulation.git
    cd ..
    catkin_make

注意:我个人的系统为ubutu20.04,ROS版本为neotic,Gazebo版本为11.0。所以编译uuv_simulator时出现了一些问题,具体如下:

一、gazebo11与sdformat-9.2问题

sdformat版本升级后,编译器的版本支持也需要做出相应改动。大致会出现如下报错:

/usr/include/sdformat-9.2/sdf/Param.hh:72:57: error: expected constructor, destructor, or type conversion before ‘;’ token template<class T> ParamStreamer(T) -> ParamStreamer<T>; /usr/include/sdformat-9.2/sdf/Param.hh:83:47: error: ‘variant’ is not a member of ‘std’ ParamStreamer<std::variant<Ts...>> sv)

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

   set(CMAKE_CXX_STANDARD 17)set(CMAKE_CXX_STANDARD_REQUIRED ON)

二、gazebo11与Ignition Math库问题

Ignition Math库相应升级到了v6版本,库内一些类的命名也有所变动,导致编译时出现错误。在此给出v4版本和v6版本的API链接:

V4:https://ignitionrobotics.org/api/math/4.0/namespaceignition_1_1math.html

V6:https://ignitionrobotics.org/api/math/6.7/namespaceignition_1_1math.html

还是在uuv_gazebo_plugins的package中,http://HydrodynamicModel.cc中计算bounding box调用的类发生了改动,原代码为ignition::math::Box ,新版本更名为 ignition::math::AxisAlignedBox,而新版本的ignition::math::Box是新的实现。需要在BuoyantObject.hh,http://BuoyantObject.cc,http://HydrodynamicModel.cc中做出相应修正。

1、对于BuoyantObject.hh:

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

修改为:

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

2、对于http://BuoyantObject.cc:

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

修改为:

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;
}

3、对于http://HydrodynamicModel.cc:

// FIXME(mam0box) This is a work around the problem of the invalid bounding
// box returned by Gazeboif (_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::Box boundingBox = ignition::math::Box(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 dimensionsthis->SetBoundingBox(boundingBox);}}

修改为:

// FIXME(mam0box) This is a work around the problem of the invalid bounding
// box returned by Gazeboif (_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 dimensionsthis->SetBoundingBox(boundingBox);}}

三 .错误:

[ 97%] Linking CXX shared library /home/wmc/space/gazebo/uuv/devel/lib/libuuv_gazebo_ros_base_sensor_plugin.so
/home/wmc/space/gazebo/uuv/src/uuv_simulator/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp: In member function ‘cv::Mat gazebo::GazeboRosImageSonar::ConstructVisualScanImage(cv::Mat&)’:
/home/wmc/space/gazebo/uuv/src/uuv_simulator/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp:945:71: error: ‘CV_AA’ was not declared in this scope; did you mean ‘CV_AVX’?
  945 |   cv::ellipse(scan, center, axes, -90, -fov/2.-0.5, fov/2., white, 1, CV_AA); //, int lineType=LINE_8, 0);
      |                                                                       ^~~~~
      |                                                                       CV_AVX

定位gazebo_ros_image_sonar.cpp,加入头文件

#include <opencv2/imgproc/imgproc_c.h>

至此,编译顺利通过,仿真运行也没有问题。

(以上是引用的其他博主的文章和一些自己的问题,在此表示感谢!)

————————————————
版权声明:本文为CSDN博主「cabinx」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xiekaikaibing/article/details/114984613

启动湖泊

roslaunch uuv_gazebo_worlds auv_underwater_world.launch

启动环境和水下机器人pid控制

执行命令:

roslaunch uuv_gazebo start_pid_demo_with_teleop.launch

(未完待续)

Gazebo仿真UUV水下机器人相关推荐

  1. 安装gazebo_手把手教你用Gazebo仿真UUV水下机器人

    前言 本节教程演示UUV的一些玩法,基于开源项目UUV,官方介绍文档uuvsimulator  https://uuvsimulator.github.io/packages/uuv_simulato ...

  2. 【转载】用Gazebo仿真UUV水下机器人(古月居)

    前言 教程演示UUV的一些玩法,基于开源项目UUV,官方介绍文档:官网 仿真环境 系统:ubuntu16.04 软件:ROS – kinetic 仿真:gazebo7.16 安装仿真软件 官网介绍目前 ...

  3. 机器人SLAM与自主导航——(四)Gazebo仿真机器人导航

    (1)创建launch文件 启动Gazebo仿真环境: mrobot_gazebo/launch/mrobot_laser_nav_gazebo.launch 启动move_base导航功能节点: m ...

  4. ROS(indigo)机器人操作系统学习有趣丰富的Gazebo仿真示例evarobot

    通过网页快速了解Linux(Ubuntu)和ROS机器人操作系统,请参考实验楼在线系统如下: 初级教程可参考:https://www.shiyanlou.com/courses/854 邀请码:U23 ...

  5. 【ros学习】14.urdf、xacro机器人建模与rviz、gazebo仿真详解

    一.起因 学校的这学期课程是ros机器人开发实战,我们学习小组也要搞一个自己的机器人模型,我们组又叫葫芦组,所以我就做了个葫芦形状的机器人,虽说有点丑,本来想用maya建模再导入的,奈何不太懂maya ...

  6. ROS系统SLAM基础学习:gazebo仿真机器人自主导航

    ROS系统SLAM基础学习:gazebo仿真机器人自主导航 move_base节点配置 amcl节点配置 导航仿真 导航SLAM仿真 自主探索SLAM仿真 自主导航:避障 遇到的问题及解决方法和总结 ...

  7. matlab主方程,水下机器人运动控制与仿真的数学模型

    ·!"· 水下机器人运动控制与仿真的数学模型 常文君 博士生#工程师 国防科工委[$%%%"&]刘建成 女 博士生 哈尔滨工程大学[$!%%%$]于华南 女 博士生 哈尔滨 ...

  8. 【开源项目分享】用于机器人崎岖地形导航的高程图创建及Gazebo仿真

    简介 该项目是由苏黎世联邦理工学院(自治系统实验室和机器人系统实验室)开发,用于创建以机器人为中心的高程图,以实现崎岖地形的自主导航任务. 项目演示 https://www.bilibili.com/ ...

  9. 遨博协作机器人ROS开发 - Gazebo仿真与控制真实机器人

    目录 一.简介 二.环境版本 三.Gazebo仿真 1.gazebo使用 2. 仿真遨博机械臂 四.ROS控制真实机器人 1. 网络配置 2. 真实机器人控制 3. 真实机器人运动速度调节 五.小结 ...

最新文章

  1. 地图旋转_折纸效果三维旋转,不一样的地图页设计
  2. C51汇编伪指令 CSEG DSEG
  3. 十大编程算法助程序员走上大神路
  4. python人工智能——机器学习——模型选择与调优
  5. 【Hibernate】HibernateCallback总结
  6. 500内部privoxy错误_【热议】喝崂山啤酒中奖500听,却只能兑换500毫升?!
  7. iptables中DNAT、SNAT和MASQUERADE的理解
  8. ARM:供给中国 160 亿颗芯片,继续授权华为!
  9. vCenter上解决”此主机当前没有管理网络冗余“的警告
  10. 这篇文章让你搞懂 SpringMVC 国际化!
  11. 图片默认底部3px缝隙
  12. __stack_chk_fail问题及解决方案
  13. 传统医美身处风口浪尖,互联网医美如何拯救?
  14. unsw计算机专业排名,新南威尔士大学计算机专业竟然这么厉害!详解新南威尔士大学计算机专业!...
  15. 线性筛(Linear Sieve)
  16. 思科 Packet Tracer 中交换机的常见命令介绍
  17. BundleFusion复现手册——Win10+VS2013+Cuda8.0+KinectV2实时重建
  18. Hive学习之路(二):Hive表操作详讲
  19. 图形验证码的两种实现方式
  20. 【已解决】笔记本电脑关闭盖子后出现死机

热门文章

  1. android fun os,FuntouchOS10,横空出世,操作体验不输EMUI和MIUI
  2. 【图解】redis主从同步流程——全量同步、部分同步、命令传播
  3. python实现矩阵横竖斜的和相等_python打印9宫格,25宫格等奇数格,且横竖斜相加和相等...
  4. js实现 input 框的动态赋值
  5. 图论-最(极)大独立集
  6. 函数:全局局部变量、内部函数、闭包 详细解释与传参方法
  7. uniapp检查更新并显示下载进度
  8. linux glog安装使用
  9. Java System类与系统属性
  10. r语言 C4.5 剪枝是用什么算法_决策树算法