Hello everyone, I'm trying to write some c++ code that uses the Costmap2DROS class, but I have this error at compile time:
error: no matching function for call to ‘costmap_2d::Costmap2DROS::Costmap2DROS(std::__cxx11::string&, tf2_ros::Buffer&)
/opt/ros/kinetic/include/costmap_2d/costmap_2d_ros.h:80:3: note: candidate: costmap_2d::Costmap2DROS::Costmap2DROS(std::__cxx11::string, tf::TransformListener&)
Costmap2DROS(std::string name, tf::TransformListener& tf);
The line that gives the problem is this one:
costmap = new costmap_2d::Costmap2DROS("global_planner", tfl);
where tfl is a tf2::Buffer& object.
I have seen from these reference pages
http://docs.ros.org/jade/api/costmap_2d/html/classcostmap__2d_1_1Costmap2DROS.html
http://docs.ros.org/melodic/api/costmap_2d/html/classcostmap__2d_1_1Costmap2DROS.html that depending on the ROS version you have different constructors for the class. The problem is that I am working on ROS Kinetic, that according to the ROS wiki, uses the melodic version, so why my compiler is using the jade one? How can I solve this?
Thank you in advance to anyone who can help
Originally posted by SteBisi on ROS Answers with karma: 3 on 2018-09-14
Post score: 0