00001 """autogenerated by genpy from door_msgs/Door.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 geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class Door(genpy.Message):
00011 _md5sum = "19464ad3b8e608fe8e2ff8a6ec098603"
00012 _type = "door_msgs/Door"
00013 _has_header = True
00014 _full_text = """Header header
00015 geometry_msgs/Point32 frame_p1 ## position of the door frame
00016 geometry_msgs/Point32 frame_p2 ## position of the door frame
00017 geometry_msgs/Point32 door_p1 ## Ground plane projection of a point on the plane of the door
00018 geometry_msgs/Point32 door_p2 ## Ground plane projection of a point on the plane of the door
00019 geometry_msgs/Point32 handle ## Position of the door handle
00020 float32 height ## Height of the door
00021
00022 int32 UNKNOWN=0
00023
00024 int32 HINGE_P1=1
00025 int32 HINGE_P2=2
00026 int32 hinge
00027
00028 int32 ROT_DIR_CLOCKWISE=1
00029 int32 ROT_DIR_COUNTERCLOCKWISE=2
00030 int32 rot_dir
00031
00032 int32 LOCKED=1
00033 int32 LATCHED=2
00034 int32 UNLATCHED=3
00035 int32 latch_state
00036
00037 geometry_msgs/Vector3 travel_dir ## vector pointing in the direction the robot is going to travel through the door
00038 float32 weight ## @Sachin: what do we use this for?
00039
00040
00041
00042 ================================================================================
00043 MSG: std_msgs/Header
00044 # Standard metadata for higher-level stamped data types.
00045 # This is generally used to communicate timestamped data
00046 # in a particular coordinate frame.
00047 #
00048 # sequence ID: consecutively increasing ID
00049 uint32 seq
00050 #Two-integer timestamp that is expressed as:
00051 # * stamp.secs: seconds (stamp_secs) since epoch
00052 # * stamp.nsecs: nanoseconds since stamp_secs
00053 # time-handling sugar is provided by the client library
00054 time stamp
00055 #Frame this data is associated with
00056 # 0: no frame
00057 # 1: global frame
00058 string frame_id
00059
00060 ================================================================================
00061 MSG: geometry_msgs/Point32
00062 # This contains the position of a point in free space(with 32 bits of precision).
00063 # It is recommeded to use Point wherever possible instead of Point32.
00064 #
00065 # This recommendation is to promote interoperability.
00066 #
00067 # This message is designed to take up less space when sending
00068 # lots of points at once, as in the case of a PointCloud.
00069
00070 float32 x
00071 float32 y
00072 float32 z
00073 ================================================================================
00074 MSG: geometry_msgs/Vector3
00075 # This represents a vector in free space.
00076
00077 float64 x
00078 float64 y
00079 float64 z
00080 """
00081
00082 UNKNOWN = 0
00083 HINGE_P1 = 1
00084 HINGE_P2 = 2
00085 ROT_DIR_CLOCKWISE = 1
00086 ROT_DIR_COUNTERCLOCKWISE = 2
00087 LOCKED = 1
00088 LATCHED = 2
00089 UNLATCHED = 3
00090
00091 __slots__ = ['header','frame_p1','frame_p2','door_p1','door_p2','handle','height','hinge','rot_dir','latch_state','travel_dir','weight']
00092 _slot_types = ['std_msgs/Header','geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','float32','int32','int32','int32','geometry_msgs/Vector3','float32']
00093
00094 def __init__(self, *args, **kwds):
00095 """
00096 Constructor. Any message fields that are implicitly/explicitly
00097 set to None will be assigned a default value. The recommend
00098 use is keyword arguments as this is more robust to future message
00099 changes. You cannot mix in-order arguments and keyword arguments.
00100
00101 The available fields are:
00102 header,frame_p1,frame_p2,door_p1,door_p2,handle,height,hinge,rot_dir,latch_state,travel_dir,weight
00103
00104 :param args: complete set of field values, in .msg order
00105 :param kwds: use keyword arguments corresponding to message field names
00106 to set specific fields.
00107 """
00108 if args or kwds:
00109 super(Door, self).__init__(*args, **kwds)
00110
00111 if self.header is None:
00112 self.header = std_msgs.msg.Header()
00113 if self.frame_p1 is None:
00114 self.frame_p1 = geometry_msgs.msg.Point32()
00115 if self.frame_p2 is None:
00116 self.frame_p2 = geometry_msgs.msg.Point32()
00117 if self.door_p1 is None:
00118 self.door_p1 = geometry_msgs.msg.Point32()
00119 if self.door_p2 is None:
00120 self.door_p2 = geometry_msgs.msg.Point32()
00121 if self.handle is None:
00122 self.handle = geometry_msgs.msg.Point32()
00123 if self.height is None:
00124 self.height = 0.
00125 if self.hinge is None:
00126 self.hinge = 0
00127 if self.rot_dir is None:
00128 self.rot_dir = 0
00129 if self.latch_state is None:
00130 self.latch_state = 0
00131 if self.travel_dir is None:
00132 self.travel_dir = geometry_msgs.msg.Vector3()
00133 if self.weight is None:
00134 self.weight = 0.
00135 else:
00136 self.header = std_msgs.msg.Header()
00137 self.frame_p1 = geometry_msgs.msg.Point32()
00138 self.frame_p2 = geometry_msgs.msg.Point32()
00139 self.door_p1 = geometry_msgs.msg.Point32()
00140 self.door_p2 = geometry_msgs.msg.Point32()
00141 self.handle = geometry_msgs.msg.Point32()
00142 self.height = 0.
00143 self.hinge = 0
00144 self.rot_dir = 0
00145 self.latch_state = 0
00146 self.travel_dir = geometry_msgs.msg.Vector3()
00147 self.weight = 0.
00148
00149 def _get_types(self):
00150 """
00151 internal API method
00152 """
00153 return self._slot_types
00154
00155 def serialize(self, buff):
00156 """
00157 serialize message into buffer
00158 :param buff: buffer, ``StringIO``
00159 """
00160 try:
00161 _x = self
00162 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00163 _x = self.header.frame_id
00164 length = len(_x)
00165 if python3 or type(_x) == unicode:
00166 _x = _x.encode('utf-8')
00167 length = len(_x)
00168 buff.write(struct.pack('<I%ss'%length, length, _x))
00169 _x = self
00170 buff.write(_struct_16f3i3df.pack(_x.frame_p1.x, _x.frame_p1.y, _x.frame_p1.z, _x.frame_p2.x, _x.frame_p2.y, _x.frame_p2.z, _x.door_p1.x, _x.door_p1.y, _x.door_p1.z, _x.door_p2.x, _x.door_p2.y, _x.door_p2.z, _x.handle.x, _x.handle.y, _x.handle.z, _x.height, _x.hinge, _x.rot_dir, _x.latch_state, _x.travel_dir.x, _x.travel_dir.y, _x.travel_dir.z, _x.weight))
00171 except struct.error as se: self._check_types(se)
00172 except TypeError as te: self._check_types(te)
00173
00174 def deserialize(self, str):
00175 """
00176 unpack serialized message in str into this message instance
00177 :param str: byte array of serialized message, ``str``
00178 """
00179 try:
00180 if self.header is None:
00181 self.header = std_msgs.msg.Header()
00182 if self.frame_p1 is None:
00183 self.frame_p1 = geometry_msgs.msg.Point32()
00184 if self.frame_p2 is None:
00185 self.frame_p2 = geometry_msgs.msg.Point32()
00186 if self.door_p1 is None:
00187 self.door_p1 = geometry_msgs.msg.Point32()
00188 if self.door_p2 is None:
00189 self.door_p2 = geometry_msgs.msg.Point32()
00190 if self.handle is None:
00191 self.handle = geometry_msgs.msg.Point32()
00192 if self.travel_dir is None:
00193 self.travel_dir = geometry_msgs.msg.Vector3()
00194 end = 0
00195 _x = self
00196 start = end
00197 end += 12
00198 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 start = end
00203 end += length
00204 if python3:
00205 self.header.frame_id = str[start:end].decode('utf-8')
00206 else:
00207 self.header.frame_id = str[start:end]
00208 _x = self
00209 start = end
00210 end += 104
00211 (_x.frame_p1.x, _x.frame_p1.y, _x.frame_p1.z, _x.frame_p2.x, _x.frame_p2.y, _x.frame_p2.z, _x.door_p1.x, _x.door_p1.y, _x.door_p1.z, _x.door_p2.x, _x.door_p2.y, _x.door_p2.z, _x.handle.x, _x.handle.y, _x.handle.z, _x.height, _x.hinge, _x.rot_dir, _x.latch_state, _x.travel_dir.x, _x.travel_dir.y, _x.travel_dir.z, _x.weight,) = _struct_16f3i3df.unpack(str[start:end])
00212 return self
00213 except struct.error as e:
00214 raise genpy.DeserializationError(e)
00215
00216
00217 def serialize_numpy(self, buff, numpy):
00218 """
00219 serialize message with numpy array types into buffer
00220 :param buff: buffer, ``StringIO``
00221 :param numpy: numpy python module
00222 """
00223 try:
00224 _x = self
00225 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00226 _x = self.header.frame_id
00227 length = len(_x)
00228 if python3 or type(_x) == unicode:
00229 _x = _x.encode('utf-8')
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 _x = self
00233 buff.write(_struct_16f3i3df.pack(_x.frame_p1.x, _x.frame_p1.y, _x.frame_p1.z, _x.frame_p2.x, _x.frame_p2.y, _x.frame_p2.z, _x.door_p1.x, _x.door_p1.y, _x.door_p1.z, _x.door_p2.x, _x.door_p2.y, _x.door_p2.z, _x.handle.x, _x.handle.y, _x.handle.z, _x.height, _x.hinge, _x.rot_dir, _x.latch_state, _x.travel_dir.x, _x.travel_dir.y, _x.travel_dir.z, _x.weight))
00234 except struct.error as se: self._check_types(se)
00235 except TypeError as te: self._check_types(te)
00236
00237 def deserialize_numpy(self, str, numpy):
00238 """
00239 unpack serialized message in str into this message instance using numpy for array types
00240 :param str: byte array of serialized message, ``str``
00241 :param numpy: numpy python module
00242 """
00243 try:
00244 if self.header is None:
00245 self.header = std_msgs.msg.Header()
00246 if self.frame_p1 is None:
00247 self.frame_p1 = geometry_msgs.msg.Point32()
00248 if self.frame_p2 is None:
00249 self.frame_p2 = geometry_msgs.msg.Point32()
00250 if self.door_p1 is None:
00251 self.door_p1 = geometry_msgs.msg.Point32()
00252 if self.door_p2 is None:
00253 self.door_p2 = geometry_msgs.msg.Point32()
00254 if self.handle is None:
00255 self.handle = geometry_msgs.msg.Point32()
00256 if self.travel_dir is None:
00257 self.travel_dir = geometry_msgs.msg.Vector3()
00258 end = 0
00259 _x = self
00260 start = end
00261 end += 12
00262 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00263 start = end
00264 end += 4
00265 (length,) = _struct_I.unpack(str[start:end])
00266 start = end
00267 end += length
00268 if python3:
00269 self.header.frame_id = str[start:end].decode('utf-8')
00270 else:
00271 self.header.frame_id = str[start:end]
00272 _x = self
00273 start = end
00274 end += 104
00275 (_x.frame_p1.x, _x.frame_p1.y, _x.frame_p1.z, _x.frame_p2.x, _x.frame_p2.y, _x.frame_p2.z, _x.door_p1.x, _x.door_p1.y, _x.door_p1.z, _x.door_p2.x, _x.door_p2.y, _x.door_p2.z, _x.handle.x, _x.handle.y, _x.handle.z, _x.height, _x.hinge, _x.rot_dir, _x.latch_state, _x.travel_dir.x, _x.travel_dir.y, _x.travel_dir.z, _x.weight,) = _struct_16f3i3df.unpack(str[start:end])
00276 return self
00277 except struct.error as e:
00278 raise genpy.DeserializationError(e)
00279
00280 _struct_I = genpy.struct_I
00281 _struct_3I = struct.Struct("<3I")
00282 _struct_16f3i3df = struct.Struct("<16f3i3df")