locusrobotics / robot_navigation

Spiritual successor to ros-planning/navigation.
450 stars 148 forks source link

nav core adapter package build fails because of Costmap2DROS #22

Closed sachininder10 closed 5 years ago

sachininder10 commented 5 years ago
/home/inderjeet/Projects/ros_ws/src/robot_navigation/nav_core_adapter/src/costmap_adapter.cpp: In member function ‘virtual void nav_core_adapter::CostmapAdapter::initialize(const ros::NodeHandle&, const string&, TFListenerPtr)’:
/home/inderjeet/Projects/ros_ws/src/robot_navigation/nav_core_adapter/src/costmap_adapter.cpp:76:81: error: no matching function for call to ‘costmap_2d::Costmap2DROS::Costmap2DROS(const string&, std::__shared_ptr_access<tf::TransformListener, (__gnu_cxx::_Lock_policy)2, false, false>::element_type&)’
   costmap_2d::Costmap2DROS* costmap_ros = new costmap_2d::Costmap2DROS(name, *tf);
                                                                                 ^
In file included from /home/inderjeet/Projects/ros_ws/src/robot_navigation/nav_core_adapter/include/nav_core_adapter/costmap_adapter.h:40:0,
                 from /home/inderjeet/Projects/ros_ws/src/robot_navigation/nav_core_adapter/src/costmap_adapter.cpp:35:
/home/inderjeet/Projects/ros_ws/src/robot_navigation/costmap_2d/include/costmap_2d/costmap_2d_ros.h:82:3: note: candidate: costmap_2d::Costmap2DROS::Costmap2DROS(const string&, tf2_ros::Buffer&)
   Costmap2DROS(const std::string &name, tf2_ros::Buffer& tf);
   ^~~~~~~~~~~~
/home/inderjeet/Projects/ros_ws/src/robot_navigation/costmap_2d/include/costmap_2d/costmap_2d_ros.h:82:3: note:   no known conversion for argument 2 from ‘std::__shared_ptr_access<tf::TransformListener, (__gnu_cxx::_Lock_policy)2, false, false>::element_type {aka tf::TransformListener}’ to ‘tf2_ros::Buffer&’
make[2]: *** [CMakeFiles/costmap_adapter.dir/src/costmap_adapter.cpp.o] Error 1
make[1]: *** [CMakeFiles/costmap_adapter.dir/all] Error 2
DLu commented 5 years ago

If compiling with melodic, please use the tf2 branch

sachininder10 commented 5 years ago

Hey David, I tried compiling with the tf2 branch but now the locomotor package gives the same error. Errors << locomotor:make /home/inderjeet/Projects/ros_ws/logs/locomotor/build.make.000.log /home/inderjeet/Projects/ros_ws/src/robot_navigation/locomotor/src/locomotor.cpp: In constructor ‘locomotor::Locomotor::Locomotor(const ros::NodeHandle&)’: /home/inderjeet/Projects/ros_ws/src/robotnavigation/locomotor/src/locomotor.cpp:58:30: error: ‘TransformListener’ is not a member of ‘tf’ tf = std::make_shared(ros::Duration(10)); ^~~~~ /home/inderjeet/Projects/ros_ws/src/robotnavigation/locomotor/src/locomotor.cpp:58:30: note: suggested alternative: ‘TransformLists’ tf = std::make_shared(ros::Duration(10)); ^~~~~ TransformLists /home/inderjeet/Projects/ros_ws/src/robot_navigation/locomotor/src/locomotor.cpp:58:30: error: ‘TransformListener’ is not a member of ‘tf’ /home/inderjeet/Projects/ros_ws/src/robotnavigation/locomotor/src/locomotor.cpp:58:30: note: suggested alternative: ‘TransformLists’ tf = std::make_shared(ros::Duration(10));

DLu commented 5 years ago

Somehow I missed that in the initial translation. The good news is that I already fixed it here: https://github.com/locusrobotics/robot_navigation/commit/3115795eea94a78cae3165cc2533593770666243

Please pull the latest version of the code.

sheikspeare commented 5 years ago

Hi DLu, I'm still having the same issue ...

DLu commented 5 years ago

Hi @sheikspeare - Please post your rosdistro and what branch of the code is checked out on your machine.