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

How to add another message generator for new ROS clients

asked 2013-09-21 05:31:32 -0600

updated 2013-09-21 06:01:54 -0600

130s gravatar image

I'm developing ruby ROS message generator genrb. I read http://docs.ros.org/api/genmsg/html/ and this package generates .rb message files if workspace contains msgs source package (like std_msgs).

$ cd catkin_ws/src
$ git clone https://github.com/OTL/genrb.git
$ git clone https://github.com/ros/std_msgs.git
$ catkin_make

This generates devel/lib/ruby/vendor_ruby/std_msgs/*.rb files. This is fine as I designed, if I always use source code of messages (this time, std_msgs).

I want to do this even if there are only binary installed version of messages. I read code of genmsg and it seems difficult. Then, what is the best way for adding developing (not officially supported) ROS clients that needs pre-compiled messages.

If you know some idea, please let me know! thanks.

edit retag flag offensive close merge delete

Comments

What do you mean by source code/binary for messages? Messages are defined by the .msg files and those should always be there, so you should be fine.

dornhege gravatar image dornhege  ( 2013-09-21 09:11:42 -0600 )edit

I mean "binary"

apt-get install ros-hydro-std-msgs
source mean
git clone https://github.com/ros/std_msgs.git
when use apt-get, genmsg does not work..

ogutti gravatar image ogutti  ( 2013-09-23 02:06:17 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-09-21 10:59:27 -0600

Dirk Thomas gravatar image

The generation of messages happens at the compile time of each message package. When you add your Ruby message generator to a workspace and then build everything from source you will have all messages available in Ruby. This is the recommended way provided by genmsg and used by gencpp, genlisp and genpy.

What you are aiming for is not "supported" by the message generation infrastructure. You want to generate Ruby messages after all packages have already been compiled. You can do that by searching for all available messages (using the CLI/API of rosmsg) and generate Ruby messages for them). But this would be completely independent of the genmsg infrastructure and would never work well when those generated files should be integrated into packaging of packages. Therefore I would not recommend that approach.

edit flag offensive delete link more

Comments

thanks. But many people use ROS as debian packages, especially std_msgs or rosgraph_msgs are installed (as debian package) in most cases. So I have to generate ruby message files manually. Because I want to do this in python code, i will use below code or something. You think this is good approach? (API is stable?)

import rosmsg
msgs = rosmsg.list_msgs('std_msgs')
msg in msgs:
  rosmsg.get_msg_text(msg)

ogutti gravatar image ogutti  ( 2013-09-23 02:23:30 -0600 )edit

Yes, that API is considered stable. But even if people have the std_msgs package installed they can build it from source in an overlayed workspace which would generated the generated Ruby files using the genmsg infrastructure.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-09-23 10:35:11 -0600 )edit

Thanks! I know it is able to build from source, but I just guess they does not prefer to do so.

ogutti gravatar image ogutti  ( 2013-09-24 03:20:50 -0600 )edit
0

answered 2016-05-12 05:34:57 -0600

peci1 gravatar image

You could get inspired by rosjava/genjava. They provide a Maven repository with the required Java JAR files compiled from source-installed ROS. So the end-users do not have to install everything from source and just download the pre-built Maven artifacts when needed.

I don't know if Ruby supports a similar mechanism. You have to investigate that.

There is one problem genjava currently has - nobody updates the Maven repo, so if you update your system-installed ROS packages, you lose ability to find the correct versions of the artifacts. But if you cared about the repo, it should be no problem.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-09-21 05:31:32 -0600

Seen: 1,008 times

Last updated: May 12 '16