-
 

rosruby package from rosruby repo

rosruby

Package Summary

Tags No category tags.
Version 0.5.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/OTL/rosruby.git
VCS Type git
VCS Version master
Last Updated 2017-08-15
Dev Status UNMAINTAINED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

This package is a Ruby client library for ROS, the Robot Operating System.

Additional Links

Maintainers

  • Takashi Ogura

Authors

  • Takashi Ogura

ROS Ruby Client: rosruby

ROS is Robot Operating System developed by OSRF and open source communities.

This project supports ruby ROS client. You can program intelligent 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.4.3

Requirements

  • ruby (1.8.7/1.9.3)
  • ROS (hydro/groovy)

electric/fuerte

If you are using electric or fuerte, please use v0.2.1.

Install (binary)

sudo apt-get install ros-hydro-rosruby

then you have to source /opt/ros/hydro/setup.bash for ruby library path.

Install from source

Install ROS and ruby first. ROS document is http://ros.org/wiki/ROS/Installation . rosruby uses genrb for message generation. After install genrb, .rb message files are automatically compiled if there are message source package exists in your catkin_ws/src directory.

rosruby uses catkin. If you have not catkin_ws yet, please read this wiki.

$ cd ~/catkin_ws/src
$ git clone https://github.com/OTL/genrb.git
$ git clone https://github.com/OTL/rosruby.git
$ cd ~/catkin_ws
$ catkin_make

Install from source (indigo/jade)

Try indigo-devel branch.

$ cd ~/catkin_ws/src/rosruby
$ git checkout indigo-devel
$ cd ~/catkin_ws
$ catkin_make

Message generation

You must generate ROS msg/srv files for rosruby if the msg/srv packages are not compiled from source. If you are using catkin package, it is easy. Please add below to your package CMakeLists.txt.

find_package(rosruby)
rosruby_generate_messages(message_pkg1 message_pkg2 ...)

Or, you can generate it manually. Please use the msg/srv generation script (rosruby_genmsg.py) in order to generage rosruby messages.

For example, (please replace catkin_ws to your catkin workspace)

$ rosrun rosruby rosruby_genmsg.py geometry_msgs nav_msgs -d ~/catkin_ws/devel/lib/ruby/vendor_ruby/

If you want to generate msg/srv files from source (for example your project), it is automatically generated by genrb.

Sample Source

You can get rosruby sample programs from rosruby_tutorials package.

Subscriber

#!/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

#!/usr/bin/env ruby

require 'ros'
require 'std_msgs/String'

node = ROS::Node.new('/rosruby_sample_publisher')
publisher = node.advertise('/chatter', Std_msgs::String)

msg = Std_msgs::String.new

i = 0
while node.ok?
  msg.data = "Hello, rosruby!: #{i}"
  publisher.publish(msg)
  sleep(1.0)
  i += 1
end

Note

Ruby requires ‘Start with Capital letter’ for class or module names. So please use Std_msgs::String class instead of std_msgs::String. rosruby message compiler automatically generates messages by the rule.

Samples

There are rosruby_common that contains actionlib and tutorials.

Do all tests

Build Status

Install some packages for tests.

$ sudo apt-get install rake gem
$ sudo gem install yard redcarpet simplecov

run tests.

$ rake test

Documents

you can generate API documents using yard. Document generation needs yard and redcarpet. You can install these by gem command like this.

$ gem install yard redcarpet

Then try to generate documentds.

$ rake yard

You can access to the generated documents from here.

catkin and CMakeLists.txt

rosruby’s CMakeLists.txt defines some macros for your package that uses rosruby. you can use these if you add find_package(rosruby) to CMakeLists.txt.

  • rosruby_setup() : setup some macros and variables for rosruby
  • rosruby_generate_messages(message_pkg1 message_okg2 …) : generates rosruby msg/srv files
  • rosruby_add_libraries(files or dirs) : install lib files for devel environment.
CHANGELOG

Changelog for package rosruby

0.5.5 (2013-10-25)

  • add path for message generation (msg and srv)

0.5.4 (2013-10-19)

  • add genrb_pkg.sh again, because binary build fails.

0.5.3 (2013-10-19)

  • remove shell script and use CATKIN_ENV
  • add message_generation depends and add mkdir in macro
  • add genmsg for depends
  • add python executable

0.5.2 (2013-10-03)

  • add setup.py for resolve genrb
  • use genrb_pkg_sh for message generation (because in binary environment, we have to source setup.sh)

0.5.1 (2013-10-02)

  • change msg/srv generation path. it will be same as genrb.
  • export rosruby macros

0.5.0 (2013-10-02)

  • delete samples (please use rosruby_tutorials package)
  • use genrb package

0.4.3 (2013-09-11)

  • set ROS_ROOT environ if it is not set for roslib.package (it requires it)

0.4.2 (2013-09-11)

  • add more depends

0.4.1 (2013-09-10)

  • remove rosrun from message generation for rosruby
  • add import roslib and build_depend roslib in package.xml

0.4.0 (2013-09-10)

  • use catkin_add_hook for ROSLIB environment
  • color local log like rospy/roscpp
    • ERROR/FATAL => red
    • WARN => yellow
  • wait until master connection
  • change genmsg output dir to catkin lib dir

0.3.0 (2013-09-05)

  • catkinized

v0.2.1

  • move libraries rosruby_common, actionlib, tf to other repositories.
  • bug fix of message deserialization of array with size(#32).

v0.2.0

  • add some libraries

v0.1.1

  • first stable release

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged rosruby at Robotics Stack Exchange