00001 """autogenerated by genpy from lwr_fri/FriJointState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class FriJointState(genpy.Message):
00009 _md5sum = "0aaff558814188d51a3ef7a1023d53a7"
00010 _type = "lwr_fri/FriJointState"
00011 _has_header = False
00012 _full_text = """float32[7] msrJntPos
00013 float32[7] cmdJntPos
00014 float32[7] cmdJntPosFriOffset
00015 float32[7] msrJntTrq
00016 float32[7] estExtJntTrq
00017 float32[7] gravity
00018 """
00019 __slots__ = ['msrJntPos','cmdJntPos','cmdJntPosFriOffset','msrJntTrq','estExtJntTrq','gravity']
00020 _slot_types = ['float32[7]','float32[7]','float32[7]','float32[7]','float32[7]','float32[7]']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 msrJntPos,cmdJntPos,cmdJntPosFriOffset,msrJntTrq,estExtJntTrq,gravity
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(FriJointState, self).__init__(*args, **kwds)
00038
00039 if self.msrJntPos is None:
00040 self.msrJntPos = [0.,0.,0.,0.,0.,0.,0.]
00041 if self.cmdJntPos is None:
00042 self.cmdJntPos = [0.,0.,0.,0.,0.,0.,0.]
00043 if self.cmdJntPosFriOffset is None:
00044 self.cmdJntPosFriOffset = [0.,0.,0.,0.,0.,0.,0.]
00045 if self.msrJntTrq is None:
00046 self.msrJntTrq = [0.,0.,0.,0.,0.,0.,0.]
00047 if self.estExtJntTrq is None:
00048 self.estExtJntTrq = [0.,0.,0.,0.,0.,0.,0.]
00049 if self.gravity is None:
00050 self.gravity = [0.,0.,0.,0.,0.,0.,0.]
00051 else:
00052 self.msrJntPos = [0.,0.,0.,0.,0.,0.,0.]
00053 self.cmdJntPos = [0.,0.,0.,0.,0.,0.,0.]
00054 self.cmdJntPosFriOffset = [0.,0.,0.,0.,0.,0.,0.]
00055 self.msrJntTrq = [0.,0.,0.,0.,0.,0.,0.]
00056 self.estExtJntTrq = [0.,0.,0.,0.,0.,0.,0.]
00057 self.gravity = [0.,0.,0.,0.,0.,0.,0.]
00058
00059 def _get_types(self):
00060 """
00061 internal API method
00062 """
00063 return self._slot_types
00064
00065 def serialize(self, buff):
00066 """
00067 serialize message into buffer
00068 :param buff: buffer, ``StringIO``
00069 """
00070 try:
00071 buff.write(_struct_7f.pack(*self.msrJntPos))
00072 buff.write(_struct_7f.pack(*self.cmdJntPos))
00073 buff.write(_struct_7f.pack(*self.cmdJntPosFriOffset))
00074 buff.write(_struct_7f.pack(*self.msrJntTrq))
00075 buff.write(_struct_7f.pack(*self.estExtJntTrq))
00076 buff.write(_struct_7f.pack(*self.gravity))
00077 except struct.error as se: self._check_types(se)
00078 except TypeError as te: self._check_types(te)
00079
00080 def deserialize(self, str):
00081 """
00082 unpack serialized message in str into this message instance
00083 :param str: byte array of serialized message, ``str``
00084 """
00085 try:
00086 end = 0
00087 start = end
00088 end += 28
00089 self.msrJntPos = _struct_7f.unpack(str[start:end])
00090 start = end
00091 end += 28
00092 self.cmdJntPos = _struct_7f.unpack(str[start:end])
00093 start = end
00094 end += 28
00095 self.cmdJntPosFriOffset = _struct_7f.unpack(str[start:end])
00096 start = end
00097 end += 28
00098 self.msrJntTrq = _struct_7f.unpack(str[start:end])
00099 start = end
00100 end += 28
00101 self.estExtJntTrq = _struct_7f.unpack(str[start:end])
00102 start = end
00103 end += 28
00104 self.gravity = _struct_7f.unpack(str[start:end])
00105 return self
00106 except struct.error as e:
00107 raise genpy.DeserializationError(e)
00108
00109
00110 def serialize_numpy(self, buff, numpy):
00111 """
00112 serialize message with numpy array types into buffer
00113 :param buff: buffer, ``StringIO``
00114 :param numpy: numpy python module
00115 """
00116 try:
00117 buff.write(self.msrJntPos.tostring())
00118 buff.write(self.cmdJntPos.tostring())
00119 buff.write(self.cmdJntPosFriOffset.tostring())
00120 buff.write(self.msrJntTrq.tostring())
00121 buff.write(self.estExtJntTrq.tostring())
00122 buff.write(self.gravity.tostring())
00123 except struct.error as se: self._check_types(se)
00124 except TypeError as te: self._check_types(te)
00125
00126 def deserialize_numpy(self, str, numpy):
00127 """
00128 unpack serialized message in str into this message instance using numpy for array types
00129 :param str: byte array of serialized message, ``str``
00130 :param numpy: numpy python module
00131 """
00132 try:
00133 end = 0
00134 start = end
00135 end += 28
00136 self.msrJntPos = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00137 start = end
00138 end += 28
00139 self.cmdJntPos = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00140 start = end
00141 end += 28
00142 self.cmdJntPosFriOffset = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00143 start = end
00144 end += 28
00145 self.msrJntTrq = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00146 start = end
00147 end += 28
00148 self.estExtJntTrq = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00149 start = end
00150 end += 28
00151 self.gravity = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00152 return self
00153 except struct.error as e:
00154 raise genpy.DeserializationError(e)
00155
00156 _struct_I = genpy.struct_I
00157 _struct_7f = struct.Struct("<7f")