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