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