_GPSData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_msgs/GPSData.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 std_msgs.msg
00008 
00009 class GPSData(genpy.Message):
00010   _md5sum = "b71de9435ba6759a86f427d436c58ccb"
00011   _type = "asctec_msgs/GPSData"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# Software License Agreement (BSD License)
00014 #
00015 # Copyright (c) 2010
00016 #  William Morris <morris@ee.ccny.cuny.edu>
00017 #  Ivan Dryanovski <ivan.dryanovski@gmail.com>
00018 # All rights reserved.
00019 #
00020 # Redistribution and use in source and binary forms, with or without
00021 # modification, are permitted provided that the following conditions
00022 # are met:
00023 #
00024 #  * Redistributions of source code must retain the above copyright
00025 #    notice, this list of conditions and the following disclaimer.
00026 #  * Redistributions in binary form must reproduce the above
00027 #    copyright notice, this list of conditions and the following
00028 #    disclaimer in the documentation and/or other materials provided
00029 #    with the distribution.
00030 #  * Neither the name of CCNY Robotics Lab nor the names of its
00031 #    contributors may be used to endorse or promote products derived
00032 #    from this software without specific prior written permission.
00033 #
00034 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00035 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00036 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00037 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00038 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00039 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00040 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00041 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00042 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00043 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00044 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00045 # POSSIBILITY OF SUCH DAMAGE.
00046 
00047 Header header
00048 # latitude/longitude in deg * 10^7
00049 int32 latitude
00050 int32 longitude
00051 
00052 #GPS height in mm
00053 int32 height
00054 
00055 #speed in x (E/W) and y(N/S) in mm/s
00056 int32 speed_x
00057 int32 speed_y
00058 
00059 #GPS heading in deg * 100
00060 int32 heading
00061 
00062 #accuracy estimates in mm and mm/s
00063 int32 horizontal_accuracy
00064 int32 vertical_accuracy
00065 int32 speed_accuracy
00066 
00067 #number of satellite vehicles used in NAV solution
00068 int32 numSV
00069 
00070 #GPS status information; 0x03 = valid GPS fix
00071 int32 status
00072 
00073 ================================================================================
00074 MSG: std_msgs/Header
00075 # Standard metadata for higher-level stamped data types.
00076 # This is generally used to communicate timestamped data 
00077 # in a particular coordinate frame.
00078 # 
00079 # sequence ID: consecutively increasing ID 
00080 uint32 seq
00081 #Two-integer timestamp that is expressed as:
00082 # * stamp.secs: seconds (stamp_secs) since epoch
00083 # * stamp.nsecs: nanoseconds since stamp_secs
00084 # time-handling sugar is provided by the client library
00085 time stamp
00086 #Frame this data is associated with
00087 # 0: no frame
00088 # 1: global frame
00089 string frame_id
00090 
00091 """
00092   __slots__ = ['header','latitude','longitude','height','speed_x','speed_y','heading','horizontal_accuracy','vertical_accuracy','speed_accuracy','numSV','status']
00093   _slot_types = ['std_msgs/Header','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32']
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,latitude,longitude,height,speed_x,speed_y,heading,horizontal_accuracy,vertical_accuracy,speed_accuracy,numSV,status
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(GPSData, 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.latitude is None:
00115         self.latitude = 0
00116       if self.longitude is None:
00117         self.longitude = 0
00118       if self.height is None:
00119         self.height = 0
00120       if self.speed_x is None:
00121         self.speed_x = 0
00122       if self.speed_y is None:
00123         self.speed_y = 0
00124       if self.heading is None:
00125         self.heading = 0
00126       if self.horizontal_accuracy is None:
00127         self.horizontal_accuracy = 0
00128       if self.vertical_accuracy is None:
00129         self.vertical_accuracy = 0
00130       if self.speed_accuracy is None:
00131         self.speed_accuracy = 0
00132       if self.numSV is None:
00133         self.numSV = 0
00134       if self.status is None:
00135         self.status = 0
00136     else:
00137       self.header = std_msgs.msg.Header()
00138       self.latitude = 0
00139       self.longitude = 0
00140       self.height = 0
00141       self.speed_x = 0
00142       self.speed_y = 0
00143       self.heading = 0
00144       self.horizontal_accuracy = 0
00145       self.vertical_accuracy = 0
00146       self.speed_accuracy = 0
00147       self.numSV = 0
00148       self.status = 0
00149 
00150   def _get_types(self):
00151     """
00152     internal API method
00153     """
00154     return self._slot_types
00155 
00156   def serialize(self, buff):
00157     """
00158     serialize message into buffer
00159     :param buff: buffer, ``StringIO``
00160     """
00161     try:
00162       _x = self
00163       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00164       _x = self.header.frame_id
00165       length = len(_x)
00166       if python3 or type(_x) == unicode:
00167         _x = _x.encode('utf-8')
00168         length = len(_x)
00169       buff.write(struct.pack('<I%ss'%length, length, _x))
00170       _x = self
00171       buff.write(_struct_11i.pack(_x.latitude, _x.longitude, _x.height, _x.speed_x, _x.speed_y, _x.heading, _x.horizontal_accuracy, _x.vertical_accuracy, _x.speed_accuracy, _x.numSV, _x.status))
00172     except struct.error as se: self._check_types(se)
00173     except TypeError as te: self._check_types(te)
00174 
00175   def deserialize(self, str):
00176     """
00177     unpack serialized message in str into this message instance
00178     :param str: byte array of serialized message, ``str``
00179     """
00180     try:
00181       if self.header is None:
00182         self.header = std_msgs.msg.Header()
00183       end = 0
00184       _x = self
00185       start = end
00186       end += 12
00187       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00188       start = end
00189       end += 4
00190       (length,) = _struct_I.unpack(str[start:end])
00191       start = end
00192       end += length
00193       if python3:
00194         self.header.frame_id = str[start:end].decode('utf-8')
00195       else:
00196         self.header.frame_id = str[start:end]
00197       _x = self
00198       start = end
00199       end += 44
00200       (_x.latitude, _x.longitude, _x.height, _x.speed_x, _x.speed_y, _x.heading, _x.horizontal_accuracy, _x.vertical_accuracy, _x.speed_accuracy, _x.numSV, _x.status,) = _struct_11i.unpack(str[start:end])
00201       return self
00202     except struct.error as e:
00203       raise genpy.DeserializationError(e) #most likely buffer underfill
00204 
00205 
00206   def serialize_numpy(self, buff, numpy):
00207     """
00208     serialize message with numpy array types into buffer
00209     :param buff: buffer, ``StringIO``
00210     :param numpy: numpy python module
00211     """
00212     try:
00213       _x = self
00214       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00215       _x = self.header.frame_id
00216       length = len(_x)
00217       if python3 or type(_x) == unicode:
00218         _x = _x.encode('utf-8')
00219         length = len(_x)
00220       buff.write(struct.pack('<I%ss'%length, length, _x))
00221       _x = self
00222       buff.write(_struct_11i.pack(_x.latitude, _x.longitude, _x.height, _x.speed_x, _x.speed_y, _x.heading, _x.horizontal_accuracy, _x.vertical_accuracy, _x.speed_accuracy, _x.numSV, _x.status))
00223     except struct.error as se: self._check_types(se)
00224     except TypeError as te: self._check_types(te)
00225 
00226   def deserialize_numpy(self, str, numpy):
00227     """
00228     unpack serialized message in str into this message instance using numpy for array types
00229     :param str: byte array of serialized message, ``str``
00230     :param numpy: numpy python module
00231     """
00232     try:
00233       if self.header is None:
00234         self.header = std_msgs.msg.Header()
00235       end = 0
00236       _x = self
00237       start = end
00238       end += 12
00239       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00240       start = end
00241       end += 4
00242       (length,) = _struct_I.unpack(str[start:end])
00243       start = end
00244       end += length
00245       if python3:
00246         self.header.frame_id = str[start:end].decode('utf-8')
00247       else:
00248         self.header.frame_id = str[start:end]
00249       _x = self
00250       start = end
00251       end += 44
00252       (_x.latitude, _x.longitude, _x.height, _x.speed_x, _x.speed_y, _x.heading, _x.horizontal_accuracy, _x.vertical_accuracy, _x.speed_accuracy, _x.numSV, _x.status,) = _struct_11i.unpack(str[start:end])
00253       return self
00254     except struct.error as e:
00255       raise genpy.DeserializationError(e) #most likely buffer underfill
00256 
00257 _struct_I = genpy.struct_I
00258 _struct_3I = struct.Struct("<3I")
00259 _struct_11i = struct.Struct("<11i")


asctec_msgs
Author(s): William Morris, Ivan Dryanovski, Steven Bellens, Patrick Bouffard et al.
autogenerated on Tue Jan 7 2014 11:04:07