00001 """autogenerated by genmsg_py from TwistLimits.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import safe_base_controller.msg
00006
00007 class TwistLimits(roslib.message.Message):
00008 _md5sum = "5235fa346310174a9a636f40a549504a"
00009 _type = "safe_base_controller/TwistLimits"
00010 _has_header = False
00011 _full_text = """# This expresses velocity limits in free space broken into it's linear and angular limit parts.
00012 Vector3Limits linear
00013 Vector3Limits angular
00014
00015 ================================================================================
00016 MSG: safe_base_controller/Vector3Limits
00017 # This represents limits for a vector in free space.
00018 float64 x_min
00019 float64 x_max
00020 float64 y_min
00021 float64 y_max
00022 float64 z_min
00023 float64 z_max
00024
00025 """
00026 __slots__ = ['linear','angular']
00027 _slot_types = ['safe_base_controller/Vector3Limits','safe_base_controller/Vector3Limits']
00028
00029 def __init__(self, *args, **kwds):
00030 """
00031 Constructor. Any message fields that are implicitly/explicitly
00032 set to None will be assigned a default value. The recommend
00033 use is keyword arguments as this is more robust to future message
00034 changes. You cannot mix in-order arguments and keyword arguments.
00035
00036 The available fields are:
00037 linear,angular
00038
00039 @param args: complete set of field values, in .msg order
00040 @param kwds: use keyword arguments corresponding to message field names
00041 to set specific fields.
00042 """
00043 if args or kwds:
00044 super(TwistLimits, self).__init__(*args, **kwds)
00045
00046 if self.linear is None:
00047 self.linear = safe_base_controller.msg.Vector3Limits()
00048 if self.angular is None:
00049 self.angular = safe_base_controller.msg.Vector3Limits()
00050 else:
00051 self.linear = safe_base_controller.msg.Vector3Limits()
00052 self.angular = safe_base_controller.msg.Vector3Limits()
00053
00054 def _get_types(self):
00055 """
00056 internal API method
00057 """
00058 return self._slot_types
00059
00060 def serialize(self, buff):
00061 """
00062 serialize message into buffer
00063 @param buff: buffer
00064 @type buff: StringIO
00065 """
00066 try:
00067 _x = self
00068 buff.write(_struct_12d.pack(_x.linear.x_min, _x.linear.x_max, _x.linear.y_min, _x.linear.y_max, _x.linear.z_min, _x.linear.z_max, _x.angular.x_min, _x.angular.x_max, _x.angular.y_min, _x.angular.y_max, _x.angular.z_min, _x.angular.z_max))
00069 except struct.error, se: self._check_types(se)
00070 except TypeError, te: self._check_types(te)
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 @param str: byte array of serialized message
00076 @type str: str
00077 """
00078 try:
00079 if self.linear is None:
00080 self.linear = safe_base_controller.msg.Vector3Limits()
00081 if self.angular is None:
00082 self.angular = safe_base_controller.msg.Vector3Limits()
00083 end = 0
00084 _x = self
00085 start = end
00086 end += 96
00087 (_x.linear.x_min, _x.linear.x_max, _x.linear.y_min, _x.linear.y_max, _x.linear.z_min, _x.linear.z_max, _x.angular.x_min, _x.angular.x_max, _x.angular.y_min, _x.angular.y_max, _x.angular.z_min, _x.angular.z_max,) = _struct_12d.unpack(str[start:end])
00088 return self
00089 except struct.error, e:
00090 raise roslib.message.DeserializationError(e)
00091
00092
00093 def serialize_numpy(self, buff, numpy):
00094 """
00095 serialize message with numpy array types into buffer
00096 @param buff: buffer
00097 @type buff: StringIO
00098 @param numpy: numpy python module
00099 @type numpy module
00100 """
00101 try:
00102 _x = self
00103 buff.write(_struct_12d.pack(_x.linear.x_min, _x.linear.x_max, _x.linear.y_min, _x.linear.y_max, _x.linear.z_min, _x.linear.z_max, _x.angular.x_min, _x.angular.x_max, _x.angular.y_min, _x.angular.y_max, _x.angular.z_min, _x.angular.z_max))
00104 except struct.error, se: self._check_types(se)
00105 except TypeError, te: self._check_types(te)
00106
00107 def deserialize_numpy(self, str, numpy):
00108 """
00109 unpack serialized message in str into this message instance using numpy for array types
00110 @param str: byte array of serialized message
00111 @type str: str
00112 @param numpy: numpy python module
00113 @type numpy: module
00114 """
00115 try:
00116 if self.linear is None:
00117 self.linear = safe_base_controller.msg.Vector3Limits()
00118 if self.angular is None:
00119 self.angular = safe_base_controller.msg.Vector3Limits()
00120 end = 0
00121 _x = self
00122 start = end
00123 end += 96
00124 (_x.linear.x_min, _x.linear.x_max, _x.linear.y_min, _x.linear.y_max, _x.linear.z_min, _x.linear.z_max, _x.angular.x_min, _x.angular.x_max, _x.angular.y_min, _x.angular.y_max, _x.angular.z_min, _x.angular.z_max,) = _struct_12d.unpack(str[start:end])
00125 return self
00126 except struct.error, e:
00127 raise roslib.message.DeserializationError(e)
00128
00129 _struct_I = roslib.message.struct_I
00130 _struct_12d = struct.Struct("<12d")