_system_error.py
Go to the documentation of this file.
00001 """autogenerated by genpy from vision_msgs/system_error.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 system_error(genpy.Message):
00009   _md5sum = "a26e239d3a42fd6822d79621c90c2d42"
00010   _type = "vision_msgs/system_error"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint64 MANIPULATION_POSE_UNREACHABLE = 64
00013 uint64 GRASP_FAILED = 128  # Grasp into the void
00014 uint64 OBJECT_NOT_FOUND = 256
00015 uint64 VISION_PRIMITIVE_FAILED = 512
00016 uint64 CONTRADICTING_TACTILE_FEEDBACK = 1024  # Collide without expecting it
00017 uint64 CONTRADICTING_VISION_RESULTS = 2048
00018 uint64 GRASP_FAILED_AND_CRASHED = 4096  # Throwing something out of the way
00019 uint64 JLO_ERROR = 8192  # Could not get position
00020 uint64 VECTOR_FIELD_CANT_REACH = 16384  # The arm got stuck along the way, did not reach the final grasping pose
00021 
00022 uint64  error_id                # One of the error constants defined above
00023 string  node_name               # The node causing this error
00024 string  error_description       # Further information about the error
00025 
00026 """
00027   # Pseudo-constants
00028   MANIPULATION_POSE_UNREACHABLE = 64
00029   GRASP_FAILED = 128
00030   OBJECT_NOT_FOUND = 256
00031   VISION_PRIMITIVE_FAILED = 512
00032   CONTRADICTING_TACTILE_FEEDBACK = 1024
00033   CONTRADICTING_VISION_RESULTS = 2048
00034   GRASP_FAILED_AND_CRASHED = 4096
00035   JLO_ERROR = 8192
00036   VECTOR_FIELD_CANT_REACH = 16384
00037 
00038   __slots__ = ['error_id','node_name','error_description']
00039   _slot_types = ['uint64','string','string']
00040 
00041   def __init__(self, *args, **kwds):
00042     """
00043     Constructor. Any message fields that are implicitly/explicitly
00044     set to None will be assigned a default value. The recommend
00045     use is keyword arguments as this is more robust to future message
00046     changes.  You cannot mix in-order arguments and keyword arguments.
00047 
00048     The available fields are:
00049        error_id,node_name,error_description
00050 
00051     :param args: complete set of field values, in .msg order
00052     :param kwds: use keyword arguments corresponding to message field names
00053     to set specific fields.
00054     """
00055     if args or kwds:
00056       super(system_error, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.error_id is None:
00059         self.error_id = 0
00060       if self.node_name is None:
00061         self.node_name = ''
00062       if self.error_description is None:
00063         self.error_description = ''
00064     else:
00065       self.error_id = 0
00066       self.node_name = ''
00067       self.error_description = ''
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       buff.write(_struct_Q.pack(self.error_id))
00082       _x = self.node_name
00083       length = len(_x)
00084       if python3 or type(_x) == unicode:
00085         _x = _x.encode('utf-8')
00086         length = len(_x)
00087       buff.write(struct.pack('<I%ss'%length, length, _x))
00088       _x = self.error_description
00089       length = len(_x)
00090       if python3 or type(_x) == unicode:
00091         _x = _x.encode('utf-8')
00092         length = len(_x)
00093       buff.write(struct.pack('<I%ss'%length, length, _x))
00094     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00095     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00096 
00097   def deserialize(self, str):
00098     """
00099     unpack serialized message in str into this message instance
00100     :param str: byte array of serialized message, ``str``
00101     """
00102     try:
00103       end = 0
00104       start = end
00105       end += 8
00106       (self.error_id,) = _struct_Q.unpack(str[start:end])
00107       start = end
00108       end += 4
00109       (length,) = _struct_I.unpack(str[start:end])
00110       start = end
00111       end += length
00112       if python3:
00113         self.node_name = str[start:end].decode('utf-8')
00114       else:
00115         self.node_name = str[start:end]
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       start = end
00120       end += length
00121       if python3:
00122         self.error_description = str[start:end].decode('utf-8')
00123       else:
00124         self.error_description = str[start:end]
00125       return self
00126     except struct.error as e:
00127       raise genpy.DeserializationError(e) #most likely buffer underfill
00128 
00129 
00130   def serialize_numpy(self, buff, numpy):
00131     """
00132     serialize message with numpy array types into buffer
00133     :param buff: buffer, ``StringIO``
00134     :param numpy: numpy python module
00135     """
00136     try:
00137       buff.write(_struct_Q.pack(self.error_id))
00138       _x = self.node_name
00139       length = len(_x)
00140       if python3 or type(_x) == unicode:
00141         _x = _x.encode('utf-8')
00142         length = len(_x)
00143       buff.write(struct.pack('<I%ss'%length, length, _x))
00144       _x = self.error_description
00145       length = len(_x)
00146       if python3 or type(_x) == unicode:
00147         _x = _x.encode('utf-8')
00148         length = len(_x)
00149       buff.write(struct.pack('<I%ss'%length, length, _x))
00150     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00151     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00152 
00153   def deserialize_numpy(self, str, numpy):
00154     """
00155     unpack serialized message in str into this message instance using numpy for array types
00156     :param str: byte array of serialized message, ``str``
00157     :param numpy: numpy python module
00158     """
00159     try:
00160       end = 0
00161       start = end
00162       end += 8
00163       (self.error_id,) = _struct_Q.unpack(str[start:end])
00164       start = end
00165       end += 4
00166       (length,) = _struct_I.unpack(str[start:end])
00167       start = end
00168       end += length
00169       if python3:
00170         self.node_name = str[start:end].decode('utf-8')
00171       else:
00172         self.node_name = str[start:end]
00173       start = end
00174       end += 4
00175       (length,) = _struct_I.unpack(str[start:end])
00176       start = end
00177       end += length
00178       if python3:
00179         self.error_description = str[start:end].decode('utf-8')
00180       else:
00181         self.error_description = str[start:end]
00182       return self
00183     except struct.error as e:
00184       raise genpy.DeserializationError(e) #most likely buffer underfill
00185 
00186 _struct_I = genpy.struct_I
00187 _struct_Q = struct.Struct("<Q")


vision_msgs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:47:37