_JointTolerance.py
Go to the documentation of this file.
00001 """autogenerated by genpy from control_msgs/JointTolerance.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class JointTolerance(genpy.Message):
00009   _md5sum = "f544fe9c16cf04547e135dd6063ff5be"
00010   _type = "control_msgs/JointTolerance"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# The tolerances specify the amount the position, velocity, and
00013 # accelerations can vary from the setpoints.  For example, in the case
00014 # of trajectory control, when the actual position varies beyond
00015 # (desired position + position tolerance), the trajectory goal may
00016 # abort.
00017 # 
00018 # There are two special values for tolerances:
00019 #  * 0 - The tolerance is unspecified and will remain at whatever the default is
00020 #  * -1 - The tolerance is "erased".  If there was a default, the joint will be
00021 #         allowed to move without restriction.
00022 
00023 string name
00024 float64 position  # in radians or meters (for a revolute or prismatic joint, respectively)
00025 float64 velocity  # in rad/sec or m/sec
00026 float64 acceleration  # in rad/sec^2 or m/sec^2
00027 
00028 """
00029   __slots__ = ['name','position','velocity','acceleration']
00030   _slot_types = ['string','float64','float64','float64']
00031 
00032   def __init__(self, *args, **kwds):
00033     """
00034     Constructor. Any message fields that are implicitly/explicitly
00035     set to None will be assigned a default value. The recommend
00036     use is keyword arguments as this is more robust to future message
00037     changes.  You cannot mix in-order arguments and keyword arguments.
00038 
00039     The available fields are:
00040        name,position,velocity,acceleration
00041 
00042     :param args: complete set of field values, in .msg order
00043     :param kwds: use keyword arguments corresponding to message field names
00044     to set specific fields.
00045     """
00046     if args or kwds:
00047       super(JointTolerance, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.name is None:
00050         self.name = ''
00051       if self.position is None:
00052         self.position = 0.
00053       if self.velocity is None:
00054         self.velocity = 0.
00055       if self.acceleration is None:
00056         self.acceleration = 0.
00057     else:
00058       self.name = ''
00059       self.position = 0.
00060       self.velocity = 0.
00061       self.acceleration = 0.
00062 
00063   def _get_types(self):
00064     """
00065     internal API method
00066     """
00067     return self._slot_types
00068 
00069   def serialize(self, buff):
00070     """
00071     serialize message into buffer
00072     :param buff: buffer, ``StringIO``
00073     """
00074     try:
00075       _x = self.name
00076       length = len(_x)
00077       if python3 or type(_x) == unicode:
00078         _x = _x.encode('utf-8')
00079         length = len(_x)
00080       buff.write(struct.pack('<I%ss'%length, length, _x))
00081       _x = self
00082       buff.write(_struct_3d.pack(_x.position, _x.velocity, _x.acceleration))
00083     except struct.error as se: self._check_types(se)
00084     except TypeError as te: self._check_types(te)
00085 
00086   def deserialize(self, str):
00087     """
00088     unpack serialized message in str into this message instance
00089     :param str: byte array of serialized message, ``str``
00090     """
00091     try:
00092       end = 0
00093       start = end
00094       end += 4
00095       (length,) = _struct_I.unpack(str[start:end])
00096       start = end
00097       end += length
00098       if python3:
00099         self.name = str[start:end].decode('utf-8')
00100       else:
00101         self.name = str[start:end]
00102       _x = self
00103       start = end
00104       end += 24
00105       (_x.position, _x.velocity, _x.acceleration,) = _struct_3d.unpack(str[start:end])
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 
00111   def serialize_numpy(self, buff, numpy):
00112     """
00113     serialize message with numpy array types into buffer
00114     :param buff: buffer, ``StringIO``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       _x = self.name
00119       length = len(_x)
00120       if python3 or type(_x) == unicode:
00121         _x = _x.encode('utf-8')
00122         length = len(_x)
00123       buff.write(struct.pack('<I%ss'%length, length, _x))
00124       _x = self
00125       buff.write(_struct_3d.pack(_x.position, _x.velocity, _x.acceleration))
00126     except struct.error as se: self._check_types(se)
00127     except TypeError as te: self._check_types(te)
00128 
00129   def deserialize_numpy(self, str, numpy):
00130     """
00131     unpack serialized message in str into this message instance using numpy for array types
00132     :param str: byte array of serialized message, ``str``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       end = 0
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       start = end
00141       end += length
00142       if python3:
00143         self.name = str[start:end].decode('utf-8')
00144       else:
00145         self.name = str[start:end]
00146       _x = self
00147       start = end
00148       end += 24
00149       (_x.position, _x.velocity, _x.acceleration,) = _struct_3d.unpack(str[start:end])
00150       return self
00151     except struct.error as e:
00152       raise genpy.DeserializationError(e) #most likely buffer underfill
00153 
00154 _struct_I = genpy.struct_I
00155 _struct_3d = struct.Struct("<3d")


control_msgs
Author(s): Stuart Glaser
autogenerated on Sat Dec 28 2013 16:52:54