$search
00001 """autogenerated by genmsg_py from MultiDOFJointState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import roslib.rostime 00007 00008 class MultiDOFJointState(roslib.message.Message): 00009 _md5sum = "ddd04f13c06870db031db8d5c0a6379d" 00010 _type = "arm_navigation_msgs/MultiDOFJointState" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """#A representation of a multi-dof joint state 00013 time stamp 00014 string[] joint_names 00015 string[] frame_ids 00016 string[] child_frame_ids 00017 geometry_msgs/Pose[] poses 00018 00019 ================================================================================ 00020 MSG: geometry_msgs/Pose 00021 # A representation of pose in free space, composed of postion and orientation. 00022 Point position 00023 Quaternion orientation 00024 00025 ================================================================================ 00026 MSG: geometry_msgs/Point 00027 # This contains the position of a point in free space 00028 float64 x 00029 float64 y 00030 float64 z 00031 00032 ================================================================================ 00033 MSG: geometry_msgs/Quaternion 00034 # This represents an orientation in free space in quaternion form. 00035 00036 float64 x 00037 float64 y 00038 float64 z 00039 float64 w 00040 00041 """ 00042 __slots__ = ['stamp','joint_names','frame_ids','child_frame_ids','poses'] 00043 _slot_types = ['time','string[]','string[]','string[]','geometry_msgs/Pose[]'] 00044 00045 def __init__(self, *args, **kwds): 00046 """ 00047 Constructor. Any message fields that are implicitly/explicitly 00048 set to None will be assigned a default value. The recommend 00049 use is keyword arguments as this is more robust to future message 00050 changes. You cannot mix in-order arguments and keyword arguments. 00051 00052 The available fields are: 00053 stamp,joint_names,frame_ids,child_frame_ids,poses 00054 00055 @param args: complete set of field values, in .msg order 00056 @param kwds: use keyword arguments corresponding to message field names 00057 to set specific fields. 00058 """ 00059 if args or kwds: 00060 super(MultiDOFJointState, self).__init__(*args, **kwds) 00061 #message fields cannot be None, assign default values for those that are 00062 if self.stamp is None: 00063 self.stamp = roslib.rostime.Time() 00064 if self.joint_names is None: 00065 self.joint_names = [] 00066 if self.frame_ids is None: 00067 self.frame_ids = [] 00068 if self.child_frame_ids is None: 00069 self.child_frame_ids = [] 00070 if self.poses is None: 00071 self.poses = [] 00072 else: 00073 self.stamp = roslib.rostime.Time() 00074 self.joint_names = [] 00075 self.frame_ids = [] 00076 self.child_frame_ids = [] 00077 self.poses = [] 00078 00079 def _get_types(self): 00080 """ 00081 internal API method 00082 """ 00083 return self._slot_types 00084 00085 def serialize(self, buff): 00086 """ 00087 serialize message into buffer 00088 @param buff: buffer 00089 @type buff: StringIO 00090 """ 00091 try: 00092 _x = self 00093 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs)) 00094 length = len(self.joint_names) 00095 buff.write(_struct_I.pack(length)) 00096 for val1 in self.joint_names: 00097 length = len(val1) 00098 buff.write(struct.pack('<I%ss'%length, length, val1)) 00099 length = len(self.frame_ids) 00100 buff.write(_struct_I.pack(length)) 00101 for val1 in self.frame_ids: 00102 length = len(val1) 00103 buff.write(struct.pack('<I%ss'%length, length, val1)) 00104 length = len(self.child_frame_ids) 00105 buff.write(_struct_I.pack(length)) 00106 for val1 in self.child_frame_ids: 00107 length = len(val1) 00108 buff.write(struct.pack('<I%ss'%length, length, val1)) 00109 length = len(self.poses) 00110 buff.write(_struct_I.pack(length)) 00111 for val1 in self.poses: 00112 _v1 = val1.position 00113 _x = _v1 00114 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00115 _v2 = val1.orientation 00116 _x = _v2 00117 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00118 except struct.error as se: self._check_types(se) 00119 except TypeError as te: self._check_types(te) 00120 00121 def deserialize(self, str): 00122 """ 00123 unpack serialized message in str into this message instance 00124 @param str: byte array of serialized message 00125 @type str: str 00126 """ 00127 try: 00128 if self.stamp is None: 00129 self.stamp = roslib.rostime.Time() 00130 end = 0 00131 _x = self 00132 start = end 00133 end += 8 00134 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 self.joint_names = [] 00139 for i in range(0, length): 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 start = end 00144 end += length 00145 val1 = str[start:end] 00146 self.joint_names.append(val1) 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 self.frame_ids = [] 00151 for i in range(0, length): 00152 start = end 00153 end += 4 00154 (length,) = _struct_I.unpack(str[start:end]) 00155 start = end 00156 end += length 00157 val1 = str[start:end] 00158 self.frame_ids.append(val1) 00159 start = end 00160 end += 4 00161 (length,) = _struct_I.unpack(str[start:end]) 00162 self.child_frame_ids = [] 00163 for i in range(0, length): 00164 start = end 00165 end += 4 00166 (length,) = _struct_I.unpack(str[start:end]) 00167 start = end 00168 end += length 00169 val1 = str[start:end] 00170 self.child_frame_ids.append(val1) 00171 start = end 00172 end += 4 00173 (length,) = _struct_I.unpack(str[start:end]) 00174 self.poses = [] 00175 for i in range(0, length): 00176 val1 = geometry_msgs.msg.Pose() 00177 _v3 = val1.position 00178 _x = _v3 00179 start = end 00180 end += 24 00181 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00182 _v4 = val1.orientation 00183 _x = _v4 00184 start = end 00185 end += 32 00186 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00187 self.poses.append(val1) 00188 self.stamp.canon() 00189 return self 00190 except struct.error as e: 00191 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00192 00193 00194 def serialize_numpy(self, buff, numpy): 00195 """ 00196 serialize message with numpy array types into buffer 00197 @param buff: buffer 00198 @type buff: StringIO 00199 @param numpy: numpy python module 00200 @type numpy module 00201 """ 00202 try: 00203 _x = self 00204 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs)) 00205 length = len(self.joint_names) 00206 buff.write(_struct_I.pack(length)) 00207 for val1 in self.joint_names: 00208 length = len(val1) 00209 buff.write(struct.pack('<I%ss'%length, length, val1)) 00210 length = len(self.frame_ids) 00211 buff.write(_struct_I.pack(length)) 00212 for val1 in self.frame_ids: 00213 length = len(val1) 00214 buff.write(struct.pack('<I%ss'%length, length, val1)) 00215 length = len(self.child_frame_ids) 00216 buff.write(_struct_I.pack(length)) 00217 for val1 in self.child_frame_ids: 00218 length = len(val1) 00219 buff.write(struct.pack('<I%ss'%length, length, val1)) 00220 length = len(self.poses) 00221 buff.write(_struct_I.pack(length)) 00222 for val1 in self.poses: 00223 _v5 = val1.position 00224 _x = _v5 00225 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00226 _v6 = val1.orientation 00227 _x = _v6 00228 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00229 except struct.error as se: self._check_types(se) 00230 except TypeError as te: self._check_types(te) 00231 00232 def deserialize_numpy(self, str, numpy): 00233 """ 00234 unpack serialized message in str into this message instance using numpy for array types 00235 @param str: byte array of serialized message 00236 @type str: str 00237 @param numpy: numpy python module 00238 @type numpy: module 00239 """ 00240 try: 00241 if self.stamp is None: 00242 self.stamp = roslib.rostime.Time() 00243 end = 0 00244 _x = self 00245 start = end 00246 end += 8 00247 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 self.joint_names = [] 00252 for i in range(0, length): 00253 start = end 00254 end += 4 00255 (length,) = _struct_I.unpack(str[start:end]) 00256 start = end 00257 end += length 00258 val1 = str[start:end] 00259 self.joint_names.append(val1) 00260 start = end 00261 end += 4 00262 (length,) = _struct_I.unpack(str[start:end]) 00263 self.frame_ids = [] 00264 for i in range(0, length): 00265 start = end 00266 end += 4 00267 (length,) = _struct_I.unpack(str[start:end]) 00268 start = end 00269 end += length 00270 val1 = str[start:end] 00271 self.frame_ids.append(val1) 00272 start = end 00273 end += 4 00274 (length,) = _struct_I.unpack(str[start:end]) 00275 self.child_frame_ids = [] 00276 for i in range(0, length): 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 start = end 00281 end += length 00282 val1 = str[start:end] 00283 self.child_frame_ids.append(val1) 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 self.poses = [] 00288 for i in range(0, length): 00289 val1 = geometry_msgs.msg.Pose() 00290 _v7 = val1.position 00291 _x = _v7 00292 start = end 00293 end += 24 00294 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00295 _v8 = val1.orientation 00296 _x = _v8 00297 start = end 00298 end += 32 00299 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00300 self.poses.append(val1) 00301 self.stamp.canon() 00302 return self 00303 except struct.error as e: 00304 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00305 00306 _struct_I = roslib.message.struct_I 00307 _struct_4d = struct.Struct("<4d") 00308 _struct_2I = struct.Struct("<2I") 00309 _struct_3d = struct.Struct("<3d")