Class: Actionlib_tutorials::AveragingFeedback
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Actionlib_tutorials::AveragingFeedback
- Defined in:
- lib/actionlib_tutorials/AveragingFeedback.rb
Constant Summary collapse
- @@struct_lf3 =
::ROS::Struct.new("lf3")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['int32','float32','float32','float32']
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#mean ⇒ Object
Returns the value of attribute mean.
-
#sample ⇒ Object
Returns the value of attribute sample.
-
#std_dev ⇒ Object
Returns the value of attribute std_dev.
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 = {}) ⇒ AveragingFeedback
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ AveragingFeedback
Constructor. You can set the default values using keyword operators.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 46 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:sample] @sample = args[:sample] else @sample = 0 end if args[:data] @data = args[:data] else @data = 0.0 end if args[:mean] @mean = args[:mean] else @mean = 0.0 end if args[:std_dev] @std_dev = args[:std_dev] else @std_dev = 0.0 end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
32 33 34 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 32 def data @data end |
#mean ⇒ Object
Returns the value of attribute mean.
32 33 34 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 32 def mean @mean end |
#sample ⇒ Object
Returns the value of attribute sample.
32 33 34 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 32 def sample @sample end |
#std_dev ⇒ Object
Returns the value of attribute std_dev.
32 33 34 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 32 def std_dev @std_dev end |
Class Method Details
.md5sum ⇒ Object
8 9 10 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 8 def self.md5sum "9e8dfc53c2f2a032ca33fa80ec46fd4f" end |
.type ⇒ Object
12 13 14 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 12 def self.type "actionlib_tutorials/AveragingFeedback" end |
Instance Method Details
#_get_types ⇒ String
internal API method
72 73 74 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 72 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
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 89 def deserialize(str) begin end_point = 0 start = end_point end_point += ROS::Struct::calc_size('lf3') (@sample, @data, @mean, @std_dev,) = @@struct_lf3.unpack(str[start..(end_point-1)]) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
16 17 18 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 16 def has_header? false end |
#message_definition ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 20 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== #feedback int32 sample float32 data float32 mean float32 std_dev " end |
#serialize(buff) ⇒ Object
serialize message into buffer
78 79 80 81 82 83 84 85 |
# File 'lib/actionlib_tutorials/AveragingFeedback.rb', line 78 def serialize(buff) begin buff.write(@@struct_lf3.pack(@sample, @data, @mean, @std_dev)) rescue => exception raise "some erro in serialize: #{exception}" end end |