$search
00001 """autogenerated by genmsg_py from JointMovementGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 import sensor_msgs.msg 00007 00008 class JointMovementGoal(roslib.message.Message): 00009 _md5sum = "03f8456b346613dcdf3d0e35b6b1a281" 00010 _type = "katana_msgs/JointMovementGoal" 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 definition 00014 sensor_msgs/JointState jointGoal 00015 00016 ================================================================================ 00017 MSG: sensor_msgs/JointState 00018 # This is a message that holds data to describe the state of a set of torque controlled joints. 00019 # 00020 # The state of each joint (revolute or prismatic) is defined by: 00021 # * the position of the joint (rad or m), 00022 # * the velocity of the joint (rad/s or m/s) and 00023 # * the effort that is applied in the joint (Nm or N). 00024 # 00025 # Each joint is uniquely identified by its name 00026 # The header specifies the time at which the joint states were recorded. All the joint states 00027 # in one message have to be recorded at the same time. 00028 # 00029 # This message consists of a multiple arrays, one for each part of the joint state. 00030 # The goal is to make each of the fields optional. When e.g. your joints have no 00031 # effort associated with them, you can leave the effort array empty. 00032 # 00033 # All arrays in this message should have the same size, or be empty. 00034 # This is the only way to uniquely associate the joint name with the correct 00035 # states. 00036 00037 00038 Header header 00039 00040 string[] name 00041 float64[] position 00042 float64[] velocity 00043 float64[] effort 00044 00045 ================================================================================ 00046 MSG: std_msgs/Header 00047 # Standard metadata for higher-level stamped data types. 00048 # This is generally used to communicate timestamped data 00049 # in a particular coordinate frame. 00050 # 00051 # sequence ID: consecutively increasing ID 00052 uint32 seq 00053 #Two-integer timestamp that is expressed as: 00054 # * stamp.secs: seconds (stamp_secs) since epoch 00055 # * stamp.nsecs: nanoseconds since stamp_secs 00056 # time-handling sugar is provided by the client library 00057 time stamp 00058 #Frame this data is associated with 00059 # 0: no frame 00060 # 1: global frame 00061 string frame_id 00062 00063 """ 00064 __slots__ = ['jointGoal'] 00065 _slot_types = ['sensor_msgs/JointState'] 00066 00067 def __init__(self, *args, **kwds): 00068 """ 00069 Constructor. Any message fields that are implicitly/explicitly 00070 set to None will be assigned a default value. The recommend 00071 use is keyword arguments as this is more robust to future message 00072 changes. You cannot mix in-order arguments and keyword arguments. 00073 00074 The available fields are: 00075 jointGoal 00076 00077 @param args: complete set of field values, in .msg order 00078 @param kwds: use keyword arguments corresponding to message field names 00079 to set specific fields. 00080 """ 00081 if args or kwds: 00082 super(JointMovementGoal, self).__init__(*args, **kwds) 00083 #message fields cannot be None, assign default values for those that are 00084 if self.jointGoal is None: 00085 self.jointGoal = sensor_msgs.msg.JointState() 00086 else: 00087 self.jointGoal = sensor_msgs.msg.JointState() 00088 00089 def _get_types(self): 00090 """ 00091 internal API method 00092 """ 00093 return self._slot_types 00094 00095 def serialize(self, buff): 00096 """ 00097 serialize message into buffer 00098 @param buff: buffer 00099 @type buff: StringIO 00100 """ 00101 try: 00102 _x = self 00103 buff.write(_struct_3I.pack(_x.jointGoal.header.seq, _x.jointGoal.header.stamp.secs, _x.jointGoal.header.stamp.nsecs)) 00104 _x = self.jointGoal.header.frame_id 00105 length = len(_x) 00106 buff.write(struct.pack('<I%ss'%length, length, _x)) 00107 length = len(self.jointGoal.name) 00108 buff.write(_struct_I.pack(length)) 00109 for val1 in self.jointGoal.name: 00110 length = len(val1) 00111 buff.write(struct.pack('<I%ss'%length, length, val1)) 00112 length = len(self.jointGoal.position) 00113 buff.write(_struct_I.pack(length)) 00114 pattern = '<%sd'%length 00115 buff.write(struct.pack(pattern, *self.jointGoal.position)) 00116 length = len(self.jointGoal.velocity) 00117 buff.write(_struct_I.pack(length)) 00118 pattern = '<%sd'%length 00119 buff.write(struct.pack(pattern, *self.jointGoal.velocity)) 00120 length = len(self.jointGoal.effort) 00121 buff.write(_struct_I.pack(length)) 00122 pattern = '<%sd'%length 00123 buff.write(struct.pack(pattern, *self.jointGoal.effort)) 00124 except struct.error as se: self._check_types(se) 00125 except TypeError as te: self._check_types(te) 00126 00127 def deserialize(self, str): 00128 """ 00129 unpack serialized message in str into this message instance 00130 @param str: byte array of serialized message 00131 @type str: str 00132 """ 00133 try: 00134 if self.jointGoal is None: 00135 self.jointGoal = sensor_msgs.msg.JointState() 00136 end = 0 00137 _x = self 00138 start = end 00139 end += 12 00140 (_x.jointGoal.header.seq, _x.jointGoal.header.stamp.secs, _x.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00141 start = end 00142 end += 4 00143 (length,) = _struct_I.unpack(str[start:end]) 00144 start = end 00145 end += length 00146 self.jointGoal.header.frame_id = str[start:end] 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 self.jointGoal.name = [] 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.jointGoal.name.append(val1) 00159 start = end 00160 end += 4 00161 (length,) = _struct_I.unpack(str[start:end]) 00162 pattern = '<%sd'%length 00163 start = end 00164 end += struct.calcsize(pattern) 00165 self.jointGoal.position = struct.unpack(pattern, str[start:end]) 00166 start = end 00167 end += 4 00168 (length,) = _struct_I.unpack(str[start:end]) 00169 pattern = '<%sd'%length 00170 start = end 00171 end += struct.calcsize(pattern) 00172 self.jointGoal.velocity = struct.unpack(pattern, str[start:end]) 00173 start = end 00174 end += 4 00175 (length,) = _struct_I.unpack(str[start:end]) 00176 pattern = '<%sd'%length 00177 start = end 00178 end += struct.calcsize(pattern) 00179 self.jointGoal.effort = struct.unpack(pattern, str[start:end]) 00180 return self 00181 except struct.error as e: 00182 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00183 00184 00185 def serialize_numpy(self, buff, numpy): 00186 """ 00187 serialize message with numpy array types into buffer 00188 @param buff: buffer 00189 @type buff: StringIO 00190 @param numpy: numpy python module 00191 @type numpy module 00192 """ 00193 try: 00194 _x = self 00195 buff.write(_struct_3I.pack(_x.jointGoal.header.seq, _x.jointGoal.header.stamp.secs, _x.jointGoal.header.stamp.nsecs)) 00196 _x = self.jointGoal.header.frame_id 00197 length = len(_x) 00198 buff.write(struct.pack('<I%ss'%length, length, _x)) 00199 length = len(self.jointGoal.name) 00200 buff.write(_struct_I.pack(length)) 00201 for val1 in self.jointGoal.name: 00202 length = len(val1) 00203 buff.write(struct.pack('<I%ss'%length, length, val1)) 00204 length = len(self.jointGoal.position) 00205 buff.write(_struct_I.pack(length)) 00206 pattern = '<%sd'%length 00207 buff.write(self.jointGoal.position.tostring()) 00208 length = len(self.jointGoal.velocity) 00209 buff.write(_struct_I.pack(length)) 00210 pattern = '<%sd'%length 00211 buff.write(self.jointGoal.velocity.tostring()) 00212 length = len(self.jointGoal.effort) 00213 buff.write(_struct_I.pack(length)) 00214 pattern = '<%sd'%length 00215 buff.write(self.jointGoal.effort.tostring()) 00216 except struct.error as se: self._check_types(se) 00217 except TypeError as te: self._check_types(te) 00218 00219 def deserialize_numpy(self, str, numpy): 00220 """ 00221 unpack serialized message in str into this message instance using numpy for array types 00222 @param str: byte array of serialized message 00223 @type str: str 00224 @param numpy: numpy python module 00225 @type numpy: module 00226 """ 00227 try: 00228 if self.jointGoal is None: 00229 self.jointGoal = sensor_msgs.msg.JointState() 00230 end = 0 00231 _x = self 00232 start = end 00233 end += 12 00234 (_x.jointGoal.header.seq, _x.jointGoal.header.stamp.secs, _x.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 start = end 00239 end += length 00240 self.jointGoal.header.frame_id = str[start:end] 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 self.jointGoal.name = [] 00245 for i in range(0, length): 00246 start = end 00247 end += 4 00248 (length,) = _struct_I.unpack(str[start:end]) 00249 start = end 00250 end += length 00251 val1 = str[start:end] 00252 self.jointGoal.name.append(val1) 00253 start = end 00254 end += 4 00255 (length,) = _struct_I.unpack(str[start:end]) 00256 pattern = '<%sd'%length 00257 start = end 00258 end += struct.calcsize(pattern) 00259 self.jointGoal.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00260 start = end 00261 end += 4 00262 (length,) = _struct_I.unpack(str[start:end]) 00263 pattern = '<%sd'%length 00264 start = end 00265 end += struct.calcsize(pattern) 00266 self.jointGoal.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00267 start = end 00268 end += 4 00269 (length,) = _struct_I.unpack(str[start:end]) 00270 pattern = '<%sd'%length 00271 start = end 00272 end += struct.calcsize(pattern) 00273 self.jointGoal.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00274 return self 00275 except struct.error as e: 00276 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00277 00278 _struct_I = roslib.message.struct_I 00279 _struct_3I = struct.Struct("<3I")