How to override /opt/ros/melodic/include/move_base/move_base.h?
I cloned the move_base
package to my catkin
workspace and built it using catkin_build
. I made some changes to the move_base
class constructor.
I changed it from MoveBase(tf2_ros::Buffer& tf);
to
MoveBase(tf2_ros::Buffer& tf, costmap_2d::Costmap2DROS* &planner_costmap_ros_, costmap_2d::Costmap2DROS* &controller_costmap_ros_ );
I am using this modified move_base
class in my package (named my_explore_lite
). I am getting the following error when I try to build the package using catkin build my_explore_lite
-
Errors << my_explore_lite:make /home/skpro19/catkin_ws/logs/my_explore_lite/build.make.007.log
/home/skpro19/catkin_ws/src/my_explore_lite/src/main.cpp: In function ‘int main(int, char**)’:
/home/skpro19/catkin_ws/src/my_explore_lite/src/main.cpp:476:75: error: no matching function for call to ‘move_base::MoveBase::MoveBase(tf2_ros::Buffer&, costmap_2d::Costmap2DROS*&, costmap_2d::Costmap2DROS*&)’
move_base::MoveBase my_move_base(buffer, global_costmap, local_costmap);
^
In file included from /home/skpro19/catkin_ws/src/my_explore_lite/src/main.cpp:15:0:
/opt/ros/melodic/include/move_base/move_base.h:90:7: note: candidate: move_base::MoveBase::MoveBase(tf2_ros::Buffer&)
MoveBase(tf2_ros::Buffer& tf);
^~~~~~~~
/opt/ros/melodic/include/move_base/move_base.h:90:7: note: candidate expects 1 argument, 3 provided
make[2]: *** [CMakeFiles/main_node.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/main_node.dir/all] Error 2
make: *** [all] Error 2
It seems that the error is arising because the header file at the location /opt/ros/melodic/move_base/move_base.h
is being used. How do I override this header file with the one that is inside my catkin workspace's move_base
package?
This is my CMakelist.txt file.