$search
00001 """autogenerated by genmsg_py from JointAnglesWithSpeedGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import nao_msgs.msg 00006 import std_msgs.msg 00007 00008 class JointAnglesWithSpeedGoal(roslib.message.Message): 00009 _md5sum = "d19a898a40aae87b37b0f91c9e90f46c" 00010 _type = "nao_msgs/JointAnglesWithSpeedGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 # goal: a registered body pose name 00014 nao_msgs/JointAnglesWithSpeed joint_angles 00015 00016 ================================================================================ 00017 MSG: nao_msgs/JointAnglesWithSpeed 00018 Header header 00019 00020 # A list of joint names, corresponding to their names in the Nao docs. 00021 # This must be either the same lenght of joint_angles or 1 if it's a 00022 # keyword such as 'Body' (for all angles) 00023 string[] joint_names 00024 float32[] joint_angles 00025 00026 #fraction of max joint velocity [0:1] 00027 float32 speed 00028 00029 # Absolute angle(=0, default) or relative change 00030 uint8 relative 00031 00032 ================================================================================ 00033 MSG: std_msgs/Header 00034 # Standard metadata for higher-level stamped data types. 00035 # This is generally used to communicate timestamped data 00036 # in a particular coordinate frame. 00037 # 00038 # sequence ID: consecutively increasing ID 00039 uint32 seq 00040 #Two-integer timestamp that is expressed as: 00041 # * stamp.secs: seconds (stamp_secs) since epoch 00042 # * stamp.nsecs: nanoseconds since stamp_secs 00043 # time-handling sugar is provided by the client library 00044 time stamp 00045 #Frame this data is associated with 00046 # 0: no frame 00047 # 1: global frame 00048 string frame_id 00049 00050 """ 00051 __slots__ = ['joint_angles'] 00052 _slot_types = ['nao_msgs/JointAnglesWithSpeed'] 00053 00054 def __init__(self, *args, **kwds): 00055 """ 00056 Constructor. Any message fields that are implicitly/explicitly 00057 set to None will be assigned a default value. The recommend 00058 use is keyword arguments as this is more robust to future message 00059 changes. You cannot mix in-order arguments and keyword arguments. 00060 00061 The available fields are: 00062 joint_angles 00063 00064 @param args: complete set of field values, in .msg order 00065 @param kwds: use keyword arguments corresponding to message field names 00066 to set specific fields. 00067 """ 00068 if args or kwds: 00069 super(JointAnglesWithSpeedGoal, self).__init__(*args, **kwds) 00070 #message fields cannot be None, assign default values for those that are 00071 if self.joint_angles is None: 00072 self.joint_angles = nao_msgs.msg.JointAnglesWithSpeed() 00073 else: 00074 self.joint_angles = nao_msgs.msg.JointAnglesWithSpeed() 00075 00076 def _get_types(self): 00077 """ 00078 internal API method 00079 """ 00080 return self._slot_types 00081 00082 def serialize(self, buff): 00083 """ 00084 serialize message into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 """ 00088 try: 00089 _x = self 00090 buff.write(_struct_3I.pack(_x.joint_angles.header.seq, _x.joint_angles.header.stamp.secs, _x.joint_angles.header.stamp.nsecs)) 00091 _x = self.joint_angles.header.frame_id 00092 length = len(_x) 00093 buff.write(struct.pack('<I%ss'%length, length, _x)) 00094 length = len(self.joint_angles.joint_names) 00095 buff.write(_struct_I.pack(length)) 00096 for val1 in self.joint_angles.joint_names: 00097 length = len(val1) 00098 buff.write(struct.pack('<I%ss'%length, length, val1)) 00099 length = len(self.joint_angles.joint_angles) 00100 buff.write(_struct_I.pack(length)) 00101 pattern = '<%sf'%length 00102 buff.write(struct.pack(pattern, *self.joint_angles.joint_angles)) 00103 _x = self 00104 buff.write(_struct_fB.pack(_x.joint_angles.speed, _x.joint_angles.relative)) 00105 except struct.error as se: self._check_types(se) 00106 except TypeError as te: self._check_types(te) 00107 00108 def deserialize(self, str): 00109 """ 00110 unpack serialized message in str into this message instance 00111 @param str: byte array of serialized message 00112 @type str: str 00113 """ 00114 try: 00115 if self.joint_angles is None: 00116 self.joint_angles = nao_msgs.msg.JointAnglesWithSpeed() 00117 end = 0 00118 _x = self 00119 start = end 00120 end += 12 00121 (_x.joint_angles.header.seq, _x.joint_angles.header.stamp.secs, _x.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00122 start = end 00123 end += 4 00124 (length,) = _struct_I.unpack(str[start:end]) 00125 start = end 00126 end += length 00127 self.joint_angles.header.frame_id = str[start:end] 00128 start = end 00129 end += 4 00130 (length,) = _struct_I.unpack(str[start:end]) 00131 self.joint_angles.joint_names = [] 00132 for i in range(0, length): 00133 start = end 00134 end += 4 00135 (length,) = _struct_I.unpack(str[start:end]) 00136 start = end 00137 end += length 00138 val1 = str[start:end] 00139 self.joint_angles.joint_names.append(val1) 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 pattern = '<%sf'%length 00144 start = end 00145 end += struct.calcsize(pattern) 00146 self.joint_angles.joint_angles = struct.unpack(pattern, str[start:end]) 00147 _x = self 00148 start = end 00149 end += 5 00150 (_x.joint_angles.speed, _x.joint_angles.relative,) = _struct_fB.unpack(str[start:end]) 00151 return self 00152 except struct.error as e: 00153 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00154 00155 00156 def serialize_numpy(self, buff, numpy): 00157 """ 00158 serialize message with numpy array types into buffer 00159 @param buff: buffer 00160 @type buff: StringIO 00161 @param numpy: numpy python module 00162 @type numpy module 00163 """ 00164 try: 00165 _x = self 00166 buff.write(_struct_3I.pack(_x.joint_angles.header.seq, _x.joint_angles.header.stamp.secs, _x.joint_angles.header.stamp.nsecs)) 00167 _x = self.joint_angles.header.frame_id 00168 length = len(_x) 00169 buff.write(struct.pack('<I%ss'%length, length, _x)) 00170 length = len(self.joint_angles.joint_names) 00171 buff.write(_struct_I.pack(length)) 00172 for val1 in self.joint_angles.joint_names: 00173 length = len(val1) 00174 buff.write(struct.pack('<I%ss'%length, length, val1)) 00175 length = len(self.joint_angles.joint_angles) 00176 buff.write(_struct_I.pack(length)) 00177 pattern = '<%sf'%length 00178 buff.write(self.joint_angles.joint_angles.tostring()) 00179 _x = self 00180 buff.write(_struct_fB.pack(_x.joint_angles.speed, _x.joint_angles.relative)) 00181 except struct.error as se: self._check_types(se) 00182 except TypeError as te: self._check_types(te) 00183 00184 def deserialize_numpy(self, str, numpy): 00185 """ 00186 unpack serialized message in str into this message instance using numpy for array types 00187 @param str: byte array of serialized message 00188 @type str: str 00189 @param numpy: numpy python module 00190 @type numpy: module 00191 """ 00192 try: 00193 if self.joint_angles is None: 00194 self.joint_angles = nao_msgs.msg.JointAnglesWithSpeed() 00195 end = 0 00196 _x = self 00197 start = end 00198 end += 12 00199 (_x.joint_angles.header.seq, _x.joint_angles.header.stamp.secs, _x.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00200 start = end 00201 end += 4 00202 (length,) = _struct_I.unpack(str[start:end]) 00203 start = end 00204 end += length 00205 self.joint_angles.header.frame_id = str[start:end] 00206 start = end 00207 end += 4 00208 (length,) = _struct_I.unpack(str[start:end]) 00209 self.joint_angles.joint_names = [] 00210 for i in range(0, length): 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 start = end 00215 end += length 00216 val1 = str[start:end] 00217 self.joint_angles.joint_names.append(val1) 00218 start = end 00219 end += 4 00220 (length,) = _struct_I.unpack(str[start:end]) 00221 pattern = '<%sf'%length 00222 start = end 00223 end += struct.calcsize(pattern) 00224 self.joint_angles.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00225 _x = self 00226 start = end 00227 end += 5 00228 (_x.joint_angles.speed, _x.joint_angles.relative,) = _struct_fB.unpack(str[start:end]) 00229 return self 00230 except struct.error as e: 00231 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00232 00233 _struct_I = roslib.message.struct_I 00234 _struct_3I = struct.Struct("<3I") 00235 _struct_fB = struct.Struct("<fB")