$search
00001 """autogenerated by genmsg_py from JointAnglesWithSpeedActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import nao_msgs.msg 00006 import roslib.rostime 00007 import actionlib_msgs.msg 00008 import std_msgs.msg 00009 00010 class JointAnglesWithSpeedActionGoal(roslib.message.Message): 00011 _md5sum = "9b722e9749aa53fc0e8ca7aa12e95efb" 00012 _type = "nao_msgs/JointAnglesWithSpeedActionGoal" 00013 _has_header = True #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 Header header 00017 actionlib_msgs/GoalID goal_id 00018 JointAnglesWithSpeedGoal goal 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: actionlib_msgs/GoalID 00040 # The stamp should store the time at which this goal was requested. 00041 # It is used by an action server when it tries to preempt all 00042 # goals that were requested before a certain time 00043 time stamp 00044 00045 # The id provides a way to associate feedback and 00046 # result message with specific goal requests. The id 00047 # specified must be unique. 00048 string id 00049 00050 00051 ================================================================================ 00052 MSG: nao_msgs/JointAnglesWithSpeedGoal 00053 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00054 # goal: a registered body pose name 00055 nao_msgs/JointAnglesWithSpeed joint_angles 00056 00057 ================================================================================ 00058 MSG: nao_msgs/JointAnglesWithSpeed 00059 Header header 00060 00061 # A list of joint names, corresponding to their names in the Nao docs. 00062 # This must be either the same lenght of joint_angles or 1 if it's a 00063 # keyword such as 'Body' (for all angles) 00064 string[] joint_names 00065 float32[] joint_angles 00066 00067 #fraction of max joint velocity [0:1] 00068 float32 speed 00069 00070 # Absolute angle(=0, default) or relative change 00071 uint8 relative 00072 00073 """ 00074 __slots__ = ['header','goal_id','goal'] 00075 _slot_types = ['Header','actionlib_msgs/GoalID','nao_msgs/JointAnglesWithSpeedGoal'] 00076 00077 def __init__(self, *args, **kwds): 00078 """ 00079 Constructor. Any message fields that are implicitly/explicitly 00080 set to None will be assigned a default value. The recommend 00081 use is keyword arguments as this is more robust to future message 00082 changes. You cannot mix in-order arguments and keyword arguments. 00083 00084 The available fields are: 00085 header,goal_id,goal 00086 00087 @param args: complete set of field values, in .msg order 00088 @param kwds: use keyword arguments corresponding to message field names 00089 to set specific fields. 00090 """ 00091 if args or kwds: 00092 super(JointAnglesWithSpeedActionGoal, self).__init__(*args, **kwds) 00093 #message fields cannot be None, assign default values for those that are 00094 if self.header is None: 00095 self.header = std_msgs.msg._Header.Header() 00096 if self.goal_id is None: 00097 self.goal_id = actionlib_msgs.msg.GoalID() 00098 if self.goal is None: 00099 self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal() 00100 else: 00101 self.header = std_msgs.msg._Header.Header() 00102 self.goal_id = actionlib_msgs.msg.GoalID() 00103 self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal() 00104 00105 def _get_types(self): 00106 """ 00107 internal API method 00108 """ 00109 return self._slot_types 00110 00111 def serialize(self, buff): 00112 """ 00113 serialize message into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 """ 00117 try: 00118 _x = self 00119 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00120 _x = self.header.frame_id 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self 00124 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00125 _x = self.goal_id.id 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 _x = self 00129 buff.write(_struct_3I.pack(_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs)) 00130 _x = self.goal.joint_angles.header.frame_id 00131 length = len(_x) 00132 buff.write(struct.pack('<I%ss'%length, length, _x)) 00133 length = len(self.goal.joint_angles.joint_names) 00134 buff.write(_struct_I.pack(length)) 00135 for val1 in self.goal.joint_angles.joint_names: 00136 length = len(val1) 00137 buff.write(struct.pack('<I%ss'%length, length, val1)) 00138 length = len(self.goal.joint_angles.joint_angles) 00139 buff.write(_struct_I.pack(length)) 00140 pattern = '<%sf'%length 00141 buff.write(struct.pack(pattern, *self.goal.joint_angles.joint_angles)) 00142 _x = self 00143 buff.write(_struct_fB.pack(_x.goal.joint_angles.speed, _x.goal.joint_angles.relative)) 00144 except struct.error as se: self._check_types(se) 00145 except TypeError as te: self._check_types(te) 00146 00147 def deserialize(self, str): 00148 """ 00149 unpack serialized message in str into this message instance 00150 @param str: byte array of serialized message 00151 @type str: str 00152 """ 00153 try: 00154 if self.header is None: 00155 self.header = std_msgs.msg._Header.Header() 00156 if self.goal_id is None: 00157 self.goal_id = actionlib_msgs.msg.GoalID() 00158 if self.goal is None: 00159 self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal() 00160 end = 0 00161 _x = self 00162 start = end 00163 end += 12 00164 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00165 start = end 00166 end += 4 00167 (length,) = _struct_I.unpack(str[start:end]) 00168 start = end 00169 end += length 00170 self.header.frame_id = str[start:end] 00171 _x = self 00172 start = end 00173 end += 8 00174 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00175 start = end 00176 end += 4 00177 (length,) = _struct_I.unpack(str[start:end]) 00178 start = end 00179 end += length 00180 self.goal_id.id = str[start:end] 00181 _x = self 00182 start = end 00183 end += 12 00184 (_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00185 start = end 00186 end += 4 00187 (length,) = _struct_I.unpack(str[start:end]) 00188 start = end 00189 end += length 00190 self.goal.joint_angles.header.frame_id = str[start:end] 00191 start = end 00192 end += 4 00193 (length,) = _struct_I.unpack(str[start:end]) 00194 self.goal.joint_angles.joint_names = [] 00195 for i in range(0, length): 00196 start = end 00197 end += 4 00198 (length,) = _struct_I.unpack(str[start:end]) 00199 start = end 00200 end += length 00201 val1 = str[start:end] 00202 self.goal.joint_angles.joint_names.append(val1) 00203 start = end 00204 end += 4 00205 (length,) = _struct_I.unpack(str[start:end]) 00206 pattern = '<%sf'%length 00207 start = end 00208 end += struct.calcsize(pattern) 00209 self.goal.joint_angles.joint_angles = struct.unpack(pattern, str[start:end]) 00210 _x = self 00211 start = end 00212 end += 5 00213 (_x.goal.joint_angles.speed, _x.goal.joint_angles.relative,) = _struct_fB.unpack(str[start:end]) 00214 return self 00215 except struct.error as e: 00216 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00217 00218 00219 def serialize_numpy(self, buff, numpy): 00220 """ 00221 serialize message with numpy array types into buffer 00222 @param buff: buffer 00223 @type buff: StringIO 00224 @param numpy: numpy python module 00225 @type numpy module 00226 """ 00227 try: 00228 _x = self 00229 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00230 _x = self.header.frame_id 00231 length = len(_x) 00232 buff.write(struct.pack('<I%ss'%length, length, _x)) 00233 _x = self 00234 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00235 _x = self.goal_id.id 00236 length = len(_x) 00237 buff.write(struct.pack('<I%ss'%length, length, _x)) 00238 _x = self 00239 buff.write(_struct_3I.pack(_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs)) 00240 _x = self.goal.joint_angles.header.frame_id 00241 length = len(_x) 00242 buff.write(struct.pack('<I%ss'%length, length, _x)) 00243 length = len(self.goal.joint_angles.joint_names) 00244 buff.write(_struct_I.pack(length)) 00245 for val1 in self.goal.joint_angles.joint_names: 00246 length = len(val1) 00247 buff.write(struct.pack('<I%ss'%length, length, val1)) 00248 length = len(self.goal.joint_angles.joint_angles) 00249 buff.write(_struct_I.pack(length)) 00250 pattern = '<%sf'%length 00251 buff.write(self.goal.joint_angles.joint_angles.tostring()) 00252 _x = self 00253 buff.write(_struct_fB.pack(_x.goal.joint_angles.speed, _x.goal.joint_angles.relative)) 00254 except struct.error as se: self._check_types(se) 00255 except TypeError as te: self._check_types(te) 00256 00257 def deserialize_numpy(self, str, numpy): 00258 """ 00259 unpack serialized message in str into this message instance using numpy for array types 00260 @param str: byte array of serialized message 00261 @type str: str 00262 @param numpy: numpy python module 00263 @type numpy: module 00264 """ 00265 try: 00266 if self.header is None: 00267 self.header = std_msgs.msg._Header.Header() 00268 if self.goal_id is None: 00269 self.goal_id = actionlib_msgs.msg.GoalID() 00270 if self.goal is None: 00271 self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal() 00272 end = 0 00273 _x = self 00274 start = end 00275 end += 12 00276 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 start = end 00281 end += length 00282 self.header.frame_id = str[start:end] 00283 _x = self 00284 start = end 00285 end += 8 00286 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00287 start = end 00288 end += 4 00289 (length,) = _struct_I.unpack(str[start:end]) 00290 start = end 00291 end += length 00292 self.goal_id.id = str[start:end] 00293 _x = self 00294 start = end 00295 end += 12 00296 (_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00297 start = end 00298 end += 4 00299 (length,) = _struct_I.unpack(str[start:end]) 00300 start = end 00301 end += length 00302 self.goal.joint_angles.header.frame_id = str[start:end] 00303 start = end 00304 end += 4 00305 (length,) = _struct_I.unpack(str[start:end]) 00306 self.goal.joint_angles.joint_names = [] 00307 for i in range(0, length): 00308 start = end 00309 end += 4 00310 (length,) = _struct_I.unpack(str[start:end]) 00311 start = end 00312 end += length 00313 val1 = str[start:end] 00314 self.goal.joint_angles.joint_names.append(val1) 00315 start = end 00316 end += 4 00317 (length,) = _struct_I.unpack(str[start:end]) 00318 pattern = '<%sf'%length 00319 start = end 00320 end += struct.calcsize(pattern) 00321 self.goal.joint_angles.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00322 _x = self 00323 start = end 00324 end += 5 00325 (_x.goal.joint_angles.speed, _x.goal.joint_angles.relative,) = _struct_fB.unpack(str[start:end]) 00326 return self 00327 except struct.error as e: 00328 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00329 00330 _struct_I = roslib.message.struct_I 00331 _struct_fB = struct.Struct("<fB") 00332 _struct_3I = struct.Struct("<3I") 00333 _struct_2I = struct.Struct("<2I")