Class: ROS::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/ros/service.rb

Overview

Super Class of ServiceServer and ServiceClient

Direct Known Subclasses

ServiceClient, ServiceServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caller_id, service_name, service_type) ⇒ Service

Returns a new instance of Service.

Parameters:

  • caller_id (String)

    caller_id of this node

  • service_name (String)

    name of service (String)

  • service_type (class)

    class of Service



21
22
23
24
25
# File 'lib/ros/service.rb', line 21

def initialize(caller_id, service_name, service_type)
  @caller_id = caller_id
  @service_name = service_name
  @service_type = service_type
end

Instance Attribute Details

#caller_idString (readonly)

Returns caller id of this node.

Returns:

  • (String)

    caller id of this node



28
29
30
# File 'lib/ros/service.rb', line 28

def caller_id
  @caller_id
end

#service_nameString (readonly)

Returns service name (like ‘/add_two_ints’).

Returns:

  • (String)

    service name (like ‘/add_two_ints’)



31
32
33
# File 'lib/ros/service.rb', line 31

def service_name
  @service_name
end

#service_typeClass (readonly)

Returns class instance of srv converted class (like Std_msgs/String).

Returns:

  • (Class)

    class instance of srv converted class (like Std_msgs/String)



34
35
36
# File 'lib/ros/service.rb', line 34

def service_type
  @service_type
end