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

cschou's profile - activity

2015-12-03 08:55:52 -0500 received badge  Famous Question (source)
2015-07-11 11:55:29 -0500 received badge  Notable Question (source)
2015-07-10 12:54:36 -0500 commented question Catkin library in Rosbuild package

I did that? It's right under the find_package(...), if this is what you refer to...But you are right, that was indeed needed (perhaps the most important part in order to find the headers in the include folder)

2015-07-10 03:52:19 -0500 commented question Catkin library in Rosbuild package

I was hoping for a "quick" point to some obvious error I had made. Since not the case, I have now updated the question with some code. I have though found a solution in the mean while, but would of course will post the updated info as requested.

2015-07-10 03:50:23 -0500 commented answer Catkin library in Rosbuild package

I actually found a way to resolve the error, thanks to another post with a reply by you. For that, thank you 😀

2015-07-10 03:48:25 -0500 received badge  Popular Question (source)
2015-07-10 01:01:47 -0500 commented answer Catkin library in Rosbuild package

I do have the above in my CMakeList of the Catkin package. However, is there anyway I can check if the header gets installed correctly?

2015-07-09 08:28:59 -0500 asked a question Catkin library in Rosbuild package

Hi All,

UPDATE: I think I might have resolved the issue. I added the "find_package" and "target_link_library" to the rosbuild CMakeLists.txt

I'm in the process of migrating some of my packages from ROSBUILD to CATKIN. Unfortunately, I cannot migrate all of them at the moment. I have migrated a package that builds a library and now I cannot get the rosbuild package that depends on it to compile.

So, my question is: How do I include a library generated in a CATKIN package in a ROSBUILD package?

This is the CMakeList of the CATKIN package building a library:


cmake_minimum_required(VERSION 2.8.3)
project(catkin_library_package)

find_package(catkin REQUIRED COMPONENTS
  roscpp
)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

###################################
## catkin specific configuration ##
###################################
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES myCatkinLibrary
  CATKIN_DEPENDS
  roscpp
)

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

include_directories(
  ${catkin_INCLUDE_DIRS}
  include
)


add_library(myCatkinLibrary myCatkinLibrary.cpp)

target_link_libraries(myCatkinLibrary
                      ${catkin_LIBRARIES}
                      )

install(TARGETS myCatkinLibrary
        ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
        LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
        RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})


install(DIRECTORY include/${PROJECT_NAME}/
        DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
        FILES_MATCHING PATTERN "*.hpp")

And the CMakeList of the Rosbuild package, which includes the library from the catkin package:


cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

SET(CMAKE_VERBOSE_MAKEFILE ON)

# The name of the project.
PROJECT(rosbuild_package)


rosbuild_find_ros_package(actionlib_msgs)
include(${actionlib_msgs_PACKAGE_PATH}/cmake/actionbuild.cmake)

find_package(catkin_library_package)
include_directories(${catkin_library_package_INCLUDE_DIRS})

genaction()

rosbuild_init()

set(LibraryList
    ${LibraryList}
   )

rosbuild_add_boost_directories()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

rosbuild_genmsg()

rosbuild_add_executable(rosbuild_node src/main.cpp)
target_link_libraries(rosbuild_node ${catkin_library_package_LIBRARIES})

The CatkinLibraryPackage contains (amongst other) /include/catkin_library_package/mylibrary.hpp, which I'm trying to include in a ROSBUILD package. The rosbuild_package contains /src/main.cpp which specifies in the top: #include "catkin_library_package/myLibrary.hpp" All names are substitutes.

The catkin package compiles fine, but when trying to compile the ROSBUILD package, it cannot find the mylibrary.hpp file (a header in the catkin package).

UPDATE: I've been trying to find the answer to the question before submitting the question here, but without luck. However, today I somehow came across this post. I added the find_package(CatkinLibraryPackage) and the target_link_libraries(rosbuild_node ${CatkinLibraryPackage_LIBRARIES}) to the CMakeList of the ROSBUILD package. This way, I was able to get the rosbuild package to compile.

Any inputs on whether this is the correct way is appreciated...

Thanks to all for your input!

