You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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:
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?
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!
Activity
OTL commentedon Mar 22, 2016
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...)
zfxw0206 commentedon Mar 22, 2016
ubuntu 14.04 and ros indigo
OTL commentedon Mar 22, 2016
i see, i'll check it.
thanks
2016/03/22 22:15 "zfxw0206" notifications@github.com:
OTL commentedon Mar 23, 2016
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
zfxw0206 commentedon Mar 28, 2016
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!
OTL commentedon Mar 28, 2016
Oh, that is bug of genrb.
I pushed genrb to fix it, could you update genrb, and try to rebuild?
then, you'll able to use bool message like below.
(you can use same subscriber)
Thank you for great contribution!
It might have some trouble in more complicated message, i'm very happy if you let me know.
zfxw0206 commentedon Mar 29, 2016
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?
OTL commentedon Mar 29, 2016
You're welcome!
I believe it is possible.
zfxw0206 commentedon Mar 29, 2016
I tried it just now. It works. Thank you!
zfxw0206 commentedon Apr 29, 2016
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!
nxdefiant commentedon Jul 15, 2019
I just had the same error. Problem was I forgot to source the catkin folder setup script.
(Yes I know older question)