当前位置: 首页 > 工具软件 > DROS > 使用案例 >

no matching function for call to ‘costmap_2d::Costmap2DROS::Costmap2DROS(const char [17], tf::Transf

经景辉
2023-12-01

error: no matching function for call to ‘costmap_2d::Costmap2DROS::Costmap2DROS(const char [17], tf::TransformListener&)’

error: no matching function for call to ‘costmap_2d::Costmap2DROS::Costmap2DROS(const char [17], tf::TransformListener&)’
   20 |     cm::Costmap2DROS lcr("cleaning_costmap", tf);
      |                             

查看costmap对应cpp与h文件发现函数声明为Costmap2DROS::Costmap2DROS(const std::string& name, tf2_ros::Buffer& tf),后一项参数与tf::TransformListener不一致,进入其github上官网下载一个1.14.x版本的navigation文件,其中cost_2d文件夹中的对应函数声明为Costmap2DROS::Costmap2DROS(std::string name, tf::TransformListener& tf),与我们所要的一致,放入工作空间编译,问题解决.

 类似资料: