Categories: None [Edit]
rosruby
ROS Ruby Client: rosruby
=======
[ROS](http://ros.org) is Robot Operating System developed by [Willow Garage](http://www.willowgarage.com/) and open source communities.
This project supports ruby ROS client. You can program robots by ruby, very easily.
**Homepage**: http://otl.github.com/rosruby
**Git**: http://github.com/OTL/rosruby
**Author**: Takashi Ogura
**Copyright**: 2012
**License**: new BSD License
**Latest Version**: 0.2.0
Requirements
----------
- ruby (1.8.x/1.9.x)
- ROS (electric/fuerte)
- ROS requires python2.7 or more libraries
Let's start
---------------
Install ROS and ruby first. ROS document is [http://ros.org/wiki/ROS/Installation](http://ros.org/wiki/ROS/Installation) .
You can install ruby by apt.
```bash
$ sudo apt-get install ruby
```
Download rosruby into your ROS_PACKAGE_PATH.
````bash
$ git clone git://github.com/OTL/rosruby.git
```
please add RUBYLIB environment variable, like below (if you are using bash).
```bash
$ echo "export RUBYLIB=`rospack find rosruby`/lib" >> ~/.bashrc
$ source ~/.bashrc
```
To use with precompiled electric release
-----------------------
If you are using precompiled ROS distro, use the msg/srv generation script
(rosruby_genmsg.py)
If you are using ROS from source, it requires just recompile the msg/srv
packages by rosmake rosruby.
```bash
$ rosrun rosruby rosruby_genmsg.py
```
This converts msg/srv to .rb which is needed by sample programs.
If you want to make other packages, add package names for args.
For example,
```bash
$ rosrun rosruby rosruby_genmsg.py geometry_msgs nav_msgs
```
Sample Source
--------------
## Subscriber
```ruby
#!/usr/bin/env ruby
require 'ros'
require 'std_msgs/String'
node = ROS::Node.new('/rosruby/sample_subscriber')
node.subscribe('/chatter', Std_msgs::String) do |msg|
puts "message come! = \'#{msg.data}\'"
end
while node.ok?
node.spin_once
sleep(1)
end
```
## Publisher
```ruby
#!/usr/bin/env ruby
require 'ros'
require 'std_msgs/String'
node = ROS::Node.new('/rosruby/sam...
Total
Ranking: 132,222 of 180,689
Downloads: 4,043
Daily
Ranking: 110,973 of 180,681
Downloads: 1
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|
Depends on
Rank | Downloads | Name |
---|---|---|
16 | 862,884,664 | rake |
Owners
# | Gravatar | Handle |
---|---|---|
1 | OTL |