_PickupIMObjectGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_object_manipulation_msgs/PickupIMObjectGoal.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 PickupIMObjectGoal(genpy.Message):
00009   _md5sum = "b29a6fd5c44bf0fff02b43d05cc1ffae"
00010   _type = "pr2_object_manipulation_msgs/PickupIMObjectGoal"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # objects are numbered in the same order as the GraspableObjectsList (0 start)
00014 int32 object_id
00015 
00016 # 0=right, 1=left arm
00017 int32 arm_selection
00018 
00019 
00020 """
00021   __slots__ = ['object_id','arm_selection']
00022   _slot_types = ['int32','int32']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        object_id,arm_selection
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(PickupIMObjectGoal, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.object_id is None:
00042         self.object_id = 0
00043       if self.arm_selection is None:
00044         self.arm_selection = 0
00045     else:
00046       self.object_id = 0
00047       self.arm_selection = 0
00048 
00049   def _get_types(self):
00050     """
00051     internal API method
00052     """
00053     return self._slot_types
00054 
00055   def serialize(self, buff):
00056     """
00057     serialize message into buffer
00058     :param buff: buffer, ``StringIO``
00059     """
00060     try:
00061       _x = self
00062       buff.write(_struct_2i.pack(_x.object_id, _x.arm_selection))
00063     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00064     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00065 
00066   def deserialize(self, str):
00067     """
00068     unpack serialized message in str into this message instance
00069     :param str: byte array of serialized message, ``str``
00070     """
00071     try:
00072       end = 0
00073       _x = self
00074       start = end
00075       end += 8
00076       (_x.object_id, _x.arm_selection,) = _struct_2i.unpack(str[start:end])
00077       return self
00078     except struct.error as e:
00079       raise genpy.DeserializationError(e) #most likely buffer underfill
00080 
00081 
00082   def serialize_numpy(self, buff, numpy):
00083     """
00084     serialize message with numpy array types into buffer
00085     :param buff: buffer, ``StringIO``
00086     :param numpy: numpy python module
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_2i.pack(_x.object_id, _x.arm_selection))
00091     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00092     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00093 
00094   def deserialize_numpy(self, str, numpy):
00095     """
00096     unpack serialized message in str into this message instance using numpy for array types
00097     :param str: byte array of serialized message, ``str``
00098     :param numpy: numpy python module
00099     """
00100     try:
00101       end = 0
00102       _x = self
00103       start = end
00104       end += 8
00105       (_x.object_id, _x.arm_selection,) = _struct_2i.unpack(str[start:end])
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 _struct_I = genpy.struct_I
00111 _struct_2i = struct.Struct("<2i")


pr2_object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Mon Oct 6 2014 11:55:20