00001 """autogenerated by genmsg_py from ArmHandResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import vision_msgs.msg
00006
00007 class ArmHandResult(roslib.message.Message):
00008 _md5sum = "96fe826375e10406e4d32548d703c09c"
00009 _type = "cogman_msgs/ArmHandResult"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012
00013 #result
00014 float32 distance_to_goal
00015 string situation #Allowed: grasped slipped released unreachable ik_deadlock need_to_move_base
00016 vision_msgs/system_error error #Description of error
00017 uint64[] better_base_ids #List of lo_id's where we could grasp better
00018
00019 ================================================================================
00020 MSG: vision_msgs/system_error
00021 uint64 MANIPULATION_POSE_UNREACHABLE = 64
00022 uint64 GRASP_FAILED = 128 # Grasp into the void
00023 uint64 OBJECT_NOT_FOUND = 256
00024 uint64 VISION_PRIMITIVE_FAILED = 512
00025 uint64 CONTRADICTING_TACTILE_FEEDBACK = 1024 # Collide without expecting it
00026 uint64 CONTRADICTING_VISION_RESULTS = 2048
00027 uint64 GRASP_FAILED_AND_CRASHED = 4096 # Throwing something out of the way
00028 uint64 JLO_ERROR = 8192 # Could not get position
00029 uint64 VECTOR_FIELD_CANT_REACH = 16384 # The arm got stuck along the way, did not reach the final grasping pose
00030
00031 uint64 error_id # One of the error constants defined above
00032 string node_name # The node causing this error
00033 string error_description # Further information about the error
00034
00035 """
00036 __slots__ = ['distance_to_goal','situation','error','better_base_ids']
00037 _slot_types = ['float32','string','vision_msgs/system_error','uint64[]']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 distance_to_goal,situation,error,better_base_ids
00048
00049 @param args: complete set of field values, in .msg order
00050 @param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(ArmHandResult, self).__init__(*args, **kwds)
00055
00056 if self.distance_to_goal is None:
00057 self.distance_to_goal = 0.
00058 if self.situation is None:
00059 self.situation = ''
00060 if self.error is None:
00061 self.error = vision_msgs.msg.system_error()
00062 if self.better_base_ids is None:
00063 self.better_base_ids = []
00064 else:
00065 self.distance_to_goal = 0.
00066 self.situation = ''
00067 self.error = vision_msgs.msg.system_error()
00068 self.better_base_ids = []
00069
00070 def _get_types(self):
00071 """
00072 internal API method
00073 """
00074 return self._slot_types
00075
00076 def serialize(self, buff):
00077 """
00078 serialize message into buffer
00079 @param buff: buffer
00080 @type buff: StringIO
00081 """
00082 try:
00083 buff.write(_struct_f.pack(self.distance_to_goal))
00084 _x = self.situation
00085 length = len(_x)
00086 buff.write(struct.pack('<I%ss'%length, length, _x))
00087 buff.write(_struct_Q.pack(self.error.error_id))
00088 _x = self.error.node_name
00089 length = len(_x)
00090 buff.write(struct.pack('<I%ss'%length, length, _x))
00091 _x = self.error.error_description
00092 length = len(_x)
00093 buff.write(struct.pack('<I%ss'%length, length, _x))
00094 length = len(self.better_base_ids)
00095 buff.write(_struct_I.pack(length))
00096 pattern = '<%sQ'%length
00097 buff.write(struct.pack(pattern, *self.better_base_ids))
00098 except struct.error, se: self._check_types(se)
00099 except TypeError, te: self._check_types(te)
00100
00101 def deserialize(self, str):
00102 """
00103 unpack serialized message in str into this message instance
00104 @param str: byte array of serialized message
00105 @type str: str
00106 """
00107 try:
00108 if self.error is None:
00109 self.error = vision_msgs.msg.system_error()
00110 end = 0
00111 start = end
00112 end += 4
00113 (self.distance_to_goal,) = _struct_f.unpack(str[start:end])
00114 start = end
00115 end += 4
00116 (length,) = _struct_I.unpack(str[start:end])
00117 start = end
00118 end += length
00119 self.situation = str[start:end]
00120 start = end
00121 end += 8
00122 (self.error.error_id,) = _struct_Q.unpack(str[start:end])
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.error.node_name = str[start:end]
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 self.error.error_description = str[start:end]
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 pattern = '<%sQ'%length
00139 start = end
00140 end += struct.calcsize(pattern)
00141 self.better_base_ids = struct.unpack(pattern, str[start:end])
00142 return self
00143 except struct.error, e:
00144 raise roslib.message.DeserializationError(e)
00145
00146
00147 def serialize_numpy(self, buff, numpy):
00148 """
00149 serialize message with numpy array types into buffer
00150 @param buff: buffer
00151 @type buff: StringIO
00152 @param numpy: numpy python module
00153 @type numpy module
00154 """
00155 try:
00156 buff.write(_struct_f.pack(self.distance_to_goal))
00157 _x = self.situation
00158 length = len(_x)
00159 buff.write(struct.pack('<I%ss'%length, length, _x))
00160 buff.write(_struct_Q.pack(self.error.error_id))
00161 _x = self.error.node_name
00162 length = len(_x)
00163 buff.write(struct.pack('<I%ss'%length, length, _x))
00164 _x = self.error.error_description
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 length = len(self.better_base_ids)
00168 buff.write(_struct_I.pack(length))
00169 pattern = '<%sQ'%length
00170 buff.write(self.better_base_ids.tostring())
00171 except struct.error, se: self._check_types(se)
00172 except TypeError, te: self._check_types(te)
00173
00174 def deserialize_numpy(self, str, numpy):
00175 """
00176 unpack serialized message in str into this message instance using numpy for array types
00177 @param str: byte array of serialized message
00178 @type str: str
00179 @param numpy: numpy python module
00180 @type numpy: module
00181 """
00182 try:
00183 if self.error is None:
00184 self.error = vision_msgs.msg.system_error()
00185 end = 0
00186 start = end
00187 end += 4
00188 (self.distance_to_goal,) = _struct_f.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 self.situation = str[start:end]
00195 start = end
00196 end += 8
00197 (self.error.error_id,) = _struct_Q.unpack(str[start:end])
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 start = end
00202 end += length
00203 self.error.node_name = str[start:end]
00204 start = end
00205 end += 4
00206 (length,) = _struct_I.unpack(str[start:end])
00207 start = end
00208 end += length
00209 self.error.error_description = str[start:end]
00210 start = end
00211 end += 4
00212 (length,) = _struct_I.unpack(str[start:end])
00213 pattern = '<%sQ'%length
00214 start = end
00215 end += struct.calcsize(pattern)
00216 self.better_base_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
00217 return self
00218 except struct.error, e:
00219 raise roslib.message.DeserializationError(e)
00220
00221 _struct_I = roslib.message.struct_I
00222 _struct_Q = struct.Struct("<Q")
00223 _struct_f = struct.Struct("<f")