00001 """autogenerated by genpy from katana_msgs/JointMovementActionGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import sensor_msgs.msg
00008 import katana_msgs.msg
00009 import genpy
00010 import actionlib_msgs.msg
00011 import std_msgs.msg
00012
00013 class JointMovementActionGoal(genpy.Message):
00014 _md5sum = "2b6e9b9692b7ab0a124ca0558966f79a"
00015 _type = "katana_msgs/JointMovementActionGoal"
00016 _has_header = True
00017 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00018
00019 Header header
00020 actionlib_msgs/GoalID goal_id
00021 JointMovementGoal goal
00022
00023 ================================================================================
00024 MSG: std_msgs/Header
00025 # Standard metadata for higher-level stamped data types.
00026 # This is generally used to communicate timestamped data
00027 # in a particular coordinate frame.
00028 #
00029 # sequence ID: consecutively increasing ID
00030 uint32 seq
00031 #Two-integer timestamp that is expressed as:
00032 # * stamp.secs: seconds (stamp_secs) since epoch
00033 # * stamp.nsecs: nanoseconds since stamp_secs
00034 # time-handling sugar is provided by the client library
00035 time stamp
00036 #Frame this data is associated with
00037 # 0: no frame
00038 # 1: global frame
00039 string frame_id
00040
00041 ================================================================================
00042 MSG: actionlib_msgs/GoalID
00043 # The stamp should store the time at which this goal was requested.
00044 # It is used by an action server when it tries to preempt all
00045 # goals that were requested before a certain time
00046 time stamp
00047
00048 # The id provides a way to associate feedback and
00049 # result message with specific goal requests. The id
00050 # specified must be unique.
00051 string id
00052
00053
00054 ================================================================================
00055 MSG: katana_msgs/JointMovementGoal
00056 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00057 #goal definition
00058 sensor_msgs/JointState jointGoal
00059
00060 ================================================================================
00061 MSG: sensor_msgs/JointState
00062 # This is a message that holds data to describe the state of a set of torque controlled joints.
00063 #
00064 # The state of each joint (revolute or prismatic) is defined by:
00065 # * the position of the joint (rad or m),
00066 # * the velocity of the joint (rad/s or m/s) and
00067 # * the effort that is applied in the joint (Nm or N).
00068 #
00069 # Each joint is uniquely identified by its name
00070 # The header specifies the time at which the joint states were recorded. All the joint states
00071 # in one message have to be recorded at the same time.
00072 #
00073 # This message consists of a multiple arrays, one for each part of the joint state.
00074 # The goal is to make each of the fields optional. When e.g. your joints have no
00075 # effort associated with them, you can leave the effort array empty.
00076 #
00077 # All arrays in this message should have the same size, or be empty.
00078 # This is the only way to uniquely associate the joint name with the correct
00079 # states.
00080
00081
00082 Header header
00083
00084 string[] name
00085 float64[] position
00086 float64[] velocity
00087 float64[] effort
00088
00089 """
00090 __slots__ = ['header','goal_id','goal']
00091 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','katana_msgs/JointMovementGoal']
00092
00093 def __init__(self, *args, **kwds):
00094 """
00095 Constructor. Any message fields that are implicitly/explicitly
00096 set to None will be assigned a default value. The recommend
00097 use is keyword arguments as this is more robust to future message
00098 changes. You cannot mix in-order arguments and keyword arguments.
00099
00100 The available fields are:
00101 header,goal_id,goal
00102
00103 :param args: complete set of field values, in .msg order
00104 :param kwds: use keyword arguments corresponding to message field names
00105 to set specific fields.
00106 """
00107 if args or kwds:
00108 super(JointMovementActionGoal, self).__init__(*args, **kwds)
00109
00110 if self.header is None:
00111 self.header = std_msgs.msg.Header()
00112 if self.goal_id is None:
00113 self.goal_id = actionlib_msgs.msg.GoalID()
00114 if self.goal is None:
00115 self.goal = katana_msgs.msg.JointMovementGoal()
00116 else:
00117 self.header = std_msgs.msg.Header()
00118 self.goal_id = actionlib_msgs.msg.GoalID()
00119 self.goal = katana_msgs.msg.JointMovementGoal()
00120
00121 def _get_types(self):
00122 """
00123 internal API method
00124 """
00125 return self._slot_types
00126
00127 def serialize(self, buff):
00128 """
00129 serialize message into buffer
00130 :param buff: buffer, ``StringIO``
00131 """
00132 try:
00133 _x = self
00134 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00135 _x = self.header.frame_id
00136 length = len(_x)
00137 if python3 or type(_x) == unicode:
00138 _x = _x.encode('utf-8')
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 _x = self
00142 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00143 _x = self.goal_id.id
00144 length = len(_x)
00145 if python3 or type(_x) == unicode:
00146 _x = _x.encode('utf-8')
00147 length = len(_x)
00148 buff.write(struct.pack('<I%ss'%length, length, _x))
00149 _x = self
00150 buff.write(_struct_3I.pack(_x.goal.jointGoal.header.seq, _x.goal.jointGoal.header.stamp.secs, _x.goal.jointGoal.header.stamp.nsecs))
00151 _x = self.goal.jointGoal.header.frame_id
00152 length = len(_x)
00153 if python3 or type(_x) == unicode:
00154 _x = _x.encode('utf-8')
00155 length = len(_x)
00156 buff.write(struct.pack('<I%ss'%length, length, _x))
00157 length = len(self.goal.jointGoal.name)
00158 buff.write(_struct_I.pack(length))
00159 for val1 in self.goal.jointGoal.name:
00160 length = len(val1)
00161 if python3 or type(val1) == unicode:
00162 val1 = val1.encode('utf-8')
00163 length = len(val1)
00164 buff.write(struct.pack('<I%ss'%length, length, val1))
00165 length = len(self.goal.jointGoal.position)
00166 buff.write(_struct_I.pack(length))
00167 pattern = '<%sd'%length
00168 buff.write(struct.pack(pattern, *self.goal.jointGoal.position))
00169 length = len(self.goal.jointGoal.velocity)
00170 buff.write(_struct_I.pack(length))
00171 pattern = '<%sd'%length
00172 buff.write(struct.pack(pattern, *self.goal.jointGoal.velocity))
00173 length = len(self.goal.jointGoal.effort)
00174 buff.write(_struct_I.pack(length))
00175 pattern = '<%sd'%length
00176 buff.write(struct.pack(pattern, *self.goal.jointGoal.effort))
00177 except struct.error as se: self._check_types(se)
00178 except TypeError as te: self._check_types(te)
00179
00180 def deserialize(self, str):
00181 """
00182 unpack serialized message in str into this message instance
00183 :param str: byte array of serialized message, ``str``
00184 """
00185 try:
00186 if self.header is None:
00187 self.header = std_msgs.msg.Header()
00188 if self.goal_id is None:
00189 self.goal_id = actionlib_msgs.msg.GoalID()
00190 if self.goal is None:
00191 self.goal = katana_msgs.msg.JointMovementGoal()
00192 end = 0
00193 _x = self
00194 start = end
00195 end += 12
00196 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00197 start = end
00198 end += 4
00199 (length,) = _struct_I.unpack(str[start:end])
00200 start = end
00201 end += length
00202 if python3:
00203 self.header.frame_id = str[start:end].decode('utf-8')
00204 else:
00205 self.header.frame_id = str[start:end]
00206 _x = self
00207 start = end
00208 end += 8
00209 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00210 start = end
00211 end += 4
00212 (length,) = _struct_I.unpack(str[start:end])
00213 start = end
00214 end += length
00215 if python3:
00216 self.goal_id.id = str[start:end].decode('utf-8')
00217 else:
00218 self.goal_id.id = str[start:end]
00219 _x = self
00220 start = end
00221 end += 12
00222 (_x.goal.jointGoal.header.seq, _x.goal.jointGoal.header.stamp.secs, _x.goal.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00223 start = end
00224 end += 4
00225 (length,) = _struct_I.unpack(str[start:end])
00226 start = end
00227 end += length
00228 if python3:
00229 self.goal.jointGoal.header.frame_id = str[start:end].decode('utf-8')
00230 else:
00231 self.goal.jointGoal.header.frame_id = str[start:end]
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 self.goal.jointGoal.name = []
00236 for i in range(0, length):
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 start = end
00241 end += length
00242 if python3:
00243 val1 = str[start:end].decode('utf-8')
00244 else:
00245 val1 = str[start:end]
00246 self.goal.jointGoal.name.append(val1)
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 pattern = '<%sd'%length
00251 start = end
00252 end += struct.calcsize(pattern)
00253 self.goal.jointGoal.position = struct.unpack(pattern, str[start:end])
00254 start = end
00255 end += 4
00256 (length,) = _struct_I.unpack(str[start:end])
00257 pattern = '<%sd'%length
00258 start = end
00259 end += struct.calcsize(pattern)
00260 self.goal.jointGoal.velocity = struct.unpack(pattern, str[start:end])
00261 start = end
00262 end += 4
00263 (length,) = _struct_I.unpack(str[start:end])
00264 pattern = '<%sd'%length
00265 start = end
00266 end += struct.calcsize(pattern)
00267 self.goal.jointGoal.effort = struct.unpack(pattern, str[start:end])
00268 return self
00269 except struct.error as e:
00270 raise genpy.DeserializationError(e)
00271
00272
00273 def serialize_numpy(self, buff, numpy):
00274 """
00275 serialize message with numpy array types into buffer
00276 :param buff: buffer, ``StringIO``
00277 :param numpy: numpy python module
00278 """
00279 try:
00280 _x = self
00281 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00282 _x = self.header.frame_id
00283 length = len(_x)
00284 if python3 or type(_x) == unicode:
00285 _x = _x.encode('utf-8')
00286 length = len(_x)
00287 buff.write(struct.pack('<I%ss'%length, length, _x))
00288 _x = self
00289 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00290 _x = self.goal_id.id
00291 length = len(_x)
00292 if python3 or type(_x) == unicode:
00293 _x = _x.encode('utf-8')
00294 length = len(_x)
00295 buff.write(struct.pack('<I%ss'%length, length, _x))
00296 _x = self
00297 buff.write(_struct_3I.pack(_x.goal.jointGoal.header.seq, _x.goal.jointGoal.header.stamp.secs, _x.goal.jointGoal.header.stamp.nsecs))
00298 _x = self.goal.jointGoal.header.frame_id
00299 length = len(_x)
00300 if python3 or type(_x) == unicode:
00301 _x = _x.encode('utf-8')
00302 length = len(_x)
00303 buff.write(struct.pack('<I%ss'%length, length, _x))
00304 length = len(self.goal.jointGoal.name)
00305 buff.write(_struct_I.pack(length))
00306 for val1 in self.goal.jointGoal.name:
00307 length = len(val1)
00308 if python3 or type(val1) == unicode:
00309 val1 = val1.encode('utf-8')
00310 length = len(val1)
00311 buff.write(struct.pack('<I%ss'%length, length, val1))
00312 length = len(self.goal.jointGoal.position)
00313 buff.write(_struct_I.pack(length))
00314 pattern = '<%sd'%length
00315 buff.write(self.goal.jointGoal.position.tostring())
00316 length = len(self.goal.jointGoal.velocity)
00317 buff.write(_struct_I.pack(length))
00318 pattern = '<%sd'%length
00319 buff.write(self.goal.jointGoal.velocity.tostring())
00320 length = len(self.goal.jointGoal.effort)
00321 buff.write(_struct_I.pack(length))
00322 pattern = '<%sd'%length
00323 buff.write(self.goal.jointGoal.effort.tostring())
00324 except struct.error as se: self._check_types(se)
00325 except TypeError as te: self._check_types(te)
00326
00327 def deserialize_numpy(self, str, numpy):
00328 """
00329 unpack serialized message in str into this message instance using numpy for array types
00330 :param str: byte array of serialized message, ``str``
00331 :param numpy: numpy python module
00332 """
00333 try:
00334 if self.header is None:
00335 self.header = std_msgs.msg.Header()
00336 if self.goal_id is None:
00337 self.goal_id = actionlib_msgs.msg.GoalID()
00338 if self.goal is None:
00339 self.goal = katana_msgs.msg.JointMovementGoal()
00340 end = 0
00341 _x = self
00342 start = end
00343 end += 12
00344 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00345 start = end
00346 end += 4
00347 (length,) = _struct_I.unpack(str[start:end])
00348 start = end
00349 end += length
00350 if python3:
00351 self.header.frame_id = str[start:end].decode('utf-8')
00352 else:
00353 self.header.frame_id = str[start:end]
00354 _x = self
00355 start = end
00356 end += 8
00357 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00358 start = end
00359 end += 4
00360 (length,) = _struct_I.unpack(str[start:end])
00361 start = end
00362 end += length
00363 if python3:
00364 self.goal_id.id = str[start:end].decode('utf-8')
00365 else:
00366 self.goal_id.id = str[start:end]
00367 _x = self
00368 start = end
00369 end += 12
00370 (_x.goal.jointGoal.header.seq, _x.goal.jointGoal.header.stamp.secs, _x.goal.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00371 start = end
00372 end += 4
00373 (length,) = _struct_I.unpack(str[start:end])
00374 start = end
00375 end += length
00376 if python3:
00377 self.goal.jointGoal.header.frame_id = str[start:end].decode('utf-8')
00378 else:
00379 self.goal.jointGoal.header.frame_id = str[start:end]
00380 start = end
00381 end += 4
00382 (length,) = _struct_I.unpack(str[start:end])
00383 self.goal.jointGoal.name = []
00384 for i in range(0, length):
00385 start = end
00386 end += 4
00387 (length,) = _struct_I.unpack(str[start:end])
00388 start = end
00389 end += length
00390 if python3:
00391 val1 = str[start:end].decode('utf-8')
00392 else:
00393 val1 = str[start:end]
00394 self.goal.jointGoal.name.append(val1)
00395 start = end
00396 end += 4
00397 (length,) = _struct_I.unpack(str[start:end])
00398 pattern = '<%sd'%length
00399 start = end
00400 end += struct.calcsize(pattern)
00401 self.goal.jointGoal.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00402 start = end
00403 end += 4
00404 (length,) = _struct_I.unpack(str[start:end])
00405 pattern = '<%sd'%length
00406 start = end
00407 end += struct.calcsize(pattern)
00408 self.goal.jointGoal.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00409 start = end
00410 end += 4
00411 (length,) = _struct_I.unpack(str[start:end])
00412 pattern = '<%sd'%length
00413 start = end
00414 end += struct.calcsize(pattern)
00415 self.goal.jointGoal.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00416 return self
00417 except struct.error as e:
00418 raise genpy.DeserializationError(e)
00419
00420 _struct_I = genpy.struct_I
00421 _struct_3I = struct.Struct("<3I")
00422 _struct_2I = struct.Struct("<2I")