00001 """autogenerated by genpy from pr2_image_snapshot_recorder/ImageSnapshotActionGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import genpy
00008 import actionlib_msgs.msg
00009 import pr2_image_snapshot_recorder.msg
00010 import std_msgs.msg
00011
00012 class ImageSnapshotActionGoal(genpy.Message):
00013 _md5sum = "791851620f50b626c4203adfad24a063"
00014 _type = "pr2_image_snapshot_recorder/ImageSnapshotActionGoal"
00015 _has_header = True
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 Header header
00019 actionlib_msgs/GoalID goal_id
00020 ImageSnapshotGoal goal
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalID
00042 # The stamp should store the time at which this goal was requested.
00043 # It is used by an action server when it tries to preempt all
00044 # goals that were requested before a certain time
00045 time stamp
00046
00047 # The id provides a way to associate feedback and
00048 # result message with specific goal requests. The id
00049 # specified must be unique.
00050 string id
00051
00052
00053 ================================================================================
00054 MSG: pr2_image_snapshot_recorder/ImageSnapshotGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 string topic_name # Topic name, must be of sensor_msgs/Image
00057 int32 num_images # Set <0 to record until prempted
00058 string output_file_name # Default: /hwlog/TOPIC_NAME_DATE_TIME.bag
00059
00060 """
00061 __slots__ = ['header','goal_id','goal']
00062 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','pr2_image_snapshot_recorder/ImageSnapshotGoal']
00063
00064 def __init__(self, *args, **kwds):
00065 """
00066 Constructor. Any message fields that are implicitly/explicitly
00067 set to None will be assigned a default value. The recommend
00068 use is keyword arguments as this is more robust to future message
00069 changes. You cannot mix in-order arguments and keyword arguments.
00070
00071 The available fields are:
00072 header,goal_id,goal
00073
00074 :param args: complete set of field values, in .msg order
00075 :param kwds: use keyword arguments corresponding to message field names
00076 to set specific fields.
00077 """
00078 if args or kwds:
00079 super(ImageSnapshotActionGoal, self).__init__(*args, **kwds)
00080
00081 if self.header is None:
00082 self.header = std_msgs.msg.Header()
00083 if self.goal_id is None:
00084 self.goal_id = actionlib_msgs.msg.GoalID()
00085 if self.goal is None:
00086 self.goal = pr2_image_snapshot_recorder.msg.ImageSnapshotGoal()
00087 else:
00088 self.header = std_msgs.msg.Header()
00089 self.goal_id = actionlib_msgs.msg.GoalID()
00090 self.goal = pr2_image_snapshot_recorder.msg.ImageSnapshotGoal()
00091
00092 def _get_types(self):
00093 """
00094 internal API method
00095 """
00096 return self._slot_types
00097
00098 def serialize(self, buff):
00099 """
00100 serialize message into buffer
00101 :param buff: buffer, ``StringIO``
00102 """
00103 try:
00104 _x = self
00105 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00106 _x = self.header.frame_id
00107 length = len(_x)
00108 if python3 or type(_x) == unicode:
00109 _x = _x.encode('utf-8')
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 _x = self
00113 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00114 _x = self.goal_id.id
00115 length = len(_x)
00116 if python3 or type(_x) == unicode:
00117 _x = _x.encode('utf-8')
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 _x = self.goal.topic_name
00121 length = len(_x)
00122 if python3 or type(_x) == unicode:
00123 _x = _x.encode('utf-8')
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 buff.write(_struct_i.pack(self.goal.num_images))
00127 _x = self.goal.output_file_name
00128 length = len(_x)
00129 if python3 or type(_x) == unicode:
00130 _x = _x.encode('utf-8')
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 except struct.error as se: self._check_types(se)
00134 except TypeError as te: self._check_types(te)
00135
00136 def deserialize(self, str):
00137 """
00138 unpack serialized message in str into this message instance
00139 :param str: byte array of serialized message, ``str``
00140 """
00141 try:
00142 if self.header is None:
00143 self.header = std_msgs.msg.Header()
00144 if self.goal_id is None:
00145 self.goal_id = actionlib_msgs.msg.GoalID()
00146 if self.goal is None:
00147 self.goal = pr2_image_snapshot_recorder.msg.ImageSnapshotGoal()
00148 end = 0
00149 _x = self
00150 start = end
00151 end += 12
00152 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 start = end
00157 end += length
00158 if python3:
00159 self.header.frame_id = str[start:end].decode('utf-8')
00160 else:
00161 self.header.frame_id = str[start:end]
00162 _x = self
00163 start = end
00164 end += 8
00165 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00166 start = end
00167 end += 4
00168 (length,) = _struct_I.unpack(str[start:end])
00169 start = end
00170 end += length
00171 if python3:
00172 self.goal_id.id = str[start:end].decode('utf-8')
00173 else:
00174 self.goal_id.id = str[start:end]
00175 start = end
00176 end += 4
00177 (length,) = _struct_I.unpack(str[start:end])
00178 start = end
00179 end += length
00180 if python3:
00181 self.goal.topic_name = str[start:end].decode('utf-8')
00182 else:
00183 self.goal.topic_name = str[start:end]
00184 start = end
00185 end += 4
00186 (self.goal.num_images,) = _struct_i.unpack(str[start:end])
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 if python3:
00193 self.goal.output_file_name = str[start:end].decode('utf-8')
00194 else:
00195 self.goal.output_file_name = str[start:end]
00196 return self
00197 except struct.error as e:
00198 raise genpy.DeserializationError(e)
00199
00200
00201 def serialize_numpy(self, buff, numpy):
00202 """
00203 serialize message with numpy array types into buffer
00204 :param buff: buffer, ``StringIO``
00205 :param numpy: numpy python module
00206 """
00207 try:
00208 _x = self
00209 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00210 _x = self.header.frame_id
00211 length = len(_x)
00212 if python3 or type(_x) == unicode:
00213 _x = _x.encode('utf-8')
00214 length = len(_x)
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 _x = self
00217 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00218 _x = self.goal_id.id
00219 length = len(_x)
00220 if python3 or type(_x) == unicode:
00221 _x = _x.encode('utf-8')
00222 length = len(_x)
00223 buff.write(struct.pack('<I%ss'%length, length, _x))
00224 _x = self.goal.topic_name
00225 length = len(_x)
00226 if python3 or type(_x) == unicode:
00227 _x = _x.encode('utf-8')
00228 length = len(_x)
00229 buff.write(struct.pack('<I%ss'%length, length, _x))
00230 buff.write(_struct_i.pack(self.goal.num_images))
00231 _x = self.goal.output_file_name
00232 length = len(_x)
00233 if python3 or type(_x) == unicode:
00234 _x = _x.encode('utf-8')
00235 length = len(_x)
00236 buff.write(struct.pack('<I%ss'%length, length, _x))
00237 except struct.error as se: self._check_types(se)
00238 except TypeError as te: self._check_types(te)
00239
00240 def deserialize_numpy(self, str, numpy):
00241 """
00242 unpack serialized message in str into this message instance using numpy for array types
00243 :param str: byte array of serialized message, ``str``
00244 :param numpy: numpy python module
00245 """
00246 try:
00247 if self.header is None:
00248 self.header = std_msgs.msg.Header()
00249 if self.goal_id is None:
00250 self.goal_id = actionlib_msgs.msg.GoalID()
00251 if self.goal is None:
00252 self.goal = pr2_image_snapshot_recorder.msg.ImageSnapshotGoal()
00253 end = 0
00254 _x = self
00255 start = end
00256 end += 12
00257 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 if python3:
00264 self.header.frame_id = str[start:end].decode('utf-8')
00265 else:
00266 self.header.frame_id = str[start:end]
00267 _x = self
00268 start = end
00269 end += 8
00270 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 start = end
00275 end += length
00276 if python3:
00277 self.goal_id.id = str[start:end].decode('utf-8')
00278 else:
00279 self.goal_id.id = str[start:end]
00280 start = end
00281 end += 4
00282 (length,) = _struct_I.unpack(str[start:end])
00283 start = end
00284 end += length
00285 if python3:
00286 self.goal.topic_name = str[start:end].decode('utf-8')
00287 else:
00288 self.goal.topic_name = str[start:end]
00289 start = end
00290 end += 4
00291 (self.goal.num_images,) = _struct_i.unpack(str[start:end])
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 start = end
00296 end += length
00297 if python3:
00298 self.goal.output_file_name = str[start:end].decode('utf-8')
00299 else:
00300 self.goal.output_file_name = str[start:end]
00301 return self
00302 except struct.error as e:
00303 raise genpy.DeserializationError(e)
00304
00305 _struct_I = genpy.struct_I
00306 _struct_i = struct.Struct("<i")
00307 _struct_3I = struct.Struct("<3I")
00308 _struct_2I = struct.Struct("<2I")