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