Ask Your Question

Dickvdsteen's profile - activity

2019-12-06 10:25:33 -0500 received badge  Great Question (source)
2015-01-12 02:43:36 -0500 received badge  Good Question (source)
2014-11-07 14:11:58 -0500 received badge  Good Answer (source)
2013-05-03 14:27:15 -0500 received badge  Nice Question (source)
2013-04-10 23:40:17 -0500 received badge  Student (source)
2013-04-10 23:40:11 -0500 received badge  Nice Answer (source)
2013-02-04 10:45:26 -0500 received badge  Famous Question (source)
2013-01-24 21:11:52 -0500 received badge  Self-Learner (source)
2013-01-24 21:11:52 -0500 received badge  Teacher (source)
2013-01-24 20:56:18 -0500 received badge  Notable Question (source)
2013-01-24 02:23:20 -0500 answered a question catkin messages and node in same package

Solved it!

Seems the following line was needed after calling add library

add_dependencies(lib lib_gencpp)

is this the right way to do it or not?

2013-01-24 02:14:54 -0500 received badge  Popular Question (source)
2013-01-24 02:09:58 -0500 received badge  Editor (source)
2013-01-24 02:06:22 -0500 commented question catkin messages and node in same package

I noticed that the messages and services are generated after the library builds, for that reason it cant be found. However i call generate_messages before add_executable

2013-01-24 01:57:45 -0500 commented question catkin messages and node in same package

@KruseT, thanks for your answer, i inspected the cmake and i dont think its a typo

2013-01-24 00:48:29 -0500 received badge  Famous Question (source)
2013-01-24 00:45:10 -0500 asked a question catkin messages and node in same package

Hi,

While working on some ROS node we bumped into the following problem:

We got a package containing a library, messages and services, the library is using these messages and services

The header files of the services and messages are generated succesfully, however when building the library, the error occurs that the header files of the messages and services are not found.

Is this due to the fact that services and messages should not be in a same packages as library or node?

the error looks like

header.h:34:27: fatal error: ns/header.h: No such file or directory compilation terminated.

Thank in advance

2013-01-20 23:59:15 -0500 received badge  Notable Question (source)
2013-01-14 07:26:57 -0500 received badge  Popular Question (source)
2013-01-10 23:53:14 -0500 received badge  Supporter (source)
2013-01-10 23:51:52 -0500 received badge  Scholar (source)
2013-01-09 23:14:19 -0500 answered a question groovy rosconsole error

@KruseT

Thanks that works like a charm.

2013-01-09 22:48:21 -0500 asked a question groovy rosconsole error

I noticed ROS Groovy is no longer in beta and I wanted to try catkin with groovy. I am able to create a new package using catkin. Also i am able to include "ros/ros.h" in my code but whenever I use anything from ros I something get an error like:

beginner_tutorials_node.cpp:(.text+0x13): undefined reference to `ros::console::g_initialized'
beginner_tutorials_node.cpp:(.text+0x23): undefined reference to `ros::console::initialize()'
beginner_tutorials_node.cpp:(.text+0x6c): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
beginner_tutorials_node.cpp:(.text+0xa7): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
beginner_tutorials_node.cpp:(.text+0xb1): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
beginner_tutorials_node.cpp:(.text+0xfc): undefined reference to `ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
collect2: ld returned 1 exit status

my code:

#include "ros/ros.h"
#include "ros/console.h"
#include "ros/assert.h"
#include "ros/static_assert.h"    

int main(int argc, char ** argv)
{
    ROS_INFO("string");
    return 0;
}

my cmake_lists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## 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 COMPONENTS roscpp std_msgs rosconsole roscpp_serialization message_generation rostime)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)

## Uncomment this if the package has a setup.py. This macro ensures
## modules and scripts declared therein get install#include <ros/console.h>ed
# catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################

## Generate messages in the 'msg' folder
# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
#   DEPENDENCIES
#   std_msgs
# )

###################################################
## Declare things to be passed to other projects ##
###################################################

## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
   INCLUDE_DIRS include
#  LIBRARIES beginner_tutorials
   CATKIN_DEPENDS roscpp std_msgs rosconsole roscpp_serialization message_generation rostime 
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
include_directories(include
  ${catkin_INCLUDE_DIRS}
)

## Declare a cpp library
# add_library(beginner_tutorials
#   src/${PROJECT_NAME}/beginner_tutorials.cpp
# )

## Declare a cpp executable
 add_executable(beginner_tutorials_node src/beginner_tutorials_node.cpp)

## Add dependencies to the executable
# add_dependencies(beginner_tutorials_node ${PROJECT_NAME})

## Specify libraries to link a library or executable target against
# target_link_libraries(beginner_tutorials_node
#   ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

## Mark executable scripts (Python etc.) for installation
## not required for python when using catkin_python_setup()
# install(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS beginner_tutorials beginner_tutorials_node
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#   FILES_MATCHING PATTERN "*.h"
#   PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
#   # myfile1
#   # myfile2
#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME ...
(more)