_NamedWrench.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrpsys_gazebo_msgs/NamedWrench.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 
00009 class NamedWrench(genpy.Message):
00010   _md5sum = "878fbb0063ff61f929487364e3ab722a"
00011   _type = "hrpsys_gazebo_msgs/NamedWrench"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """string Name
00014 geometry_msgs/Vector3  force
00015 geometry_msgs/Vector3  torque
00016 
00017 ================================================================================
00018 MSG: geometry_msgs/Vector3
00019 # This represents a vector in free space. 
00020 
00021 float64 x
00022 float64 y
00023 float64 z
00024 """
00025   __slots__ = ['Name','force','torque']
00026   _slot_types = ['string','geometry_msgs/Vector3','geometry_msgs/Vector3']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        Name,force,torque
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(NamedWrench, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.Name is None:
00046         self.Name = ''
00047       if self.force is None:
00048         self.force = geometry_msgs.msg.Vector3()
00049       if self.torque is None:
00050         self.torque = geometry_msgs.msg.Vector3()
00051     else:
00052       self.Name = ''
00053       self.force = geometry_msgs.msg.Vector3()
00054       self.torque = geometry_msgs.msg.Vector3()
00055 
00056   def _get_types(self):
00057     """
00058     internal API method
00059     """
00060     return self._slot_types
00061 
00062   def serialize(self, buff):
00063     """
00064     serialize message into buffer
00065     :param buff: buffer, ``StringIO``
00066     """
00067     try:
00068       _x = self.Name
00069       length = len(_x)
00070       if python3 or type(_x) == unicode:
00071         _x = _x.encode('utf-8')
00072         length = len(_x)
00073       buff.write(struct.pack('<I%ss'%length, length, _x))
00074       _x = self
00075       buff.write(_struct_6d.pack(_x.force.x, _x.force.y, _x.force.z, _x.torque.x, _x.torque.y, _x.torque.z))
00076     except struct.error as se: self._check_types(se)
00077     except TypeError as te: self._check_types(te)
00078 
00079   def deserialize(self, str):
00080     """
00081     unpack serialized message in str into this message instance
00082     :param str: byte array of serialized message, ``str``
00083     """
00084     try:
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       start = end
00091       end += 4
00092       (length,) = _struct_I.unpack(str[start:end])
00093       start = end
00094       end += length
00095       if python3:
00096         self.Name = str[start:end].decode('utf-8')
00097       else:
00098         self.Name = str[start:end]
00099       _x = self
00100       start = end
00101       end += 48
00102       (_x.force.x, _x.force.y, _x.force.z, _x.torque.x, _x.torque.y, _x.torque.z,) = _struct_6d.unpack(str[start:end])
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 
00108   def serialize_numpy(self, buff, numpy):
00109     """
00110     serialize message with numpy array types into buffer
00111     :param buff: buffer, ``StringIO``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       _x = self.Name
00116       length = len(_x)
00117       if python3 or type(_x) == unicode:
00118         _x = _x.encode('utf-8')
00119         length = len(_x)
00120       buff.write(struct.pack('<I%ss'%length, length, _x))
00121       _x = self
00122       buff.write(_struct_6d.pack(_x.force.x, _x.force.y, _x.force.z, _x.torque.x, _x.torque.y, _x.torque.z))
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       if self.force is None:
00134         self.force = geometry_msgs.msg.Vector3()
00135       if self.torque is None:
00136         self.torque = geometry_msgs.msg.Vector3()
00137       end = 0
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       start = end
00142       end += length
00143       if python3:
00144         self.Name = str[start:end].decode('utf-8')
00145       else:
00146         self.Name = str[start:end]
00147       _x = self
00148       start = end
00149       end += 48
00150       (_x.force.x, _x.force.y, _x.force.z, _x.torque.x, _x.torque.y, _x.torque.z,) = _struct_6d.unpack(str[start:end])
00151       return self
00152     except struct.error as e:
00153       raise genpy.DeserializationError(e) #most likely buffer underfill
00154 
00155 _struct_I = genpy.struct_I
00156 _struct_6d = struct.Struct("<6d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


hrpsys_gazebo_msgs
Author(s): Yohei Kakiuchi
autogenerated on Tue Jul 23 2013 11:48:59