_GpsCustom.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_hl_comm/GpsCustom.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 sensor_msgs.msg
00008 import std_msgs.msg
00009 
00010 class GpsCustom(genpy.Message):
00011   _md5sum = "ea845c87e3fc5ff92a4bebb639327746"
00012   _type = "asctec_hl_comm/GpsCustom"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# Navigation Satellite fix for any Global Navigation Satellite System
00015 #
00016 # Specified using the WGS 84 reference ellipsoid
00017 
00018 # Header specifies ROS time and frame of reference for this fix.
00019 Header header
00020 
00021 # satellite fix status information
00022 sensor_msgs/NavSatStatus status
00023 
00024 # Latitude [degrees]. Positive is north of equator; negative is south.
00025 float64 latitude
00026 
00027 # Longitude [degrees]. Positive is east of prime meridian; negative is west.
00028 float64 longitude
00029 
00030 # Altitude [m]. Positive is above the WGS 84 ellipsoid.
00031 float64 altitude
00032 
00033 # Position covariance [m^2] defined relative to a tangential plane
00034 # through the reported position. The components are East, North, and
00035 # Up (ENU), in row-major order.
00036 #
00037 # Beware: this coordinate system exhibits singularities at the poles.
00038 
00039 float64[9] position_covariance
00040 
00041 uint8 position_covariance_type
00042 
00043 float64 pressure_height
00044 
00045 float64 velocity_x
00046 float64 velocity_y
00047 float64[4] velocity_covariance
00048 ================================================================================
00049 MSG: std_msgs/Header
00050 # Standard metadata for higher-level stamped data types.
00051 # This is generally used to communicate timestamped data 
00052 # in a particular coordinate frame.
00053 # 
00054 # sequence ID: consecutively increasing ID 
00055 uint32 seq
00056 #Two-integer timestamp that is expressed as:
00057 # * stamp.secs: seconds (stamp_secs) since epoch
00058 # * stamp.nsecs: nanoseconds since stamp_secs
00059 # time-handling sugar is provided by the client library
00060 time stamp
00061 #Frame this data is associated with
00062 # 0: no frame
00063 # 1: global frame
00064 string frame_id
00065 
00066 ================================================================================
00067 MSG: sensor_msgs/NavSatStatus
00068 # Navigation Satellite fix status for any Global Navigation Satellite System
00069 
00070 # Whether to output an augmented fix is determined by both the fix
00071 # type and the last time differential corrections were received.  A
00072 # fix is valid when status >= STATUS_FIX.
00073 
00074 int8 STATUS_NO_FIX =  -1        # unable to fix position
00075 int8 STATUS_FIX =      0        # unaugmented fix
00076 int8 STATUS_SBAS_FIX = 1        # with satellite-based augmentation
00077 int8 STATUS_GBAS_FIX = 2        # with ground-based augmentation
00078 
00079 int8 status
00080 
00081 # Bits defining which Global Navigation Satellite System signals were
00082 # used by the receiver.
00083 
00084 uint16 SERVICE_GPS =     1
00085 uint16 SERVICE_GLONASS = 2
00086 uint16 SERVICE_COMPASS = 4      # includes BeiDou.
00087 uint16 SERVICE_GALILEO = 8
00088 
00089 uint16 service
00090 
00091 """
00092   __slots__ = ['header','status','latitude','longitude','altitude','position_covariance','position_covariance_type','pressure_height','velocity_x','velocity_y','velocity_covariance']
00093   _slot_types = ['std_msgs/Header','sensor_msgs/NavSatStatus','float64','float64','float64','float64[9]','uint8','float64','float64','float64','float64[4]']
00094 
00095   def __init__(self, *args, **kwds):
00096     """
00097     Constructor. Any message fields that are implicitly/explicitly
00098     set to None will be assigned a default value. The recommend
00099     use is keyword arguments as this is more robust to future message
00100     changes.  You cannot mix in-order arguments and keyword arguments.
00101 
00102     The available fields are:
00103        header,status,latitude,longitude,altitude,position_covariance,position_covariance_type,pressure_height,velocity_x,velocity_y,velocity_covariance
00104 
00105     :param args: complete set of field values, in .msg order
00106     :param kwds: use keyword arguments corresponding to message field names
00107     to set specific fields.
00108     """
00109     if args or kwds:
00110       super(GpsCustom, self).__init__(*args, **kwds)
00111       #message fields cannot be None, assign default values for those that are
00112       if self.header is None:
00113         self.header = std_msgs.msg.Header()
00114       if self.status is None:
00115         self.status = sensor_msgs.msg.NavSatStatus()
00116       if self.latitude is None:
00117         self.latitude = 0.
00118       if self.longitude is None:
00119         self.longitude = 0.
00120       if self.altitude is None:
00121         self.altitude = 0.
00122       if self.position_covariance is None:
00123         self.position_covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
00124       if self.position_covariance_type is None:
00125         self.position_covariance_type = 0
00126       if self.pressure_height is None:
00127         self.pressure_height = 0.
00128       if self.velocity_x is None:
00129         self.velocity_x = 0.
00130       if self.velocity_y is None:
00131         self.velocity_y = 0.
00132       if self.velocity_covariance is None:
00133         self.velocity_covariance = [0.,0.,0.,0.]
00134     else:
00135       self.header = std_msgs.msg.Header()
00136       self.status = sensor_msgs.msg.NavSatStatus()
00137       self.latitude = 0.
00138       self.longitude = 0.
00139       self.altitude = 0.
00140       self.position_covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
00141       self.position_covariance_type = 0
00142       self.pressure_height = 0.
00143       self.velocity_x = 0.
00144       self.velocity_y = 0.
00145       self.velocity_covariance = [0.,0.,0.,0.]
00146 
00147   def _get_types(self):
00148     """
00149     internal API method
00150     """
00151     return self._slot_types
00152 
00153   def serialize(self, buff):
00154     """
00155     serialize message into buffer
00156     :param buff: buffer, ``StringIO``
00157     """
00158     try:
00159       _x = self
00160       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00161       _x = self.header.frame_id
00162       length = len(_x)
00163       if python3 or type(_x) == unicode:
00164         _x = _x.encode('utf-8')
00165         length = len(_x)
00166       buff.write(struct.pack('<I%ss'%length, length, _x))
00167       _x = self
00168       buff.write(_struct_bH3d.pack(_x.status.status, _x.status.service, _x.latitude, _x.longitude, _x.altitude))
00169       buff.write(_struct_9d.pack(*self.position_covariance))
00170       _x = self
00171       buff.write(_struct_B3d.pack(_x.position_covariance_type, _x.pressure_height, _x.velocity_x, _x.velocity_y))
00172       buff.write(_struct_4d.pack(*self.velocity_covariance))
00173     except struct.error as se: self._check_types(se)
00174     except TypeError as te: self._check_types(te)
00175 
00176   def deserialize(self, str):
00177     """
00178     unpack serialized message in str into this message instance
00179     :param str: byte array of serialized message, ``str``
00180     """
00181     try:
00182       if self.header is None:
00183         self.header = std_msgs.msg.Header()
00184       if self.status is None:
00185         self.status = sensor_msgs.msg.NavSatStatus()
00186       end = 0
00187       _x = self
00188       start = end
00189       end += 12
00190       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       start = end
00195       end += length
00196       if python3:
00197         self.header.frame_id = str[start:end].decode('utf-8')
00198       else:
00199         self.header.frame_id = str[start:end]
00200       _x = self
00201       start = end
00202       end += 27
00203       (_x.status.status, _x.status.service, _x.latitude, _x.longitude, _x.altitude,) = _struct_bH3d.unpack(str[start:end])
00204       start = end
00205       end += 72
00206       self.position_covariance = _struct_9d.unpack(str[start:end])
00207       _x = self
00208       start = end
00209       end += 25
00210       (_x.position_covariance_type, _x.pressure_height, _x.velocity_x, _x.velocity_y,) = _struct_B3d.unpack(str[start:end])
00211       start = end
00212       end += 32
00213       self.velocity_covariance = _struct_4d.unpack(str[start:end])
00214       return self
00215     except struct.error as e:
00216       raise genpy.DeserializationError(e) #most likely buffer underfill
00217 
00218 
00219   def serialize_numpy(self, buff, numpy):
00220     """
00221     serialize message with numpy array types into buffer
00222     :param buff: buffer, ``StringIO``
00223     :param numpy: numpy python module
00224     """
00225     try:
00226       _x = self
00227       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00228       _x = self.header.frame_id
00229       length = len(_x)
00230       if python3 or type(_x) == unicode:
00231         _x = _x.encode('utf-8')
00232         length = len(_x)
00233       buff.write(struct.pack('<I%ss'%length, length, _x))
00234       _x = self
00235       buff.write(_struct_bH3d.pack(_x.status.status, _x.status.service, _x.latitude, _x.longitude, _x.altitude))
00236       buff.write(self.position_covariance.tostring())
00237       _x = self
00238       buff.write(_struct_B3d.pack(_x.position_covariance_type, _x.pressure_height, _x.velocity_x, _x.velocity_y))
00239       buff.write(self.velocity_covariance.tostring())
00240     except struct.error as se: self._check_types(se)
00241     except TypeError as te: self._check_types(te)
00242 
00243   def deserialize_numpy(self, str, numpy):
00244     """
00245     unpack serialized message in str into this message instance using numpy for array types
00246     :param str: byte array of serialized message, ``str``
00247     :param numpy: numpy python module
00248     """
00249     try:
00250       if self.header is None:
00251         self.header = std_msgs.msg.Header()
00252       if self.status is None:
00253         self.status = sensor_msgs.msg.NavSatStatus()
00254       end = 0
00255       _x = self
00256       start = end
00257       end += 12
00258       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00259       start = end
00260       end += 4
00261       (length,) = _struct_I.unpack(str[start:end])
00262       start = end
00263       end += length
00264       if python3:
00265         self.header.frame_id = str[start:end].decode('utf-8')
00266       else:
00267         self.header.frame_id = str[start:end]
00268       _x = self
00269       start = end
00270       end += 27
00271       (_x.status.status, _x.status.service, _x.latitude, _x.longitude, _x.altitude,) = _struct_bH3d.unpack(str[start:end])
00272       start = end
00273       end += 72
00274       self.position_covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00275       _x = self
00276       start = end
00277       end += 25
00278       (_x.position_covariance_type, _x.pressure_height, _x.velocity_x, _x.velocity_y,) = _struct_B3d.unpack(str[start:end])
00279       start = end
00280       end += 32
00281       self.velocity_covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
00282       return self
00283     except struct.error as e:
00284       raise genpy.DeserializationError(e) #most likely buffer underfill
00285 
00286 _struct_I = genpy.struct_I
00287 _struct_B3d = struct.Struct("<B3d")
00288 _struct_4d = struct.Struct("<4d")
00289 _struct_3I = struct.Struct("<3I")
00290 _struct_bH3d = struct.Struct("<bH3d")
00291 _struct_9d = struct.Struct("<9d")


asctec_hl_comm
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Jan 7 2014 11:05:05