Skip to content

No module named genrb.generator #35

Open

Description

@zfxw0206

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!

Activity

  1. OTL commented on Mar 22, 2016

    @OTL
    Owner

    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...)

  2. zfxw0206 commented on Mar 22, 2016

    @zfxw0206
    Author

    ubuntu 14.04 and ros indigo

  3. OTL commented on Mar 22, 2016

    @OTL
    Owner

    i see, i'll check it.
    thanks
    2016/03/22 22:15 "zfxw0206" notifications@github.com:

    ubuntu 14.04 and ros indigo

    —
    You are receiving this because you commented.
    Reply to this email directly or view it on GitHub
    #35 (comment)

  4. OTL commented on Mar 23, 2016

    @OTL
    Owner

    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

  5. zfxw0206 commented on Mar 28, 2016

    @zfxw0206
    Author

    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:

    Subscribers:

    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!

  6. OTL commented on Mar 28, 2016

    @OTL
    Owner

    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.

  7. zfxw0206 commented on Mar 29, 2016

    @zfxw0206
    Author

    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?

  8. OTL commented on Mar 29, 2016

    @OTL
    Owner

    You're welcome!
    I believe it is possible.

  9. zfxw0206 commented on Mar 29, 2016

    @zfxw0206
    Author

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

  10. zfxw0206 commented on Apr 29, 2016

    @zfxw0206
    Author

    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!

  11. nxdefiant commented on Jul 15, 2019

    @nxdefiant

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

    (Yes I know older question)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions