$search
00001 """autogenerated by genmsg_py from Ray.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class Ray(roslib.message.Message): 00009 _md5sum = "6f48ec72d454524509d80bbcf717e192" 00010 _type = "pr2_object_manipulation_msgs/Ray" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# Represents a ray through space. 00013 # Could probably move to a more general location 00014 00015 Header header 00016 00017 # the origin of the ray 00018 geometry_msgs/Point origin 00019 00020 # the direction of the ray 00021 geometry_msgs/Vector3 direction 00022 ================================================================================ 00023 MSG: std_msgs/Header 00024 # Standard metadata for higher-level stamped data types. 00025 # This is generally used to communicate timestamped data 00026 # in a particular coordinate frame. 00027 # 00028 # sequence ID: consecutively increasing ID 00029 uint32 seq 00030 #Two-integer timestamp that is expressed as: 00031 # * stamp.secs: seconds (stamp_secs) since epoch 00032 # * stamp.nsecs: nanoseconds since stamp_secs 00033 # time-handling sugar is provided by the client library 00034 time stamp 00035 #Frame this data is associated with 00036 # 0: no frame 00037 # 1: global frame 00038 string frame_id 00039 00040 ================================================================================ 00041 MSG: geometry_msgs/Point 00042 # This contains the position of a point in free space 00043 float64 x 00044 float64 y 00045 float64 z 00046 00047 ================================================================================ 00048 MSG: geometry_msgs/Vector3 00049 # This represents a vector in free space. 00050 00051 float64 x 00052 float64 y 00053 float64 z 00054 """ 00055 __slots__ = ['header','origin','direction'] 00056 _slot_types = ['Header','geometry_msgs/Point','geometry_msgs/Vector3'] 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,origin,direction 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(Ray, self).__init__(*args, **kwds) 00074 #message fields cannot be None, assign default values for those that are 00075 if self.header is None: 00076 self.header = std_msgs.msg._Header.Header() 00077 if self.origin is None: 00078 self.origin = geometry_msgs.msg.Point() 00079 if self.direction is None: 00080 self.direction = geometry_msgs.msg.Vector3() 00081 else: 00082 self.header = std_msgs.msg._Header.Header() 00083 self.origin = geometry_msgs.msg.Point() 00084 self.direction = geometry_msgs.msg.Vector3() 00085 00086 def _get_types(self): 00087 """ 00088 internal API method 00089 """ 00090 return self._slot_types 00091 00092 def serialize(self, buff): 00093 """ 00094 serialize message into buffer 00095 @param buff: buffer 00096 @type buff: StringIO 00097 """ 00098 try: 00099 _x = self 00100 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00101 _x = self.header.frame_id 00102 length = len(_x) 00103 buff.write(struct.pack('<I%ss'%length, length, _x)) 00104 _x = self 00105 buff.write(_struct_6d.pack(_x.origin.x, _x.origin.y, _x.origin.z, _x.direction.x, _x.direction.y, _x.direction.z)) 00106 except struct.error as se: self._check_types(se) 00107 except TypeError as te: self._check_types(te) 00108 00109 def deserialize(self, str): 00110 """ 00111 unpack serialized message in str into this message instance 00112 @param str: byte array of serialized message 00113 @type str: str 00114 """ 00115 try: 00116 if self.header is None: 00117 self.header = std_msgs.msg._Header.Header() 00118 if self.origin is None: 00119 self.origin = geometry_msgs.msg.Point() 00120 if self.direction is None: 00121 self.direction = geometry_msgs.msg.Vector3() 00122 end = 0 00123 _x = self 00124 start = end 00125 end += 12 00126 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 self.header.frame_id = str[start:end] 00133 _x = self 00134 start = end 00135 end += 48 00136 (_x.origin.x, _x.origin.y, _x.origin.z, _x.direction.x, _x.direction.y, _x.direction.z,) = _struct_6d.unpack(str[start:end]) 00137 return self 00138 except struct.error as e: 00139 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00140 00141 00142 def serialize_numpy(self, buff, numpy): 00143 """ 00144 serialize message with numpy array types into buffer 00145 @param buff: buffer 00146 @type buff: StringIO 00147 @param numpy: numpy python module 00148 @type numpy module 00149 """ 00150 try: 00151 _x = self 00152 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00153 _x = self.header.frame_id 00154 length = len(_x) 00155 buff.write(struct.pack('<I%ss'%length, length, _x)) 00156 _x = self 00157 buff.write(_struct_6d.pack(_x.origin.x, _x.origin.y, _x.origin.z, _x.direction.x, _x.direction.y, _x.direction.z)) 00158 except struct.error as se: self._check_types(se) 00159 except TypeError as te: self._check_types(te) 00160 00161 def deserialize_numpy(self, str, numpy): 00162 """ 00163 unpack serialized message in str into this message instance using numpy for array types 00164 @param str: byte array of serialized message 00165 @type str: str 00166 @param numpy: numpy python module 00167 @type numpy: module 00168 """ 00169 try: 00170 if self.header is None: 00171 self.header = std_msgs.msg._Header.Header() 00172 if self.origin is None: 00173 self.origin = geometry_msgs.msg.Point() 00174 if self.direction is None: 00175 self.direction = geometry_msgs.msg.Vector3() 00176 end = 0 00177 _x = self 00178 start = end 00179 end += 12 00180 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00181 start = end 00182 end += 4 00183 (length,) = _struct_I.unpack(str[start:end]) 00184 start = end 00185 end += length 00186 self.header.frame_id = str[start:end] 00187 _x = self 00188 start = end 00189 end += 48 00190 (_x.origin.x, _x.origin.y, _x.origin.z, _x.direction.x, _x.direction.y, _x.direction.z,) = _struct_6d.unpack(str[start:end]) 00191 return self 00192 except struct.error as e: 00193 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00194 00195 _struct_I = roslib.message.struct_I 00196 _struct_3I = struct.Struct("<3I") 00197 _struct_6d = struct.Struct("<6d")