Best regards Casper

2014-04-01 19:49:36 -0500 asked a question Force msg and srv generation in rosbuild

Hi all,

I am running Hydro and using rosbuild. I need to link two packages (let's call them "MainPack" and "Pack1"), but in order to simplify the interface/dependency i would like to introduce a "Pack1_msgs" to hold the messages and service files. Hence, this package should act as the "interface".

The Pack1_msgs doesn't contain anything else than the msg and srv files - no executable. The problem is, that when I run cmake on this package no msg or srv headers are generated. I do get the "msg_gen" and "srv_gen" folders, but they only contain the "generated" file which states "yes".

How can I force generation of the header files? Is there anything I'm missing here? Do I need any specific dependencies in manifest.xml?

Thanks :D

CMakeList.txt:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

SET(CMAKE_VERBOSE_MAKEFILE ON)

# The name of the project.
PROJECT(pack1_msgs)

rosbuild_init()


rosbuild_genmsg()

rosbuild_gensrv()
2013-12-06 13:17:31 -0500 received badge  Famous Question (source)
2013-12-05 01:50:26 -0500 answered a question Driver for Firgelli controller board

Hi,

Out of curiosity... did you create a ROS-driver for the Firgelli motor driver?

Thanks

Best regards Casper

2013-10-17 23:16:30 -0500 received badge  Notable Question (source)
2013-10-07 00:24:55 -0500 received badge  Popular Question (source)
2013-10-04 09:00:02 -0500 commented answer Building and linking ros library

Perfect!. I don't know why I didn't think of that. Sometimes you can really get so focused at a problem that you really miss the obvious. But your answer was spot on, I just moved the header file to the include folder and it works. Thank you for your help.

2013-10-04 08:57:37 -0500 received badge  Supporter (source)
2013-10-04 08:57:35 -0500 received badge  Scholar (source)
2013-10-04 04:06:55 -0500 commented question Building and linking ros library

Well, the Advertiser.hpp is not in the "NewPackage". Is is in the shared object "libAdvertiser.so" created by the "DeviceHandler" package. So, the Advertiser.hpp is in /DeviceHandler/src/Advertiser.hpp.. Shouldn't I be able to access the headerfile used in a shared object? I should note, that this library stuff is a bit new to me...

2013-10-04 03:36:15 -0500 commented question Building and linking ros library

Hi, sure, that should be in there now...

2013-10-04 03:35:44 -0500 received badge  Editor (source)
2013-10-04 02:39:44 -0500 asked a question Building and linking ros library

Hi All,

I'm trying to rosbuild a library, which will then be included in several other ROS-packages. Right now, I have successfully created the library in "DeviceHandler" package by:

rosbuild_add_library(Advertiser src/Advertiser.cpp)

This library consists of a class (Advertiser.cpp and Advertiser.hpp) I have exported the following flags in the Manifest.xml of "DeviceHandler":

<export>
<cpp cflags="-I${prefix} -I${prefix}/include/ -I${prefix}/include/DeviceHandler/ -I${prefix}/msg_gen/cpp/include/DeviceHandler -I${prefix}/srv_gen/cpp/include/DeviceHandler" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lAdvertiser"/>
</export>

And I have made my new package (let's call it NewPackage) depend on this "DeviceHandler" package - which builds the "libAdvertiser.so".

So far so good, however, when I try to utilise the library (libAdvertiser.so) in the "NewPackage", it simply can't find "Advertiser.hpp" when included inside code.

Inside my main.cpp in "NewPackage" I have:

#include "Advertiser.hpp"

And the compiler fails on this one, with the output:

/home/casper/ros_workspace/MobileManipulator/hardware_reconfig_system/DeviceEmulators/src/GripperEmulator.cpp:26:26: fatal error: Advertiser.hpp: No such file or directory

The DeviceHandler package both builds the library + an executable, but is that the problem?

Also, should I do anything in the CMakeList.txt of "NewPackage" in order to link the library?

I have been searching for a couple of hours for an answer and nothing really seemed to do the trick. Hoping that it is just some detail I'm missing, any help is much appreciated.

Thanks /Casper