# How to correctly include navfn/navfn_ros.h ?

Hello , I have been trying to get the exploration stack working on hydro ( catkin ) and for the most part it works, but whenever I try to include the navfn/navfn_ros.h in my header file as show on wiki.ros.org/navfn, and run catkin_make, I get the following error :

 In file included from /home/vicos/explore_ws/src/explorer/src/FrontierExplorer.cpp:1:0:
/home/vicos/explore_ws/src/explorer/include/explorer/FrontierExplorer.h:19:29: fatal error: navfn/navfn_ros.h: No such file or directory
compilation terminated.


Here is a part of my header file :

#ifndef FRONTIER_EXPLORATION_H
#define FRONTIER_EXPLORATION_H

#include <ros/ros.h>
#include <visualization_msgs/Marker.h>
#include <boost/bind.hpp>
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>
#include <vector>
#include <costmap_2d/costmap_2d_ros.h>
#include <costmap_2d/costmap_2d.h>
#include <geometry_msgs/PoseStamped.h>
#include <nav_msgs/GetMap.h>

#include <explorer/FrontierFinder.h>
#include <explorer/Visualizer.h>

#include <navfn/navfn_ros.h>
#include <navfn/navfn.h>


CMakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)
project(explorer)

find_package(catkin REQUIRED COMPONENTS
actionlib
costmap_2d
geometry_msgs
move_base_msgs
navfn
nav_core
roscpp
visualization_msgs
tf
)

find_package(Boost REQUIRED COMPONENTS system)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} #explorer CATKIN_DEPENDS actionlib costmap_2d geometry_msgs move_base_msgs navfn roscpp visualization_msgs tf ) include_directories( include${catkin_INCLUDE_DIRS}
)



package.xml :

<?xml version="1.0"?>
<package>
<name>explorer</name>
<version>0.0.1</version>
<description>The explorer package</description>
<maintainer email="saprunov.luka@gmail.com">vicos</maintainer>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>actionlib</build_depend>
<build_depend>costmap_2d</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>move_base_msgs</build_depend>
<build_depend>navfn</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>visualization_msgs</build_depend>
<build_depend>tf</build_depend>

<run_depend>actionlib</run_depend>
<run_depend>costmap_2d</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>move_base_msgs</run_depend>
<run_depend>navfn</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>visualization_msgs</run_depend>
<run_depend>tf</run_depend>
</package>


running rospack find navfn returns

/opt/ros/hydro/share/navfn


and if I run rospack depends explorer (my modified exploration stack)

genmsg
gencpp
genlisp
genpy
message_generation
catkin
console_bridge
cpp_common
rostime
roscpp_traits
roscpp_serialization
message_runtime
std_msgs
actionlib_msgs
rosbuild
rosconsole
rosgraph_msgs
xmlrpcpp
roscpp
rosgraph
rospack
roslib
rospy
rosclean
rosmaster
rosout
rosparam
roslaunch
rosunit
rostest
actionlib
rosbag_storage
topic_tools
rosbag
rosmsg
rosservice
dynamic_reconfigure
geometry_msgs
sensor_msgs
message_filters
rostopic
rosnode
roswtf
tf2_msgs
tf2
tf2_py
tf2_ros
tf
angles
laser_geometry
nav_msgs
map_msgs
pcl_msgs
pcl_conversions
bond
smclib
bondcpp
pluginlib
nodelet
nodelet_topic_tools
pcl_ros
visualization_msgs
voxel_grid
costmap_2d
move_base_msgs
nav_core
navfn


both of which suggest that the navfn is present and correctly configured on the system and the move_base node ( which seems to use navfn ) works perfectly. So, why do I get the error ?

Thank you in advance for answering my question / helping with my problem !

edit retag close merge delete

Sort by » oldest newest most voted

The header you want is one level too deep in the include hierarchy: navfn/navfv/navfn_ros.h instead of navfn/navfn_ros.h, etc.

That looks like a bug in navfn to me. The Fuerte version put it where one would expect.

You can probably work around this temporarily by adding an extra navfn/ to your #include lines, but it needs to be fixed and should be reported as an issue.

EDIT : As Dirk said, this bug has been fixed in the source tree but still not released to the Ubuntu binary package repository. As a work-around, you can check out the source into your workspace from the https://github.com/ros-planning/navig... hydro-devel branch.

more

1

The bug has been fixed in https://github.com/ros-planning/navigation/commit/25f6ef8b7008bc383fb22aec84280e4d107ac8d5 but no new release has been made since then. I added a comment (https://github.com/ros-planning/navigation/commit/166614ca97a637cf525c930d81fcb7b80c48d08c#commitcomment-5575488) - hopefully the maintainers will release a new version into hydro soon.

( 2014-03-05 05:26:52 -0600 )edit

Thank you, the suggested approach works :). Sort of. Now I can use navfn's planner but the rest of code stops working ..and I can't really figure out why. So I can either use navfn or, remove the navigation source from my workspace and try to run my code without it, like before. I hope the repair the headers soon

( 2014-03-07 02:53:51 -0600 )edit