Class: Actionlib_msgs::GoalStatusArray
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Actionlib_msgs::GoalStatusArray
- Defined in:
- lib/actionlib_msgs/GoalStatusArray.rb
Constant Summary collapse
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_C =
::ROS::Struct.new("C")
- @@struct_L2 =
::ROS::Struct.new("L2")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['Header','actionlib_msgs/GoalStatus[]']
Instance Attribute Summary collapse
-
#header ⇒ Object
Returns the value of attribute header.
-
#status_list ⇒ Object
Returns the value of attribute status_list.
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 = {}) ⇒ GoalStatusArray
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ GoalStatusArray
Constructor. You can set the default values using keyword operators.
104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 104 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:header] @header = args[:header] else @header = Std_msgs::Header.new end if args[:status_list] @status_list = args[:status_list] else @status_list = [] end end |
Instance Attribute Details
#header ⇒ Object
Returns the value of attribute header.
90 91 92 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 90 def header @header end |
#status_list ⇒ Object
Returns the value of attribute status_list.
90 91 92 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 90 def status_list @status_list end |
Class Method Details
.md5sum ⇒ Object
12 13 14 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 12 def self.md5sum "8b2b82f13216d0a8ea88bd3af735e619" end |
.type ⇒ Object
16 17 18 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 16 def self.type "actionlib_msgs/GoalStatusArray" end |
Instance Method Details
#_get_types ⇒ String
internal API method
120 121 122 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 120 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
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 155 def deserialize(str) begin if @header == nil @header = Std_msgs::Header.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@header.seq, @header.stamp.secs, @header.stamp.nsecs,) = @@struct_L3.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 @header.frame_id = str[start..(end_point-1)] start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) @status_list = [] length.times do val1 = Actionlib_msgs::GoalStatus.new _v3 = val1.goal_id _v4 = _v3.stamp _x = _v4 start = end_point end_point += ROS::Struct::calc_size('L2') (_x.secs, _x.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 _v3.id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (val1.status,) = @@struct_C.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 val1.text = str[start..(end_point-1)] @status_list.push(val1) end return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
20 21 22 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 20 def has_header? true end |
#message_definition ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 24 def "# Stores the statuses for goals that are currently being tracked # by an action server Header header GoalStatus[] status_list ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: actionlib_msgs/GoalStatus GoalID goal_id uint8 status uint8 PENDING = 0 # The goal has yet to be processed by the action server uint8 ACTIVE = 1 # The goal is currently being processed by the action server uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing # and has since completed its execution (Terminal State) uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) uint8 ABORTED = 4 # The goal was aborted during execution by the action server due # to some failure (Terminal State) uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, # because the goal was unattainable or invalid (Terminal State) uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing # and has not yet completed execution uint8 RECALLING = 7 # The goal received a cancel request before it started executing, # but the action server has not yet confirmed that the goal is canceled uint8 RECALLED = 8 # The goal received a cancel request before it started executing # and was successfully cancelled (Terminal State) uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be # sent over the wire by an action server #Allow for the user to associate a string with GoalStatus for debugging string text ================================================================================ MSG: actionlib_msgs/GoalID # 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
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/actionlib_msgs/GoalStatusArray.rb', line 126 def serialize(buff) begin buff.write(@@struct_L3.pack(@header.seq, @header.stamp.secs, @header.stamp.nsecs)) _x = @header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) length = @status_list.length buff.write(@@struct_L.pack(length)) for val1 in @status_list _v1 = val1.goal_id _v2 = _v1.stamp _x = _v2 buff.write(@@struct_L2.pack(_x.secs, _x.nsecs)) _x = _v1.id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_C.pack(val1.status)) _x = val1.text length = _x.length buff.write([length, _x].pack("La#{length}")) end rescue => exception raise "some erro in serialize: #{exception}" end end |