$search
00001 """autogenerated by genmsg_py from CollisionObjectOperation.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class CollisionObjectOperation(roslib.message.Message): 00007 _md5sum = "66a2b3b971d193145f8da8c3e401a474" 00008 _type = "arm_navigation_msgs/CollisionObjectOperation" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """#Puts the object into the environment 00011 #or updates the object if already added 00012 byte ADD=0 00013 00014 #Removes the object from the environment entirely 00015 byte REMOVE=1 00016 00017 #Only valid within the context of a CollisionAttachedObject message 00018 #Will be ignored if sent with an CollisionObject message 00019 #Takes an attached object, detaches from the attached link 00020 #But adds back in as regular object 00021 byte DETACH_AND_ADD_AS_OBJECT=2 00022 00023 #Only valid within the context of a CollisionAttachedObject message 00024 #Will be ignored if sent with an CollisionObject message 00025 #Takes current object in the environment and removes it as 00026 #a regular object 00027 byte ATTACH_AND_REMOVE_AS_OBJECT=3 00028 00029 # Byte code for operation 00030 byte operation 00031 00032 """ 00033 # Pseudo-constants 00034 ADD = 0 00035 REMOVE = 1 00036 DETACH_AND_ADD_AS_OBJECT = 2 00037 ATTACH_AND_REMOVE_AS_OBJECT = 3 00038 00039 __slots__ = ['operation'] 00040 _slot_types = ['byte'] 00041 00042 def __init__(self, *args, **kwds): 00043 """ 00044 Constructor. Any message fields that are implicitly/explicitly 00045 set to None will be assigned a default value. The recommend 00046 use is keyword arguments as this is more robust to future message 00047 changes. You cannot mix in-order arguments and keyword arguments. 00048 00049 The available fields are: 00050 operation 00051 00052 @param args: complete set of field values, in .msg order 00053 @param kwds: use keyword arguments corresponding to message field names 00054 to set specific fields. 00055 """ 00056 if args or kwds: 00057 super(CollisionObjectOperation, self).__init__(*args, **kwds) 00058 #message fields cannot be None, assign default values for those that are 00059 if self.operation is None: 00060 self.operation = 0 00061 else: 00062 self.operation = 0 00063 00064 def _get_types(self): 00065 """ 00066 internal API method 00067 """ 00068 return self._slot_types 00069 00070 def serialize(self, buff): 00071 """ 00072 serialize message into buffer 00073 @param buff: buffer 00074 @type buff: StringIO 00075 """ 00076 try: 00077 buff.write(_struct_b.pack(self.operation)) 00078 except struct.error as se: self._check_types(se) 00079 except TypeError as te: self._check_types(te) 00080 00081 def deserialize(self, str): 00082 """ 00083 unpack serialized message in str into this message instance 00084 @param str: byte array of serialized message 00085 @type str: str 00086 """ 00087 try: 00088 end = 0 00089 start = end 00090 end += 1 00091 (self.operation,) = _struct_b.unpack(str[start:end]) 00092 return self 00093 except struct.error as e: 00094 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00095 00096 00097 def serialize_numpy(self, buff, numpy): 00098 """ 00099 serialize message with numpy array types into buffer 00100 @param buff: buffer 00101 @type buff: StringIO 00102 @param numpy: numpy python module 00103 @type numpy module 00104 """ 00105 try: 00106 buff.write(_struct_b.pack(self.operation)) 00107 except struct.error as se: self._check_types(se) 00108 except TypeError as te: self._check_types(te) 00109 00110 def deserialize_numpy(self, str, numpy): 00111 """ 00112 unpack serialized message in str into this message instance using numpy for array types 00113 @param str: byte array of serialized message 00114 @type str: str 00115 @param numpy: numpy python module 00116 @type numpy: module 00117 """ 00118 try: 00119 end = 0 00120 start = end 00121 end += 1 00122 (self.operation,) = _struct_b.unpack(str[start:end]) 00123 return self 00124 except struct.error as e: 00125 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00126 00127 _struct_I = roslib.message.struct_I 00128 _struct_b = struct.Struct("<b")