Bug#833383: ros-std-msgs: split headers and message definitions
Daniele E. Domenichelli
ddomenichelli at drdanz.it
Thu Aug 11 09:24:33 UTC 2016
Hello Jochen,
On 2016-08-10 22:06, Jochen Sprickerhof wrote:
>> It would be useful to be able to do something similar anyway, perhaps
>> find_package(std_msgs COMPONENTS messages), but I think the CMake
>> files
>> are generated and are supposed to be used with catkin and I don't know
>> much about it. Suggestions?
>>
>> Perhaps I'll just add a Findstd_msgs.cmake to my projects...
>
> (old comment)
> Why would you use cmake to find the messages? I would propose to just
> keep them in the canonical directory. Otherwise +1.
I'll try to explain it better...
We have a tool that generates bindings for ROS messages that can be used
with YARP. We don't generate (yet?) libraries for message bindings, and
this means that every module will generate the bindings for the messages
that it actually uses. We use plain CMake (i.e. no catkin involved).
So a "module" project that uses YARP and want to be able to
publish/subscribe ROS messages (for example std_msgs/String and
std_msgs/ColorRGBA.msg), will have a CMakeLists.txt that is similar to
this:
cmake_minimum_required(VERSION 2.8.9)
project(foo)
find_package(YARP REQUIRED)
find_package(std_msgs REQUIRED)
yarp_generate_bindings(GENERATED_SRCS
"${std_msgs_DATAROOTDIR}/std_msgs/msg/String.msg"
"${std_msgs_DATAROOTDIR}/std_msgs/msg/ColorRGBA.msg)
add_executable(foo foo.cpp ${GENERATED_SRCS})
target_link_libraries(${YARP_LIBRARIES})
Neither ROS, nor catkin is involved here, just the msgs files...
> Why not use $CMAKE_INSTALL_DATAROOTDIR or
> $CATKIN_GLOBAL_SHARE_DESTINATION? I don't think we need an extra
> find*.cmake.
$CATKIN_GLOBAL_SHARE_DESTINATION will require catkin therefore I
cannot use it.
$CMAKE_INSTALL_DATAROOTDIR is generated by GNUInstallDirs.cmake and
it is by default "share" (relative) this means that if ROS packages are
not installed in "/usr" (for example because they are installed from
the ROS repository in "/opt") or if CMAKE_INSTALL_PREFIX of the module
is not set to "/usr" (the default value is "/usr/local", therefore it
will have to be set manually), the messages will not be found.
> Maybe we will need some more dependencies
> (or recommends) on this package, like for rosmsg for example and we
> should add it to the ros-core-dev meta package. What do you think?
I agree. Perhaps also the libstd-msgs-dev package should recommend it?
Perhaps should we add an extra meta package ros-core-msgs?
>> Actually I'm already registered and member of the debian-science
>> group,
>> I'm not sure of which permissions I have on the repositories though.
>> perhaps when the patch is ready I can try pushing it...
>
> That's great, you should be able to push this, feel free do go ahead
> :).
It worked! :)
Should I go on and do the same for the other message packages?
Cheers,
Daniele
More information about the debian-science-maintainers
mailing list