rosruby icon indicating copy to clipboard operation
rosruby copied to clipboard

No module named genrb.generator

Open zfxw0206 opened this issue 8 years ago • 11 comments

I download rosruby and genrb from "https://github.com/OTL/rosruby" and "https://github.com/OTL/genrb" But when I compile them, I got the error message:

Traceback (most recent call last): File "/home/administrator/wspace/src/rosruby/scripts/rosruby_genmsg.py", line 15, in from genrb.generator import msg_generator ImportError: No module named genrb.generator

Does anybody can help me? Thank you!

zfxw0206 avatar Mar 21 '16 18:03 zfxw0206

Hi, thank you for testing rosruby!!!

I have not tested these packages these days, so i dont know if these works well recent ros system.

Could you tell me your environments? OS(ubuntu14.04?osx10.10? or...) and ros distro(indigo?jade? or...)

OTL avatar Mar 22 '16 00:03 OTL

ubuntu 14.04 and ros indigo

zfxw0206 avatar Mar 22 '16 13:03 zfxw0206

i see, i'll check it. thanks 2016/03/22 22:15 "zfxw0206" [email protected]:

ubuntu 14.04 and ros indigo

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/OTL/rosruby/issues/35#issuecomment-199808025

OTL avatar Mar 22 '16 15:03 OTL

I fixed and uploaded as indigo-devel branch.

https://github.com/OTL/rosruby/tree/indigo-devel

Could you try it?

At least it works in develop environment (I mean that ~/catkin_ws/src/rosruby, genrb) on Indigo/ Ubuntu14.04

OTL avatar Mar 23 '16 23:03 OTL

Yes, I tried the publisher and subscriber sample code, it works. Thank you very much! But when I change the message type from string to boolean, there is a problem. Here is my code Publisher: #!/usr/bin/env ruby

require 'ros' require 'std_msgs/Bool'

node = ROS::Node.new('/rosruby_sample_publisher') publisher = node.advertise('/chatter', Std_msgs::Bool) msg = Std_msgs::Bool.new while node.ok? msg.data = 1 publisher.publish(msg) sleep(1.0) end

Subscriber #!/usr/bin/env ruby require 'ros' require 'std_msgs/Bool'

node = ROS::Node.new('/rosruby_sample_subscriber') node.subscribe('/chatter', Std_msgs::Bool) do |msg| puts "message come! = '#{msg.data}'" end while node.ok? node.spin_once sleep(1) end

I ran "rostopic echo /chatter", I could get the data be "true". And when I ran "rostopic info /chatter", I got: Type: std_msgs/Bool Publishers:

  • /rosruby_sample_publisher (http://igr-XPS-8700:57335/)

Subscribers:

  • /rosruby_sample_subscriber (http://igr-XPS-8700:58021/)

After running the subscriber code, it should print "message come! ...", but It print nothing. Can you tell me what is wrong with me? Thank you again!

zfxw0206 avatar Mar 28 '16 18:03 zfxw0206

Oh, that is bug of genrb. I pushed genrb to fix it, could you update genrb, and try to rebuild?

$ cd ~/catkin_ws/src/genrc
$ git pull
$ cd ~/catkin_ws
$ catkin_make

then, you'll able to use bool message like below. (you can use same subscriber)

#!/usr/bin/env ruby

require 'ros'
require 'std_msgs/Bool'

node = ROS::Node.new('/rosruby_sample_publisher')
publisher = node.advertise('/chatter', Std_msgs::Bool)
msg = Std_msgs::Bool.new
while node.ok?
  msg.data = true #<- bool!
  publisher.publish(msg)
  sleep(1.0)
end

Thank you for great contribution! It might have some trouble in more complicated message, i'm very happy if you let me know.

OTL avatar Mar 28 '16 21:03 OTL

Yes, it is working now. Thank you! Now I want to use rosruby to trigger my camera. The sample code is here.This code will set PCIC and send the command to the camera. Is it possible to use rosruby to run this code?

zfxw0206 avatar Mar 29 '16 13:03 zfxw0206

You're welcome! I believe it is possible.

OTL avatar Mar 29 '16 14:03 OTL

I tried it just now. It works. Thank you!

zfxw0206 avatar Mar 29 '16 20:03 zfxw0206

I am sorry, these days, I rebuild my catkin space, I got the same problem "No module named genrb.generator" again. I did nothing with it. Can you help me again? Thank you!

zfxw0206 avatar Apr 29 '16 13:04 zfxw0206

I just had the same error. Problem was I forgot to source the catkin folder setup script.

(Yes I know older question)

nxdefiant avatar Jul 15 '19 19:07 nxdefiant