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 = "c3664ae4e985c5c886bfcffcbc6f1044"
00008 _type = "motion_planning_msgs/JointLimits"
00009 _has_header = False
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 uint8 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 uint8 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 uint8 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','uint8','float64','float64','uint8','float64','uint8','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
00054 if self.joint_name is None:
00055 self.joint_name = ''
00056 if self.has_position_limits is None:
00057 self.has_position_limits = 0
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 = 0
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 = 0
00068 if self.max_acceleration is None:
00069 self.max_acceleration = 0.
00070 else:
00071 self.joint_name = ''
00072 self.has_position_limits = 0
00073 self.min_position = 0.
00074 self.max_position = 0.
00075 self.has_velocity_limits = 0
00076 self.max_velocity = 0.
00077 self.has_acceleration_limits = 0
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, se: self._check_types(se)
00099 except TypeError, 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 return self
00120 except struct.error, e:
00121 raise roslib.message.DeserializationError(e)
00122
00123
00124 def serialize_numpy(self, buff, numpy):
00125 """
00126 serialize message with numpy array types into buffer
00127 @param buff: buffer
00128 @type buff: StringIO
00129 @param numpy: numpy python module
00130 @type numpy module
00131 """
00132 try:
00133 _x = self.joint_name
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 _x = self
00137 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))
00138 except struct.error, se: self._check_types(se)
00139 except TypeError, te: self._check_types(te)
00140
00141 def deserialize_numpy(self, str, numpy):
00142 """
00143 unpack serialized message in str into this message instance using numpy for array types
00144 @param str: byte array of serialized message
00145 @type str: str
00146 @param numpy: numpy python module
00147 @type numpy: module
00148 """
00149 try:
00150 end = 0
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 self.joint_name = str[start:end]
00157 _x = self
00158 start = end
00159 end += 35
00160 (_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])
00161 return self
00162 except struct.error, e:
00163 raise roslib.message.DeserializationError(e)
00164
00165 _struct_I = roslib.message.struct_I
00166 _struct_B2dBdBd = struct.Struct("<B2dBdBd")