Class: Actionlib_tutorials::FibonacciGoal

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/actionlib_tutorials/FibonacciGoal.rb

Constant Summary collapse

@@struct_l =
::ROS::Struct.new("l")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['int32']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ FibonacciGoal

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :order (int32)

    initialize value



38
39
40
41
42
43
44
45
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 38

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

Instance Attribute Details

#orderObject

Returns the value of attribute order.



27
28
29
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 27

def order
  @order
end

Class Method Details

.md5sumObject



8
9
10
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 8

def self.md5sum
  "6889063349a00b249bd1661df429d822"
end

.typeObject



12
13
14
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 12

def self.type
  "actionlib_tutorials/FibonacciGoal"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



49
50
51
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 49

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


66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 66

def deserialize(str)

  begin
    end_point = 0
    start = end_point
    end_point += ROS::Struct::calc_size('l')
    (@order,) = @@struct_l.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)


16
17
18
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 16

def has_header?
  false
end

#message_definitionObject



20
21
22
23
24
25
26
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 20

def message_definition
  "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
#goal definition
int32 order

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



55
56
57
58
59
60
61
62
# File 'lib/actionlib_tutorials/FibonacciGoal.rb', line 55

def serialize(buff)
  begin
    buff.write(@@struct_l.pack(@order))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end