Class: Orocos::Async::ROS::Node

Inherits:
TaskContextBase show all
Defined in:
lib/orocos/ros/async.rb

Overview

Async access to ROS nodes

Instance Attribute Summary

Attributes inherited from TaskContextBase

#raise_on_access_error?

Attributes included from ObjectBase::Periodic::ClassMethods

#default_period

Attributes inherited from ObjectBase

#emitting, #event_loop, #name, #options, #pending_adds

Instance Method Summary collapse

Methods inherited from TaskContextBase

#attribute, #call_with_async, #clear_interface, #each_attribute, #each_port, #each_property, #name, #port, #property, #reachable!, #reachable?, #really_add_listener, #ruby_task_context?, #to_async, #to_proxy, to_ruby, #to_ruby, #unreachable!

Methods included from ObjectBase::Periodic

#default_period, #period, #period=

Methods inherited from ObjectBase

#add_listener, define_event, define_events, #disable_emitting, #event, event_names, #event_names, #invalidate_delegator!, #listener?, #listeners, #number_of_listeners, #on_event, #proxy_event, #reachable!, #reachable?, #really_add_listener, #remove_all_listeners, #remove_listener, #remove_proxy_event, #unreachable!, #valid_delegator?, valid_event?, #valid_event?, validate_event, #validate_event, #wait

Constructor Details

#initialize(name_service, server, name, options = Hash.new) ⇒ Node

Returns a new instance of Node



21
22
23
# File 'lib/orocos/ros/async.rb', line 21

def initialize(name_service, server, name, options = Hash.new)
    super(name, options.merge(:name_service => name_service, :server => server, :name => name))
end

Instance Method Details

#access_remote_task_contextObject



40
41
42
# File 'lib/orocos/ros/async.rb', line 40

def access_remote_task_context
    Orocos::ROS::Node.new(@name_service, @server, @name)
end

#configure_delegation(options) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/orocos/ros/async.rb', line 25

def configure_delegation(options)
    options = Kernel.validate_options options,
        :name_service, :server, :name

    @name_service, @server, @name =
        if !valid_delegator?
            [options[:name_service], options[:server], options[:name]]
        else
            [@delegator_obj.name_service, @delegator_obj.server, @delegator_obj.name]
        end
    if !@name_service || !@server || !@name
        raise ArgumentError, "cannot resolve a proper name_service/ROS master/name tuple"
    end
end