_PickUpObject.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_pick_and_place_service/PickUpObjectRequest.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 PickUpObjectRequest(genpy.Message):
00009   _md5sum = "aa29909bdd882fab23771f16c6d810b0"
00010   _type = "pr2_pick_and_place_service/PickUpObjectRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string arm
00013 uint32 objectid
00014 
00015 """
00016   __slots__ = ['arm','objectid']
00017   _slot_types = ['string','uint32']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        arm,objectid
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(PickUpObjectRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.arm is None:
00037         self.arm = ''
00038       if self.objectid is None:
00039         self.objectid = 0
00040     else:
00041       self.arm = ''
00042       self.objectid = 0
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       _x = self.arm
00057       length = len(_x)
00058       if python3 or type(_x) == unicode:
00059         _x = _x.encode('utf-8')
00060         length = len(_x)
00061       buff.write(struct.pack('<I%ss'%length, length, _x))
00062       buff.write(_struct_I.pack(self.objectid))
00063     except struct.error as se: self._check_types(se)
00064     except TypeError as te: self._check_types(te)
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       start = end
00074       end += 4
00075       (length,) = _struct_I.unpack(str[start:end])
00076       start = end
00077       end += length
00078       if python3:
00079         self.arm = str[start:end].decode('utf-8')
00080       else:
00081         self.arm = str[start:end]
00082       start = end
00083       end += 4
00084       (self.objectid,) = _struct_I.unpack(str[start:end])
00085       return self
00086     except struct.error as e:
00087       raise genpy.DeserializationError(e) #most likely buffer underfill
00088 
00089 
00090   def serialize_numpy(self, buff, numpy):
00091     """
00092     serialize message with numpy array types into buffer
00093     :param buff: buffer, ``StringIO``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       _x = self.arm
00098       length = len(_x)
00099       if python3 or type(_x) == unicode:
00100         _x = _x.encode('utf-8')
00101         length = len(_x)
00102       buff.write(struct.pack('<I%ss'%length, length, _x))
00103       buff.write(_struct_I.pack(self.objectid))
00104     except struct.error as se: self._check_types(se)
00105     except TypeError as te: self._check_types(te)
00106 
00107   def deserialize_numpy(self, str, numpy):
00108     """
00109     unpack serialized message in str into this message instance using numpy for array types
00110     :param str: byte array of serialized message, ``str``
00111     :param numpy: numpy python module
00112     """
00113     try:
00114       end = 0
00115       start = end
00116       end += 4
00117       (length,) = _struct_I.unpack(str[start:end])
00118       start = end
00119       end += length
00120       if python3:
00121         self.arm = str[start:end].decode('utf-8')
00122       else:
00123         self.arm = str[start:end]
00124       start = end
00125       end += 4
00126       (self.objectid,) = _struct_I.unpack(str[start:end])
00127       return self
00128     except struct.error as e:
00129       raise genpy.DeserializationError(e) #most likely buffer underfill
00130 
00131 _struct_I = genpy.struct_I
00132 """autogenerated by genpy from pr2_pick_and_place_service/PickUpObjectResponse.msg. Do not edit."""
00133 import sys
00134 python3 = True if sys.hexversion > 0x03000000 else False
00135 import genpy
00136 import struct
00137 
00138 
00139 class PickUpObjectResponse(genpy.Message):
00140   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00141   _type = "pr2_pick_and_place_service/PickUpObjectResponse"
00142   _has_header = False #flag to mark the presence of a Header object
00143   _full_text = """bool success
00144 
00145 
00146 """
00147   __slots__ = ['success']
00148   _slot_types = ['bool']
00149 
00150   def __init__(self, *args, **kwds):
00151     """
00152     Constructor. Any message fields that are implicitly/explicitly
00153     set to None will be assigned a default value. The recommend
00154     use is keyword arguments as this is more robust to future message
00155     changes.  You cannot mix in-order arguments and keyword arguments.
00156 
00157     The available fields are:
00158        success
00159 
00160     :param args: complete set of field values, in .msg order
00161     :param kwds: use keyword arguments corresponding to message field names
00162     to set specific fields.
00163     """
00164     if args or kwds:
00165       super(PickUpObjectResponse, self).__init__(*args, **kwds)
00166       #message fields cannot be None, assign default values for those that are
00167       if self.success is None:
00168         self.success = False
00169     else:
00170       self.success = False
00171 
00172   def _get_types(self):
00173     """
00174     internal API method
00175     """
00176     return self._slot_types
00177 
00178   def serialize(self, buff):
00179     """
00180     serialize message into buffer
00181     :param buff: buffer, ``StringIO``
00182     """
00183     try:
00184       buff.write(_struct_B.pack(self.success))
00185     except struct.error as se: self._check_types(se)
00186     except TypeError as te: self._check_types(te)
00187 
00188   def deserialize(self, str):
00189     """
00190     unpack serialized message in str into this message instance
00191     :param str: byte array of serialized message, ``str``
00192     """
00193     try:
00194       end = 0
00195       start = end
00196       end += 1
00197       (self.success,) = _struct_B.unpack(str[start:end])
00198       self.success = bool(self.success)
00199       return self
00200     except struct.error as e:
00201       raise genpy.DeserializationError(e) #most likely buffer underfill
00202 
00203 
00204   def serialize_numpy(self, buff, numpy):
00205     """
00206     serialize message with numpy array types into buffer
00207     :param buff: buffer, ``StringIO``
00208     :param numpy: numpy python module
00209     """
00210     try:
00211       buff.write(_struct_B.pack(self.success))
00212     except struct.error as se: self._check_types(se)
00213     except TypeError as te: self._check_types(te)
00214 
00215   def deserialize_numpy(self, str, numpy):
00216     """
00217     unpack serialized message in str into this message instance using numpy for array types
00218     :param str: byte array of serialized message, ``str``
00219     :param numpy: numpy python module
00220     """
00221     try:
00222       end = 0
00223       start = end
00224       end += 1
00225       (self.success,) = _struct_B.unpack(str[start:end])
00226       self.success = bool(self.success)
00227       return self
00228     except struct.error as e:
00229       raise genpy.DeserializationError(e) #most likely buffer underfill
00230 
00231 _struct_I = genpy.struct_I
00232 _struct_B = struct.Struct("<B")
00233 class PickUpObject(object):
00234   _type          = 'pr2_pick_and_place_service/PickUpObject'
00235   _md5sum = 'e772e240def3d01347fbe9d1270bb8be'
00236   _request_class  = PickUpObjectRequest
00237   _response_class = PickUpObjectResponse


pr2_pick_and_place_service
Author(s): Sarah Osentoski
autogenerated on Sun Jan 5 2014 11:28:36