Class: Pr2_controllers_msgs::Pr2GripperCommandGoal

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb

Constant Summary collapse

@@struct_d2 =
::ROS::Struct.new("d2")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['pr2_controllers_msgs/Pr2GripperCommand']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Pr2GripperCommandGoal

Constructor. You can set the default values using keyword operators.

Parameters:

  • args (Hash) (defaults to: {})

    keyword for initializing values

Options Hash (args):



43
44
45
46
47
48
49
50
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 43

def initialize(args={})
  # message fields cannot be None, assign default values for those that are
  if args[:command]
    @command = args[:command]
  else
    @command = Pr2_controllers_msgs::Pr2GripperCommand.new
  end
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



32
33
34
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 32

def command
  @command
end

Class Method Details

.md5sumObject



9
10
11
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 9

def self.md5sum
  "86fd82f4ddc48a4cb6856cfa69217e43"
end

.typeObject



13
14
15
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 13

def self.type
  "pr2_controllers_msgs/Pr2GripperCommandGoal"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



54
55
56
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 54

def _get_types
  @slot_types
end

#deserialize(str) ⇒ Object

unpack serialized message in str into this message instance

@param [String] str: byte array of serialized message


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 71

def deserialize(str)

  begin
    if @command == nil
      @command = Pr2_controllers_msgs::Pr2GripperCommand.new
    end
    end_point = 0
    start = end_point
    end_point += ROS::Struct::calc_size('d2')
    (@command.position, @command.max_effort,) = @@struct_d2.unpack(str[start..(end_point-1)])
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 17

def has_header?
  false
end

#message_definitionObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 21

def message_definition
  "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
pr2_controllers_msgs/Pr2GripperCommand command

================================================================================
MSG: pr2_controllers_msgs/Pr2GripperCommand
float64 position
float64 max_effort

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



60
61
62
63
64
65
66
67
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandGoal.rb', line 60

def serialize(buff)
  begin
    buff.write(@@struct_d2.pack(@command.position, @command.max_effort))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end