class Orocos::ROS::ROS_XMLRPC

Common handling for the ROS master/slave API

Attributes

caller_id[R]
String

the caller ID for this process

server[R]
XMLRPC::Client

The remote server

Public Class Methods

new(uri, caller_id) click to toggle source
# File lib/orocos/ros/rpc.rb, line 46
def initialize(uri, caller_id)
    @server = XMLRPC::Client.new2(uri)
    @caller_id = caller_id
end

Public Instance Methods

call(method_name, *args) click to toggle source
# File lib/orocos/ros/rpc.rb, line 51
def call(method_name, *args)
    code, status_msg, result = server.call(method_name, *args)
    if code == -1
        raise ArgumentError, status_msg
    elsif code == 0
        raise CallFailed, status_msg
    else
        result
    end
rescue Errno::ECONNREFUSED, Errno::EPIPE, Errno::ECONNRESET => e
    raise ComError, e.message, e.backtrace
end