_ObjectInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/ObjectInfo.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 ObjectInfo(genpy.Message):
00009   _md5sum = "c766c32f43d7aa47a71b93fc7d2e259b"
00010   _type = "hrl_haptic_manipulation_in_clutter_msgs/ObjectInfo"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 float64 obj_id
00014 float64 contact_x
00015 float64 contact_y
00016 float64 contact_z
00017 
00018 
00019 
00020 
00021 """
00022   __slots__ = ['obj_id','contact_x','contact_y','contact_z']
00023   _slot_types = ['float64','float64','float64','float64']
00024 
00025   def __init__(self, *args, **kwds):
00026     """
00027     Constructor. Any message fields that are implicitly/explicitly
00028     set to None will be assigned a default value. The recommend
00029     use is keyword arguments as this is more robust to future message
00030     changes.  You cannot mix in-order arguments and keyword arguments.
00031 
00032     The available fields are:
00033        obj_id,contact_x,contact_y,contact_z
00034 
00035     :param args: complete set of field values, in .msg order
00036     :param kwds: use keyword arguments corresponding to message field names
00037     to set specific fields.
00038     """
00039     if args or kwds:
00040       super(ObjectInfo, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.obj_id is None:
00043         self.obj_id = 0.
00044       if self.contact_x is None:
00045         self.contact_x = 0.
00046       if self.contact_y is None:
00047         self.contact_y = 0.
00048       if self.contact_z is None:
00049         self.contact_z = 0.
00050     else:
00051       self.obj_id = 0.
00052       self.contact_x = 0.
00053       self.contact_y = 0.
00054       self.contact_z = 0.
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
00069       buff.write(_struct_4d.pack(_x.obj_id, _x.contact_x, _x.contact_y, _x.contact_z))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       _x = self
00081       start = end
00082       end += 32
00083       (_x.obj_id, _x.contact_x, _x.contact_y, _x.contact_z,) = _struct_4d.unpack(str[start:end])
00084       return self
00085     except struct.error as e:
00086       raise genpy.DeserializationError(e) #most likely buffer underfill
00087 
00088 
00089   def serialize_numpy(self, buff, numpy):
00090     """
00091     serialize message with numpy array types into buffer
00092     :param buff: buffer, ``StringIO``
00093     :param numpy: numpy python module
00094     """
00095     try:
00096       _x = self
00097       buff.write(_struct_4d.pack(_x.obj_id, _x.contact_x, _x.contact_y, _x.contact_z))
00098     except struct.error as se: self._check_types(se)
00099     except TypeError as te: self._check_types(te)
00100 
00101   def deserialize_numpy(self, str, numpy):
00102     """
00103     unpack serialized message in str into this message instance using numpy for array types
00104     :param str: byte array of serialized message, ``str``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       end = 0
00109       _x = self
00110       start = end
00111       end += 32
00112       (_x.obj_id, _x.contact_x, _x.contact_y, _x.contact_z,) = _struct_4d.unpack(str[start:end])
00113       return self
00114     except struct.error as e:
00115       raise genpy.DeserializationError(e) #most likely buffer underfill
00116 
00117 _struct_I = genpy.struct_I
00118 _struct_4d = struct.Struct("<4d")


hrl_haptic_manipulation_in_clutter_msgs
Author(s): Advait Jain, Marc Killpack, Jeff Hawke. Advisor: Prof. Charlie Kemp. Healthcare Robotics Lab, Georgia Tech.
autogenerated on Wed Nov 27 2013 11:33:37