Problem compiling node with Geany
Hello everyone when i compile my Node;cpp file it points me towards an error in Node.h file And the error it shows is
Node.h : fatal error: ros/ros.h : No file or folder of this type
I have looked into previous questions asked on this topic, so my file "package.xml" and "CmakeLists.txt" for this node seems correct to me, though i am posting them
package.xml
<?xml version="1.0"?>
<package>
<name>p_sedimentation_estimator</name>
<version>0.0.0</version>
<description>Fusion of pointcloud sonar and scan laser</description>
<maintainer email="ro@rob.com">Rob</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>cana_msgs</build_depend>
<!-- todo -->
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
Cmakelists.txt
cmake_minimum_required(VERSION 2.8.12)
project(p_sedimentation_estimator)
add_definitions(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED
roscpp
std_msgs
geometry_msgs
pcl_conversions
pcl_ros
tf2_ros
tf2_bullet
cana_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES p_sedimentation_estimator
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)
find_package(OpenCV REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core)
find_package(Boost 1.54.0 REQUIRED COMPONENTS )
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
${catkin_INCLUDE_DIRS}
)
file(GLOB Node_SRC
"src/*.h"
"src/*.cpp"
)
## Declare a C++ executable
add_executable(p_sedimentation_estimator ${Node_SRC})
## Specify libraries to link a library or executable target against
target_link_libraries(p_sedimentation_estimator
${catkin_LIBRARIES}
${OpenCV_LIBS}
Qt5::Core
)
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executables and/or libraries for installation
install(TARGETS p_sedimentation_estimator p_sedimentation_estimator
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
WHAT or Where could be the problem ??
1)catkin_make runs without error
2)Compilation of the node.cpp program gives this error(Node.h : fatal error: ros/ros.h : No file or folder of this type) in node.h file
3) is it necesarry to use build also , other than sourcing, catkin_make and compiling.
Help Needed :) Thanku in advance :)
Could I ask you to please format your questions properly? I've done it for you now (and in your previous questions as well), but for next time: select any code/console text/etc and press
ctrl+k
or click the Preformatted Text button (the one with101010
on it).@gvdhoorn Thanku so much...i will keep it in mind next time :)
@Yadav If I understand your question correctly, at the end you specify three points 1), 2), 3) that you step through, right?
Could you please explain how you "compile" your node? Because this is actually what
catkin_make
will do for you and thus I don't think you can have 1) successfull and 2) not if you are using the standard workflow...@mgruhler Yes,catkin_make runs without error But when i compile the code in the Node.cpp file alone, using "Geany" it shows me the error(Node.h : fatal error: ros/ros.h : No file or folder of this type) in node.h file So by catkin_make it gets compiled but it doen't work according to the code in Node.cpp file
Standard workflow ?
@Yadav then you don't have a problem with compiling your code in general, but only using geany. I've retagged and reworded your question title as such.