00001 """autogenerated by genmsg_py from JointConstraint.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import brics_actuator.msg
00006 import roslib.rostime
00007
00008 class JointConstraint(roslib.message.Message):
00009 _md5sum = "f77db04949b26b64f80564df22f00ecb"
00010 _type = "brics_actuator/JointConstraint"
00011 _has_header = False
00012 _full_text = """string type #smaller, greater, equal or <, >, =
00013 JointValue value
00014
00015 ================================================================================
00016 MSG: brics_actuator/JointValue
00017 time timeStamp #time of the data
00018 string joint_uri
00019 string unit #if empy expects si units, you can use boost::unit
00020 float64 value
00021
00022 """
00023 __slots__ = ['type','value']
00024 _slot_types = ['string','brics_actuator/JointValue']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 type,value
00035
00036 @param args: complete set of field values, in .msg order
00037 @param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(JointConstraint, self).__init__(*args, **kwds)
00042
00043 if self.type is None:
00044 self.type = ''
00045 if self.value is None:
00046 self.value = brics_actuator.msg.JointValue()
00047 else:
00048 self.type = ''
00049 self.value = brics_actuator.msg.JointValue()
00050
00051 def _get_types(self):
00052 """
00053 internal API method
00054 """
00055 return self._slot_types
00056
00057 def serialize(self, buff):
00058 """
00059 serialize message into buffer
00060 @param buff: buffer
00061 @type buff: StringIO
00062 """
00063 try:
00064 _x = self.type
00065 length = len(_x)
00066 buff.write(struct.pack('<I%ss'%length, length, _x))
00067 _x = self
00068 buff.write(_struct_2I.pack(_x.value.timeStamp.secs, _x.value.timeStamp.nsecs))
00069 _x = self.value.joint_uri
00070 length = len(_x)
00071 buff.write(struct.pack('<I%ss'%length, length, _x))
00072 _x = self.value.unit
00073 length = len(_x)
00074 buff.write(struct.pack('<I%ss'%length, length, _x))
00075 buff.write(_struct_d.pack(self.value.value))
00076 except struct.error, se: self._check_types(se)
00077 except TypeError, te: self._check_types(te)
00078
00079 def deserialize(self, str):
00080 """
00081 unpack serialized message in str into this message instance
00082 @param str: byte array of serialized message
00083 @type str: str
00084 """
00085 try:
00086 if self.value is None:
00087 self.value = brics_actuator.msg.JointValue()
00088 end = 0
00089 start = end
00090 end += 4
00091 (length,) = _struct_I.unpack(str[start:end])
00092 start = end
00093 end += length
00094 self.type = str[start:end]
00095 _x = self
00096 start = end
00097 end += 8
00098 (_x.value.timeStamp.secs, _x.value.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end])
00099 start = end
00100 end += 4
00101 (length,) = _struct_I.unpack(str[start:end])
00102 start = end
00103 end += length
00104 self.value.joint_uri = str[start:end]
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 start = end
00109 end += length
00110 self.value.unit = str[start:end]
00111 start = end
00112 end += 8
00113 (self.value.value,) = _struct_d.unpack(str[start:end])
00114 return self
00115 except struct.error, e:
00116 raise roslib.message.DeserializationError(e)
00117
00118
00119 def serialize_numpy(self, buff, numpy):
00120 """
00121 serialize message with numpy array types into buffer
00122 @param buff: buffer
00123 @type buff: StringIO
00124 @param numpy: numpy python module
00125 @type numpy module
00126 """
00127 try:
00128 _x = self.type
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _x = self
00132 buff.write(_struct_2I.pack(_x.value.timeStamp.secs, _x.value.timeStamp.nsecs))
00133 _x = self.value.joint_uri
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 _x = self.value.unit
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 buff.write(_struct_d.pack(self.value.value))
00140 except struct.error, se: self._check_types(se)
00141 except TypeError, te: self._check_types(te)
00142
00143 def deserialize_numpy(self, str, numpy):
00144 """
00145 unpack serialized message in str into this message instance using numpy for array types
00146 @param str: byte array of serialized message
00147 @type str: str
00148 @param numpy: numpy python module
00149 @type numpy: module
00150 """
00151 try:
00152 if self.value is None:
00153 self.value = brics_actuator.msg.JointValue()
00154 end = 0
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 start = end
00159 end += length
00160 self.type = str[start:end]
00161 _x = self
00162 start = end
00163 end += 8
00164 (_x.value.timeStamp.secs, _x.value.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end])
00165 start = end
00166 end += 4
00167 (length,) = _struct_I.unpack(str[start:end])
00168 start = end
00169 end += length
00170 self.value.joint_uri = str[start:end]
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 self.value.unit = str[start:end]
00177 start = end
00178 end += 8
00179 (self.value.value,) = _struct_d.unpack(str[start:end])
00180 return self
00181 except struct.error, e:
00182 raise roslib.message.DeserializationError(e)
00183
00184 _struct_I = roslib.message.struct_I
00185 _struct_2I = struct.Struct("<2I")
00186 _struct_d = struct.Struct("<d")