0
$\begingroup$

Rosanswers logo

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.


Originally posted by ogutti on ROS Answers with karma: 55 on 2013-09-21

Post score: 2


Original comments

Comment by dornhege on 2013-09-21:
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.

Comment by ogutti on 2013-09-23:
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..

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Dirk Thomas with karma: 16276 on 2013-09-21

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by ogutti on 2013-09-23:
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)

Comment by Dirk Thomas on 2013-09-23:
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.

Comment by ogutti on 2013-09-24:
Thanks!

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.