00001 """autogenerated by genpy from vrep_common/VrepInfo.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 VrepInfo(genpy.Message):
00010 _md5sum = "66334ab2212d3c89226a89b7a37b2f95"
00011 _type = "vrep_common/VrepInfo"
00012 _has_header = False
00013 _full_text = """std_msgs/Header headerInfo
00014 std_msgs/Int32 simulatorState
00015 std_msgs/Float32 simulationTime
00016 std_msgs/Float32 timeStep
00017
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data
00022 # in a particular coordinate frame.
00023 #
00024 # sequence ID: consecutively increasing ID
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035
00036 ================================================================================
00037 MSG: std_msgs/Int32
00038 int32 data
00039 ================================================================================
00040 MSG: std_msgs/Float32
00041 float32 data
00042 """
00043 __slots__ = ['headerInfo','simulatorState','simulationTime','timeStep']
00044 _slot_types = ['std_msgs/Header','std_msgs/Int32','std_msgs/Float32','std_msgs/Float32']
00045
00046 def __init__(self, *args, **kwds):
00047 """
00048 Constructor. Any message fields that are implicitly/explicitly
00049 set to None will be assigned a default value. The recommend
00050 use is keyword arguments as this is more robust to future message
00051 changes. You cannot mix in-order arguments and keyword arguments.
00052
00053 The available fields are:
00054 headerInfo,simulatorState,simulationTime,timeStep
00055
00056 :param args: complete set of field values, in .msg order
00057 :param kwds: use keyword arguments corresponding to message field names
00058 to set specific fields.
00059 """
00060 if args or kwds:
00061 super(VrepInfo, self).__init__(*args, **kwds)
00062
00063 if self.headerInfo is None:
00064 self.headerInfo = std_msgs.msg.Header()
00065 if self.simulatorState is None:
00066 self.simulatorState = std_msgs.msg.Int32()
00067 if self.simulationTime is None:
00068 self.simulationTime = std_msgs.msg.Float32()
00069 if self.timeStep is None:
00070 self.timeStep = std_msgs.msg.Float32()
00071 else:
00072 self.headerInfo = std_msgs.msg.Header()
00073 self.simulatorState = std_msgs.msg.Int32()
00074 self.simulationTime = std_msgs.msg.Float32()
00075 self.timeStep = std_msgs.msg.Float32()
00076
00077 def _get_types(self):
00078 """
00079 internal API method
00080 """
00081 return self._slot_types
00082
00083 def serialize(self, buff):
00084 """
00085 serialize message into buffer
00086 :param buff: buffer, ``StringIO``
00087 """
00088 try:
00089 _x = self
00090 buff.write(_struct_3I.pack(_x.headerInfo.seq, _x.headerInfo.stamp.secs, _x.headerInfo.stamp.nsecs))
00091 _x = self.headerInfo.frame_id
00092 length = len(_x)
00093 if python3 or type(_x) == unicode:
00094 _x = _x.encode('utf-8')
00095 length = len(_x)
00096 buff.write(struct.pack('<I%ss'%length, length, _x))
00097 _x = self
00098 buff.write(_struct_i2f.pack(_x.simulatorState.data, _x.simulationTime.data, _x.timeStep.data))
00099 except struct.error as se: self._check_types(se)
00100 except TypeError as te: self._check_types(te)
00101
00102 def deserialize(self, str):
00103 """
00104 unpack serialized message in str into this message instance
00105 :param str: byte array of serialized message, ``str``
00106 """
00107 try:
00108 if self.headerInfo is None:
00109 self.headerInfo = std_msgs.msg.Header()
00110 if self.simulatorState is None:
00111 self.simulatorState = std_msgs.msg.Int32()
00112 if self.simulationTime is None:
00113 self.simulationTime = std_msgs.msg.Float32()
00114 if self.timeStep is None:
00115 self.timeStep = std_msgs.msg.Float32()
00116 end = 0
00117 _x = self
00118 start = end
00119 end += 12
00120 (_x.headerInfo.seq, _x.headerInfo.stamp.secs, _x.headerInfo.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 start = end
00125 end += length
00126 if python3:
00127 self.headerInfo.frame_id = str[start:end].decode('utf-8')
00128 else:
00129 self.headerInfo.frame_id = str[start:end]
00130 _x = self
00131 start = end
00132 end += 12
00133 (_x.simulatorState.data, _x.simulationTime.data, _x.timeStep.data,) = _struct_i2f.unpack(str[start:end])
00134 return self
00135 except struct.error as e:
00136 raise genpy.DeserializationError(e)
00137
00138
00139 def serialize_numpy(self, buff, numpy):
00140 """
00141 serialize message with numpy array types into buffer
00142 :param buff: buffer, ``StringIO``
00143 :param numpy: numpy python module
00144 """
00145 try:
00146 _x = self
00147 buff.write(_struct_3I.pack(_x.headerInfo.seq, _x.headerInfo.stamp.secs, _x.headerInfo.stamp.nsecs))
00148 _x = self.headerInfo.frame_id
00149 length = len(_x)
00150 if python3 or type(_x) == unicode:
00151 _x = _x.encode('utf-8')
00152 length = len(_x)
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 _x = self
00155 buff.write(_struct_i2f.pack(_x.simulatorState.data, _x.simulationTime.data, _x.timeStep.data))
00156 except struct.error as se: self._check_types(se)
00157 except TypeError as te: self._check_types(te)
00158
00159 def deserialize_numpy(self, str, numpy):
00160 """
00161 unpack serialized message in str into this message instance using numpy for array types
00162 :param str: byte array of serialized message, ``str``
00163 :param numpy: numpy python module
00164 """
00165 try:
00166 if self.headerInfo is None:
00167 self.headerInfo = std_msgs.msg.Header()
00168 if self.simulatorState is None:
00169 self.simulatorState = std_msgs.msg.Int32()
00170 if self.simulationTime is None:
00171 self.simulationTime = std_msgs.msg.Float32()
00172 if self.timeStep is None:
00173 self.timeStep = std_msgs.msg.Float32()
00174 end = 0
00175 _x = self
00176 start = end
00177 end += 12
00178 (_x.headerInfo.seq, _x.headerInfo.stamp.secs, _x.headerInfo.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 self.headerInfo.frame_id = str[start:end].decode('utf-8')
00186 else:
00187 self.headerInfo.frame_id = str[start:end]
00188 _x = self
00189 start = end
00190 end += 12
00191 (_x.simulatorState.data, _x.simulationTime.data, _x.timeStep.data,) = _struct_i2f.unpack(str[start:end])
00192 return self
00193 except struct.error as e:
00194 raise genpy.DeserializationError(e)
00195
00196 _struct_I = genpy.struct_I
00197 _struct_3I = struct.Struct("<3I")
00198 _struct_i2f = struct.Struct("<i2f")