Class: Actionlib_msgs::GoalID
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Actionlib_msgs::GoalID
- Defined in:
- lib/actionlib_msgs/GoalID.rb
Constant Summary collapse
- @@struct_L2 =
::ROS::Struct.new("L2")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['time','string']
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#stamp ⇒ Object
Returns the value of attribute stamp.
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 = {}) ⇒ GoalID
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ GoalID
Constructor. You can set the default values using keyword operators.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/actionlib_msgs/GoalID.rb', line 47 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:stamp] @stamp = args[:stamp] else @stamp = ROS::Time.new end if args[:id] @id = args[:id] else @id = '' end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
35 36 37 |
# File 'lib/actionlib_msgs/GoalID.rb', line 35 def id @id end |
#stamp ⇒ Object
Returns the value of attribute stamp.
35 36 37 |
# File 'lib/actionlib_msgs/GoalID.rb', line 35 def stamp @stamp end |
Class Method Details
.md5sum ⇒ Object
9 10 11 |
# File 'lib/actionlib_msgs/GoalID.rb', line 9 def self.md5sum "302881f31927c1df708a2dbab0e80ee8" end |
.type ⇒ Object
13 14 15 |
# File 'lib/actionlib_msgs/GoalID.rb', line 13 def self.type "actionlib_msgs/GoalID" end |
Instance Method Details
#_get_types ⇒ String
internal API method
63 64 65 |
# File 'lib/actionlib_msgs/GoalID.rb', line 63 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
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/actionlib_msgs/GoalID.rb', line 83 def deserialize(str) begin if @stamp == nil @stamp = ROS::Time.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L2') (@stamp.secs, @stamp.nsecs,) = @@struct_L2.unpack(str[start..(end_point-1)]) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @id = str[start..(end_point-1)] return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
17 18 19 |
# File 'lib/actionlib_msgs/GoalID.rb', line 17 def has_header? false end |
#message_definition ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/actionlib_msgs/GoalID.rb', line 21 def "# The stamp should store the time at which this goal was requested. # It is used by an action server when it tries to preempt all # goals that were requested before a certain time time stamp # The id provides a way to associate feedback and # result message with specific goal requests. The id # specified must be unique. string id " end |
#serialize(buff) ⇒ Object
serialize message into buffer
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/actionlib_msgs/GoalID.rb', line 69 def serialize(buff) begin buff.write(@@struct_L2.pack(@stamp.secs, @stamp.nsecs)) _x = @id length = _x.length buff.write([length, _x].pack("La#{length}")) rescue => exception raise "some erro in serialize: #{exception}" end end |