00001 """autogenerated by genmsg_py from WrenchStamped.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class WrenchStamped(roslib.message.Message):
00009 _md5sum = "d78d3cb249ce23087ade7e7d0c40cfa7"
00010 _type = "geometry_msgs/WrenchStamped"
00011 _has_header = True
00012 _full_text = """# A wrench with reference coordinate frame and timestamp
00013 Header header
00014 Wrench wrench
00015
00016 ================================================================================
00017 MSG: std_msgs/Header
00018 # Standard metadata for higher-level stamped data types.
00019 # This is generally used to communicate timestamped data
00020 # in a particular coordinate frame.
00021 #
00022 # sequence ID: consecutively increasing ID
00023 uint32 seq
00024 #Two-integer timestamp that is expressed as:
00025 # * stamp.secs: seconds (stamp_secs) since epoch
00026 # * stamp.nsecs: nanoseconds since stamp_secs
00027 # time-handling sugar is provided by the client library
00028 time stamp
00029 #Frame this data is associated with
00030 # 0: no frame
00031 # 1: global frame
00032 string frame_id
00033
00034 ================================================================================
00035 MSG: geometry_msgs/Wrench
00036 # This represents force in free space, seperated into
00037 # it's linear and angular parts.
00038 Vector3 force
00039 Vector3 torque
00040
00041 ================================================================================
00042 MSG: geometry_msgs/Vector3
00043 # This represents a vector in free space.
00044
00045 float64 x
00046 float64 y
00047 float64 z
00048 """
00049 __slots__ = ['header','wrench']
00050 _slot_types = ['Header','geometry_msgs/Wrench']
00051
00052 def __init__(self, *args, **kwds):
00053 """
00054 Constructor. Any message fields that are implicitly/explicitly
00055 set to None will be assigned a default value. The recommend
00056 use is keyword arguments as this is more robust to future message
00057 changes. You cannot mix in-order arguments and keyword arguments.
00058
00059 The available fields are:
00060 header,wrench
00061
00062 @param args: complete set of field values, in .msg order
00063 @param kwds: use keyword arguments corresponding to message field names
00064 to set specific fields.
00065 """
00066 if args or kwds:
00067 super(WrenchStamped, self).__init__(*args, **kwds)
00068
00069 if self.header is None:
00070 self.header = std_msgs.msg._Header.Header()
00071 if self.wrench is None:
00072 self.wrench = geometry_msgs.msg.Wrench()
00073 else:
00074 self.header = std_msgs.msg._Header.Header()
00075 self.wrench = geometry_msgs.msg.Wrench()
00076
00077 def _get_types(self):
00078 """
00079 internal API method
00080 """
00081 return self._slot_types
00082
00083 def serialize(self, buff):
00084 """
00085 serialize message into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 """
00089 try:
00090 _x = self
00091 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00092 _x = self.header.frame_id
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 _x = self
00096 buff.write(_struct_6d.pack(_x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z))
00097 except struct.error, se: self._check_types(se)
00098 except TypeError, te: self._check_types(te)
00099
00100 def deserialize(self, str):
00101 """
00102 unpack serialized message in str into this message instance
00103 @param str: byte array of serialized message
00104 @type str: str
00105 """
00106 try:
00107 if self.header is None:
00108 self.header = std_msgs.msg._Header.Header()
00109 if self.wrench is None:
00110 self.wrench = geometry_msgs.msg.Wrench()
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 12
00115 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00116 start = end
00117 end += 4
00118 (length,) = _struct_I.unpack(str[start:end])
00119 start = end
00120 end += length
00121 self.header.frame_id = str[start:end]
00122 _x = self
00123 start = end
00124 end += 48
00125 (_x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z,) = _struct_6d.unpack(str[start:end])
00126 return self
00127 except struct.error, e:
00128 raise roslib.message.DeserializationError(e)
00129
00130
00131 def serialize_numpy(self, buff, numpy):
00132 """
00133 serialize message with numpy array types into buffer
00134 @param buff: buffer
00135 @type buff: StringIO
00136 @param numpy: numpy python module
00137 @type numpy module
00138 """
00139 try:
00140 _x = self
00141 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00142 _x = self.header.frame_id
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = self
00146 buff.write(_struct_6d.pack(_x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z))
00147 except struct.error, se: self._check_types(se)
00148 except TypeError, te: self._check_types(te)
00149
00150 def deserialize_numpy(self, str, numpy):
00151 """
00152 unpack serialized message in str into this message instance using numpy for array types
00153 @param str: byte array of serialized message
00154 @type str: str
00155 @param numpy: numpy python module
00156 @type numpy: module
00157 """
00158 try:
00159 if self.header is None:
00160 self.header = std_msgs.msg._Header.Header()
00161 if self.wrench is None:
00162 self.wrench = geometry_msgs.msg.Wrench()
00163 end = 0
00164 _x = self
00165 start = end
00166 end += 12
00167 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00168 start = end
00169 end += 4
00170 (length,) = _struct_I.unpack(str[start:end])
00171 start = end
00172 end += length
00173 self.header.frame_id = str[start:end]
00174 _x = self
00175 start = end
00176 end += 48
00177 (_x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z,) = _struct_6d.unpack(str[start:end])
00178 return self
00179 except struct.error, e:
00180 raise roslib.message.DeserializationError(e)
00181
00182 _struct_I = roslib.message.struct_I
00183 _struct_3I = struct.Struct("<3I")
00184 _struct_6d = struct.Struct("<6d")