class Orocos::ROS::InputTopic
Attributes
The scheme we use for topic connection is to normalize the output topic names as /node/name and then remap the input topics.
This allows to overide the topic name on the input topics
Public Class Methods
Used by InputPortWriteAccess to determine which class should be used to create the writer
# File lib/orocos/ros/topic.rb, line 124 def self.writer_class InputWriter end
Public Instance Methods
This method is part of the connection protocol
Whenever an output is connected to an input, if the receiver object cannot resolve the connection, it calls resolve_connection_from on its target
@param [#publish_on_ros] port the port that should be
published on ROS
@raise [ArgumentError] if the given object cannot be published on
this ROS topic
# File lib/orocos/ros/topic.rb, line 149 def resolve_connection_from(port, options = Hash.new) # Note that we are sure that +port+ is an output. We now 'just' # have to check what kind of output, and act accordingly if port.respond_to?(:publish_on_ros) port.publish_on_ros(topic_name, options) else raise ArgumentError, "I don't know how to connect #{port} to #{self}" end end
This method is part of the connection protocol
Whenever an output is connected to an input, if the receiver object cannot resolve the connection, it calls resolve_disconnection_from on its target
@param [#unpublish_from_ros] port the port that should be
published on ROS
@raise [ArgumentError] if the given object cannot be unpublished from
this ROS topic
# File lib/orocos/ros/topic.rb, line 169 def resolve_disconnection_from(port, options = Hash.new) # Note that we are sure that +port+ is an output. We now 'just' # have to check what kind of output, and act accordingly if port.respond_to?(:unpublish_from_ros) port.unpublish_from_ros(topic_name) else raise ArgumentError, "I don't know how to disconnect #{port} from #{self}" end end
# File lib/orocos/ros/topic.rb, line 128 def to_async(options = Hash.new) if use = options.delete(:use) Orocos::Async::CORBA::InputPort.new(use,self) else to_async(:use => task.to_async(options)) end end
# File lib/orocos/ros/topic.rb, line 135 def to_proxy(options = Hash.new) task.to_proxy(options).port(name,:type => type) end