00001 """autogenerated by genpy from arm_navigation_msgs/JointLimits.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 JointLimits(genpy.Message):
00009 _md5sum = "8ca618c7329ea46142cbc864a2efe856"
00010 _type = "arm_navigation_msgs/JointLimits"
00011 _has_header = False
00012 _full_text = """# This message contains information about limits of a particular joint (or control dimension)
00013 string joint_name
00014
00015 # true if the joint has position limits
00016 bool has_position_limits
00017
00018 # min and max position limits
00019 float64 min_position
00020 float64 max_position
00021
00022 # true if joint has velocity limits
00023 bool has_velocity_limits
00024
00025 # max velocity limit
00026 float64 max_velocity
00027 # min_velocity is assumed to be -max_velocity
00028
00029 # true if joint has acceleration limits
00030 bool has_acceleration_limits
00031 # max acceleration limit
00032 float64 max_acceleration
00033 # min_acceleration is assumed to be -max_acceleration
00034
00035 """
00036 __slots__ = ['joint_name','has_position_limits','min_position','max_position','has_velocity_limits','max_velocity','has_acceleration_limits','max_acceleration']
00037 _slot_types = ['string','bool','float64','float64','bool','float64','bool','float64']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 joint_name,has_position_limits,min_position,max_position,has_velocity_limits,max_velocity,has_acceleration_limits,max_acceleration
00048
00049 :param args: complete set of field values, in .msg order
00050 :param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(JointLimits, self).__init__(*args, **kwds)
00055
00056 if self.joint_name is None:
00057 self.joint_name = ''
00058 if self.has_position_limits is None:
00059 self.has_position_limits = False
00060 if self.min_position is None:
00061 self.min_position = 0.
00062 if self.max_position is None:
00063 self.max_position = 0.
00064 if self.has_velocity_limits is None:
00065 self.has_velocity_limits = False
00066 if self.max_velocity is None:
00067 self.max_velocity = 0.
00068 if self.has_acceleration_limits is None:
00069 self.has_acceleration_limits = False
00070 if self.max_acceleration is None:
00071 self.max_acceleration = 0.
00072 else:
00073 self.joint_name = ''
00074 self.has_position_limits = False
00075 self.min_position = 0.
00076 self.max_position = 0.
00077 self.has_velocity_limits = False
00078 self.max_velocity = 0.
00079 self.has_acceleration_limits = False
00080 self.max_acceleration = 0.
00081
00082 def _get_types(self):
00083 """
00084 internal API method
00085 """
00086 return self._slot_types
00087
00088 def serialize(self, buff):
00089 """
00090 serialize message into buffer
00091 :param buff: buffer, ``StringIO``
00092 """
00093 try:
00094 _x = self.joint_name
00095 length = len(_x)
00096 if python3 or type(_x) == unicode:
00097 _x = _x.encode('utf-8')
00098 length = len(_x)
00099 buff.write(struct.pack('<I%ss'%length, length, _x))
00100 _x = self
00101 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))
00102 except struct.error as se: self._check_types(se)
00103 except TypeError as te: self._check_types(te)
00104
00105 def deserialize(self, str):
00106 """
00107 unpack serialized message in str into this message instance
00108 :param str: byte array of serialized message, ``str``
00109 """
00110 try:
00111 end = 0
00112 start = end
00113 end += 4
00114 (length,) = _struct_I.unpack(str[start:end])
00115 start = end
00116 end += length
00117 if python3:
00118 self.joint_name = str[start:end].decode('utf-8')
00119 else:
00120 self.joint_name = str[start:end]
00121 _x = self
00122 start = end
00123 end += 35
00124 (_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])
00125 self.has_position_limits = bool(self.has_position_limits)
00126 self.has_velocity_limits = bool(self.has_velocity_limits)
00127 self.has_acceleration_limits = bool(self.has_acceleration_limits)
00128 return self
00129 except struct.error as e:
00130 raise genpy.DeserializationError(e)
00131
00132
00133 def serialize_numpy(self, buff, numpy):
00134 """
00135 serialize message with numpy array types into buffer
00136 :param buff: buffer, ``StringIO``
00137 :param numpy: numpy python module
00138 """
00139 try:
00140 _x = self.joint_name
00141 length = len(_x)
00142 if python3 or type(_x) == unicode:
00143 _x = _x.encode('utf-8')
00144 length = len(_x)
00145 buff.write(struct.pack('<I%ss'%length, length, _x))
00146 _x = self
00147 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))
00148 except struct.error as se: self._check_types(se)
00149 except TypeError as te: self._check_types(te)
00150
00151 def deserialize_numpy(self, str, numpy):
00152 """
00153 unpack serialized message in str into this message instance using numpy for array types
00154 :param str: byte array of serialized message, ``str``
00155 :param numpy: numpy python module
00156 """
00157 try:
00158 end = 0
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 start = end
00163 end += length
00164 if python3:
00165 self.joint_name = str[start:end].decode('utf-8')
00166 else:
00167 self.joint_name = str[start:end]
00168 _x = self
00169 start = end
00170 end += 35
00171 (_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])
00172 self.has_position_limits = bool(self.has_position_limits)
00173 self.has_velocity_limits = bool(self.has_velocity_limits)
00174 self.has_acceleration_limits = bool(self.has_acceleration_limits)
00175 return self
00176 except struct.error as e:
00177 raise genpy.DeserializationError(e)
00178
00179 _struct_I = genpy.struct_I
00180 _struct_B2dBdBd = struct.Struct("<B2dBdBd")