Class: Actionlib_msgs::GoalStatus
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Actionlib_msgs::GoalStatus
- Defined in:
- lib/actionlib_msgs/GoalStatus.rb
Constant Summary collapse
- PENDING =
Pseudo-constants
0
- ACTIVE =
1
- PREEMPTED =
2
- SUCCEEDED =
3
- ABORTED =
4
- REJECTED =
5
- PREEMPTING =
6
- RECALLING =
7
- RECALLED =
8
- LOST =
9
- @@struct_C =
::ROS::Struct.new("C")
- @@struct_L2 =
::ROS::Struct.new("L2")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['actionlib_msgs/GoalID','uint8','string']
Instance Attribute Summary collapse
-
#goal_id ⇒ Object
Returns the value of attribute goal_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#text ⇒ Object
Returns the value of attribute text.
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 = {}) ⇒ GoalStatus
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ GoalStatus
Constructor. You can set the default values using keyword operators.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 88 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:goal_id] @goal_id = args[:goal_id] else @goal_id = Actionlib_msgs::GoalID.new end if args[:status] @status = args[:status] else @status = 0 end if args[:text] @text = args[:text] else @text = '' end end |
Instance Attribute Details
#goal_id ⇒ Object
Returns the value of attribute goal_id.
74 75 76 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 74 def goal_id @goal_id end |
#status ⇒ Object
Returns the value of attribute status.
74 75 76 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 74 def status @status end |
#text ⇒ Object
Returns the value of attribute text.
74 75 76 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 74 def text @text end |
Class Method Details
.md5sum ⇒ Object
10 11 12 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 10 def self.md5sum "d388f9b87b3c471f784434d671988d4a" end |
.type ⇒ Object
14 15 16 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 14 def self.type "actionlib_msgs/GoalStatus" end |
Instance Method Details
#_get_types ⇒ String
internal API method
109 110 111 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 109 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
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 133 def deserialize(str) begin if @goal_id == nil @goal_id = Actionlib_msgs::GoalID.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L2') (@goal_id.stamp.secs, @goal_id.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 @goal_id.id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (@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 @text = str[start..(end_point-1)] return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
18 19 20 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 18 def has_header? false end |
#message_definition ⇒ Object
22 23 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 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 22 def "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
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/actionlib_msgs/GoalStatus.rb', line 115 def serialize(buff) begin buff.write(@@struct_L2.pack(@goal_id.stamp.secs, @goal_id.stamp.nsecs)) _x = @goal_id.id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_C.pack(@status)) _x = @text length = _x.length buff.write([length, _x].pack("La#{length}")) rescue => exception raise "some erro in serialize: #{exception}" end end |