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


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