rosruby
rosruby copied to clipboard
No module named genrb.generator
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
Does anybody can help me? Thank you!
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...)
ubuntu 14.04 and ros indigo
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
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
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!
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.
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?
You're welcome! I believe it is possible.
I tried it just now. It works. Thank you!
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!
I just had the same error. Problem was I forgot to source the catkin folder setup script.
(Yes I know older question)