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

how to replace rosbuild_link_boost() with the catkin macro

asked 2018-05-09 22:29:24 -0600

frodyteen gravatar image

updated 2018-05-10 01:35:09 -0600

I am trying to convert a rosbuild package(DSP-3000 package source) to catkin package.

Currently on section 1.3 step 5 of this tutorial.

In the old package (rosbuild), the DSP-3000/CMakeLists.txt has the following:

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

rosbuild_init()
rosbuild_add_boost_directories()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

include_directories(cereal_port/include)
rosbuild_add_executable(dsp3000 src/dsp3000.cpp)
target_link_libraries(dsp3000 cereal_port)
rosbuild_link_boost(dsp3000 thread)

add_subdirectory(cereal_port)

The tutorial said If rosbuild macros were used, switch from rosbuild macros to the underlying CMake commands. so, I replaced all the rosbuild macros with catkin macros, shown below:

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


find_package()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

include_directories(cereal_port/include)
add_executable(dsp3000 src/dsp3000.cpp)
target_link_libraries(dsp3000 cereal_port)


add_subdirectory(cereal_port)

Now the next step is to Declare how your targets (C++ binaries) shall be installed. In my case, Can anyone tell me what do I need to add in my DSP-3000/CMakeLists.txt to complete this step?

Also, can anyone check if I did the rosbuild to catkin conversion correctly for this file?

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-10 02:43:36 -0600

gvdhoorn gravatar image

updated 2018-05-10 15:53:57 -0600

Please refer to catkin documentation: C++ system library dependencies. Then follow through to catkin documentation: Building and installing C++ executables.

On both pages, Boost is used as an example.


Edit: I'm slightly confused. Looking at the master branch of ros-drivers/kvh_drivers it already appears to be a Catkin package (CMakeLists.txt here and package.xml here). It was converted in ros-drivers/kvh_drivers#2.

Do you have any specific reason to want to use the indigo branch? I'm not sure why that is still there, as it seems to have lagged behind master quite a bit.


Edit2: I've opened ros-drivers/kvh_drivers#6 to ask the maintainer(s) what the status of the Indigo branch is.


Edit3:

You are right, I was able to build it successfully, then I ran rosrun kvh dsp3000 and it gave me an error shown in this link

that would seem to be a different issue. Let's not mix them.

If your current question was answered, please mark the question as answered by ticking the checkmark.

edit flag offensive delete link more

Comments

Thank you so much for the help, The robot that I am working on uses ubuntu 14.04 Indigo. Therefore, I am trying to download the Indigo release of kvh_drivers.

Also, The master branch is for kinetic version and I tried to build and run it but it gave me an error.

frodyteen gravatar image frodyteen  ( 2018-05-10 15:25:24 -0600 )edit

What makes you think it's "for Kinetic"?

I just built it in an Indigo Docker container and it seems to build fine.

As I don't have the hw, I can't run it, but I would expect it to just work.

What 'error' did it give you?

gvdhoorn gravatar image gvdhoorn  ( 2018-05-10 15:34:11 -0600 )edit

this link You are right, I was able to build it successfully, then I ran rosrun kvh dsp3000 and it gave me an error shown in this link

frodyteen gravatar image frodyteen  ( 2018-05-10 15:47:42 -0600 )edit

That just tells you the package has been released into Kinetic. It doesn't mean it only works on Kinetic.

Please just try to build the master branch on Indigo. It should work.

Be sure to update the launch file with the correct port before you try to start it.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-10 15:49:11 -0600 )edit

And please also make sure to use the correct procedure for building pkgs from source. See #q252478 for an example workflow if needed.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-10 15:52:26 -0600 )edit

Thank you.

frodyteen gravatar image frodyteen  ( 2018-05-10 20:08:26 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-05-09 22:29:24 -0600

Seen: 275 times

Last updated: May 10 '18