$search
00001 """autogenerated by genmsg_py from cartesian_position.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class cartesian_position(roslib.message.Message): 00007 _md5sum = "cfc3f1750a36a668eb93288ed1128f42" 00008 _type = "sr_robot_msgs/cartesian_position" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string tip_name 00011 float32 tip_pos_x 00012 float32 tip_pos_y 00013 float32 tip_pos_z 00014 float32 tip_orientation_rho 00015 float32 tip_orientation_theta 00016 float32 tip_orientation_sigma 00017 00018 00019 """ 00020 __slots__ = ['tip_name','tip_pos_x','tip_pos_y','tip_pos_z','tip_orientation_rho','tip_orientation_theta','tip_orientation_sigma'] 00021 _slot_types = ['string','float32','float32','float32','float32','float32','float32'] 00022 00023 def __init__(self, *args, **kwds): 00024 """ 00025 Constructor. Any message fields that are implicitly/explicitly 00026 set to None will be assigned a default value. The recommend 00027 use is keyword arguments as this is more robust to future message 00028 changes. You cannot mix in-order arguments and keyword arguments. 00029 00030 The available fields are: 00031 tip_name,tip_pos_x,tip_pos_y,tip_pos_z,tip_orientation_rho,tip_orientation_theta,tip_orientation_sigma 00032 00033 @param args: complete set of field values, in .msg order 00034 @param kwds: use keyword arguments corresponding to message field names 00035 to set specific fields. 00036 """ 00037 if args or kwds: 00038 super(cartesian_position, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.tip_name is None: 00041 self.tip_name = '' 00042 if self.tip_pos_x is None: 00043 self.tip_pos_x = 0. 00044 if self.tip_pos_y is None: 00045 self.tip_pos_y = 0. 00046 if self.tip_pos_z is None: 00047 self.tip_pos_z = 0. 00048 if self.tip_orientation_rho is None: 00049 self.tip_orientation_rho = 0. 00050 if self.tip_orientation_theta is None: 00051 self.tip_orientation_theta = 0. 00052 if self.tip_orientation_sigma is None: 00053 self.tip_orientation_sigma = 0. 00054 else: 00055 self.tip_name = '' 00056 self.tip_pos_x = 0. 00057 self.tip_pos_y = 0. 00058 self.tip_pos_z = 0. 00059 self.tip_orientation_rho = 0. 00060 self.tip_orientation_theta = 0. 00061 self.tip_orientation_sigma = 0. 00062 00063 def _get_types(self): 00064 """ 00065 internal API method 00066 """ 00067 return self._slot_types 00068 00069 def serialize(self, buff): 00070 """ 00071 serialize message into buffer 00072 @param buff: buffer 00073 @type buff: StringIO 00074 """ 00075 try: 00076 _x = self.tip_name 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 _x = self 00080 buff.write(_struct_6f.pack(_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma)) 00081 except struct.error as se: self._check_types(se) 00082 except TypeError as te: self._check_types(te) 00083 00084 def deserialize(self, str): 00085 """ 00086 unpack serialized message in str into this message instance 00087 @param str: byte array of serialized message 00088 @type str: str 00089 """ 00090 try: 00091 end = 0 00092 start = end 00093 end += 4 00094 (length,) = _struct_I.unpack(str[start:end]) 00095 start = end 00096 end += length 00097 self.tip_name = str[start:end] 00098 _x = self 00099 start = end 00100 end += 24 00101 (_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma,) = _struct_6f.unpack(str[start:end]) 00102 return self 00103 except struct.error as e: 00104 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00105 00106 00107 def serialize_numpy(self, buff, numpy): 00108 """ 00109 serialize message with numpy array types into buffer 00110 @param buff: buffer 00111 @type buff: StringIO 00112 @param numpy: numpy python module 00113 @type numpy module 00114 """ 00115 try: 00116 _x = self.tip_name 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 _x = self 00120 buff.write(_struct_6f.pack(_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma)) 00121 except struct.error as se: self._check_types(se) 00122 except TypeError as te: self._check_types(te) 00123 00124 def deserialize_numpy(self, str, numpy): 00125 """ 00126 unpack serialized message in str into this message instance using numpy for array types 00127 @param str: byte array of serialized message 00128 @type str: str 00129 @param numpy: numpy python module 00130 @type numpy: module 00131 """ 00132 try: 00133 end = 0 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 start = end 00138 end += length 00139 self.tip_name = str[start:end] 00140 _x = self 00141 start = end 00142 end += 24 00143 (_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma,) = _struct_6f.unpack(str[start:end]) 00144 return self 00145 except struct.error as e: 00146 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00147 00148 _struct_I = roslib.message.struct_I 00149 _struct_6f = struct.Struct("<6f")