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