_KinematicSolverInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from kinematics_msgs/KinematicSolverInfo.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 arm_navigation_msgs.msg
00008 
00009 class KinematicSolverInfo(genpy.Message):
00010   _md5sum = "cc048557c0f9795c392dd80f8bb00489"
00011   _type = "kinematics_msgs/KinematicSolverInfo"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# A list of joints in the kinematic tree
00014 string[] joint_names
00015 # A list of joint limits corresponding to the joint names
00016 arm_navigation_msgs/JointLimits[] limits
00017 # A list of links that the kinematics node provides solutions for
00018 string[] link_names
00019 
00020 ================================================================================
00021 MSG: arm_navigation_msgs/JointLimits
00022 # This message contains information about limits of a particular joint (or control dimension)
00023 string joint_name
00024 
00025 # true if the joint has position limits
00026 bool has_position_limits
00027 
00028 # min and max position limits
00029 float64 min_position
00030 float64 max_position
00031 
00032 # true if joint has velocity limits
00033 bool has_velocity_limits
00034 
00035 # max velocity limit
00036 float64 max_velocity
00037 # min_velocity is assumed to be -max_velocity
00038 
00039 # true if joint has acceleration limits
00040 bool has_acceleration_limits
00041 # max acceleration limit
00042 float64 max_acceleration
00043 # min_acceleration is assumed to be -max_acceleration
00044 
00045 """
00046   __slots__ = ['joint_names','limits','link_names']
00047   _slot_types = ['string[]','arm_navigation_msgs/JointLimits[]','string[]']
00048 
00049   def __init__(self, *args, **kwds):
00050     """
00051     Constructor. Any message fields that are implicitly/explicitly
00052     set to None will be assigned a default value. The recommend
00053     use is keyword arguments as this is more robust to future message
00054     changes.  You cannot mix in-order arguments and keyword arguments.
00055 
00056     The available fields are:
00057        joint_names,limits,link_names
00058 
00059     :param args: complete set of field values, in .msg order
00060     :param kwds: use keyword arguments corresponding to message field names
00061     to set specific fields.
00062     """
00063     if args or kwds:
00064       super(KinematicSolverInfo, self).__init__(*args, **kwds)
00065       #message fields cannot be None, assign default values for those that are
00066       if self.joint_names is None:
00067         self.joint_names = []
00068       if self.limits is None:
00069         self.limits = []
00070       if self.link_names is None:
00071         self.link_names = []
00072     else:
00073       self.joint_names = []
00074       self.limits = []
00075       self.link_names = []
00076 
00077   def _get_types(self):
00078     """
00079     internal API method
00080     """
00081     return self._slot_types
00082 
00083   def serialize(self, buff):
00084     """
00085     serialize message into buffer
00086     :param buff: buffer, ``StringIO``
00087     """
00088     try:
00089       length = len(self.joint_names)
00090       buff.write(_struct_I.pack(length))
00091       for val1 in self.joint_names:
00092         length = len(val1)
00093         if python3 or type(val1) == unicode:
00094           val1 = val1.encode('utf-8')
00095           length = len(val1)
00096         buff.write(struct.pack('<I%ss'%length, length, val1))
00097       length = len(self.limits)
00098       buff.write(_struct_I.pack(length))
00099       for val1 in self.limits:
00100         _x = val1.joint_name
00101         length = len(_x)
00102         if python3 or type(_x) == unicode:
00103           _x = _x.encode('utf-8')
00104           length = len(_x)
00105         buff.write(struct.pack('<I%ss'%length, length, _x))
00106         _x = val1
00107         buff.write(_struct_B2dBdBd.pack(_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration))
00108       length = len(self.link_names)
00109       buff.write(_struct_I.pack(length))
00110       for val1 in self.link_names:
00111         length = len(val1)
00112         if python3 or type(val1) == unicode:
00113           val1 = val1.encode('utf-8')
00114           length = len(val1)
00115         buff.write(struct.pack('<I%ss'%length, length, val1))
00116     except struct.error as se: self._check_types(se)
00117     except TypeError as te: self._check_types(te)
00118 
00119   def deserialize(self, str):
00120     """
00121     unpack serialized message in str into this message instance
00122     :param str: byte array of serialized message, ``str``
00123     """
00124     try:
00125       if self.limits is None:
00126         self.limits = None
00127       end = 0
00128       start = end
00129       end += 4
00130       (length,) = _struct_I.unpack(str[start:end])
00131       self.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         if python3:
00139           val1 = str[start:end].decode('utf-8')
00140         else:
00141           val1 = str[start:end]
00142         self.joint_names.append(val1)
00143       start = end
00144       end += 4
00145       (length,) = _struct_I.unpack(str[start:end])
00146       self.limits = []
00147       for i in range(0, length):
00148         val1 = arm_navigation_msgs.msg.JointLimits()
00149         start = end
00150         end += 4
00151         (length,) = _struct_I.unpack(str[start:end])
00152         start = end
00153         end += length
00154         if python3:
00155           val1.joint_name = str[start:end].decode('utf-8')
00156         else:
00157           val1.joint_name = str[start:end]
00158         _x = val1
00159         start = end
00160         end += 35
00161         (_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration,) = _struct_B2dBdBd.unpack(str[start:end])
00162         val1.has_position_limits = bool(val1.has_position_limits)
00163         val1.has_velocity_limits = bool(val1.has_velocity_limits)
00164         val1.has_acceleration_limits = bool(val1.has_acceleration_limits)
00165         self.limits.append(val1)
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       self.link_names = []
00170       for i in range(0, length):
00171         start = end
00172         end += 4
00173         (length,) = _struct_I.unpack(str[start:end])
00174         start = end
00175         end += length
00176         if python3:
00177           val1 = str[start:end].decode('utf-8')
00178         else:
00179           val1 = str[start:end]
00180         self.link_names.append(val1)
00181       return self
00182     except struct.error as e:
00183       raise genpy.DeserializationError(e) #most likely buffer underfill
00184 
00185 
00186   def serialize_numpy(self, buff, numpy):
00187     """
00188     serialize message with numpy array types into buffer
00189     :param buff: buffer, ``StringIO``
00190     :param numpy: numpy python module
00191     """
00192     try:
00193       length = len(self.joint_names)
00194       buff.write(_struct_I.pack(length))
00195       for val1 in self.joint_names:
00196         length = len(val1)
00197         if python3 or type(val1) == unicode:
00198           val1 = val1.encode('utf-8')
00199           length = len(val1)
00200         buff.write(struct.pack('<I%ss'%length, length, val1))
00201       length = len(self.limits)
00202       buff.write(_struct_I.pack(length))
00203       for val1 in self.limits:
00204         _x = val1.joint_name
00205         length = len(_x)
00206         if python3 or type(_x) == unicode:
00207           _x = _x.encode('utf-8')
00208           length = len(_x)
00209         buff.write(struct.pack('<I%ss'%length, length, _x))
00210         _x = val1
00211         buff.write(_struct_B2dBdBd.pack(_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration))
00212       length = len(self.link_names)
00213       buff.write(_struct_I.pack(length))
00214       for val1 in self.link_names:
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     except struct.error as se: self._check_types(se)
00221     except TypeError as te: self._check_types(te)
00222 
00223   def deserialize_numpy(self, str, numpy):
00224     """
00225     unpack serialized message in str into this message instance using numpy for array types
00226     :param str: byte array of serialized message, ``str``
00227     :param numpy: numpy python module
00228     """
00229     try:
00230       if self.limits is None:
00231         self.limits = None
00232       end = 0
00233       start = end
00234       end += 4
00235       (length,) = _struct_I.unpack(str[start:end])
00236       self.joint_names = []
00237       for i in range(0, length):
00238         start = end
00239         end += 4
00240         (length,) = _struct_I.unpack(str[start:end])
00241         start = end
00242         end += length
00243         if python3:
00244           val1 = str[start:end].decode('utf-8')
00245         else:
00246           val1 = str[start:end]
00247         self.joint_names.append(val1)
00248       start = end
00249       end += 4
00250       (length,) = _struct_I.unpack(str[start:end])
00251       self.limits = []
00252       for i in range(0, length):
00253         val1 = arm_navigation_msgs.msg.JointLimits()
00254         start = end
00255         end += 4
00256         (length,) = _struct_I.unpack(str[start:end])
00257         start = end
00258         end += length
00259         if python3:
00260           val1.joint_name = str[start:end].decode('utf-8')
00261         else:
00262           val1.joint_name = str[start:end]
00263         _x = val1
00264         start = end
00265         end += 35
00266         (_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration,) = _struct_B2dBdBd.unpack(str[start:end])
00267         val1.has_position_limits = bool(val1.has_position_limits)
00268         val1.has_velocity_limits = bool(val1.has_velocity_limits)
00269         val1.has_acceleration_limits = bool(val1.has_acceleration_limits)
00270         self.limits.append(val1)
00271       start = end
00272       end += 4
00273       (length,) = _struct_I.unpack(str[start:end])
00274       self.link_names = []
00275       for i in range(0, length):
00276         start = end
00277         end += 4
00278         (length,) = _struct_I.unpack(str[start:end])
00279         start = end
00280         end += length
00281         if python3:
00282           val1 = str[start:end].decode('utf-8')
00283         else:
00284           val1 = str[start:end]
00285         self.link_names.append(val1)
00286       return self
00287     except struct.error as e:
00288       raise genpy.DeserializationError(e) #most likely buffer underfill
00289 
00290 _struct_I = genpy.struct_I
00291 _struct_B2dBdBd = struct.Struct("<B2dBdBd")


kinematics_msgs
Author(s): Sachin Chitta
autogenerated on Mon Dec 2 2013 12:32:53