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