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