Class: Actionlib_tutorials::FibonacciFeedback
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Actionlib_tutorials::FibonacciFeedback
- Defined in:
- lib/actionlib_tutorials/FibonacciFeedback.rb
Constant Summary collapse
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['int32[]']
Instance Attribute Summary collapse
-
#sequence ⇒ Object
Returns the value of attribute sequence.
Class Method Summary collapse
Instance Method Summary collapse
-
#_get_types ⇒ String
internal API method.
-
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance @param [String] str: byte array of serialized message.
- #has_header? ⇒ Boolean
-
#initialize(args = {}) ⇒ FibonacciFeedback
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ FibonacciFeedback
Constructor. You can set the default values using keyword operators.
39 40 41 42 43 44 45 46 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 39 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:sequence] @sequence = args[:sequence] else @sequence = [] end end |
Instance Attribute Details
#sequence ⇒ Object
Returns the value of attribute sequence.
29 30 31 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 29 def sequence @sequence end |
Class Method Details
.md5sum ⇒ Object
8 9 10 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 8 def self.md5sum "b81e37d2a31925a0e8ae261a8699cb79" end |
.type ⇒ Object
12 13 14 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 12 def self.type "actionlib_tutorials/FibonacciFeedback" end |
Instance Method Details
#_get_types ⇒ String
internal API method
50 51 52 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 50 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
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 70 def deserialize(str) begin end_point = 0 start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) pattern = "l#{length}" start = end_point end_point += ROS::Struct::calc_size("#{pattern}") @sequence = str[start..(end_point-1)].unpack(pattern) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
16 17 18 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 16 def has_header? false end |
#message_definition ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 20 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== #feedback int32[] sequence " end |
#serialize(buff) ⇒ Object
serialize message into buffer
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/actionlib_tutorials/FibonacciFeedback.rb', line 56 def serialize(buff) begin length = @sequence.length buff.write(@@struct_L.pack(length)) pattern = "l#{length}" buff.write(*@sequence.pack(pattern)) rescue => exception raise "some erro in serialize: #{exception}" end end |