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