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