ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Please help out. Its Cmakelist, Cmake error. I heard related articles to this but I couldnot solve it.

asked 2017-12-10 16:03:38 -0500

nishad gravatar image

updated 2017-12-10 16:37:01 -0500

jayess gravatar image

Im using ROS kinetic and trying to build my first HelloROS.cpp with rosserial_embeddedlinux package. I couldnot compile the package, (I dont know how to write a makefile or makefile is generated automatically after cmake )

this is the error: Whenever i try to cmake,

/HelloROS.cpp:6:17: fatal error: ros.h: No such file or directory
compilation terminated.
CMakeFiles/HelloROS.dir/build.make:62: recipe for target 'CMakeFiles/HelloROS.dir/examples/HelloRos/HelloROS.cpp.o' failed
make[2]: *** [CMakeFiles/HelloROS.dir/examples/HelloRos/HelloROS.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/HelloROS.dir/all' failed
make[1]: *** [CMakeFiles/HelloROS.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

This is my cmakelist.txt:

cmake_minimum_required(VERSION 2.8.3)
project(rosserial_embeddedlinux)

find_package(catkin REQUIRED COMPONENTS rosserial_client roscpp rospy sensor_msgs std_msgs 
)


catkin_package( 
    CATKIN_DEPENDS roscpp rospy  
    LIBRARIES ${PROJECT_NAME}/src/ros_lib)

include_directories(include ${catkin_INCLUDE_DIRS}

            ${rosserial_client_INCLUDE_DIRS}

            ${roscpp_INCLUDE_DIRS}
            ${ros_lib_INCLUDE_DIRS})    

add_executable(HelloROS src/examples/HelloRos/HelloROS.cpp)
target_link_libraries(HelloROS ${catkin_LIBRARIES})

install(
  DIRECTORY src/ros_lib
            src/examples
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/src
  FILES_MATCHING PATTERN "*.h"
)

catkin_install_python(
  PROGRAMS src/${PROJECT_NAME}/make_libraries.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

and

this is my package.xml

<package>
  <name>rosserial_embeddedlinux</name>
  <version>0.7.7</version>
  <description>
    rosserial for embedded Linux enviroments
  </description>
  <author>xx</author>
  <maintainer email="xx@gmail.com">xx</maintainer>
  <maintainer email="xx@.com">xx</maintainer>
  <license>BSD</license>
  <url>http://ros.org/wiki/rosserial_embeddedlinux</url>

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>rosserial_client</build_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>

  <run_depend>roscpp</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>rosserial_msgs</run_depend>
</package>

Please out my issue.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-12-10 18:44:50 -0500

Wolf gravatar image

The source Code ist Not given bitte likely you

#include <ros.h>

Rather than

#include <ros/ros.h>
edit flag offensive delete link more

Comments

#include <ros.h> is what the tutorial shows.

jayess gravatar image jayess  ( 2017-12-10 20:31:27 -0500 )edit

Question Tools

Stats

Asked: 2017-12-10 16:03:38 -0500

Seen: 1,149 times

Last updated: Dec 10 '17