00001 """autogenerated by genpy from srs_assisted_arm_navigation_msgs/AssistedArmNavigationState.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 AssistedArmNavigationState(genpy.Message):
00009 _md5sum = "4535a19480c891b40f666fd0e350e902"
00010 _type = "srs_assisted_arm_navigation_msgs/AssistedArmNavigationState"
00011 _has_header = False
00012 _full_text = """###
00013 # This message is used to publish internal state of assisted arm navigation node
00014 ###
00015
00016 # Internal state (planned, executing etc.) - TBD
00017
00018 bool planning_started
00019 bool position_reachable # IK can be found
00020 bool position_in_collision
00021
00022 bool joints_out_of_limits
00023
00024 string error_description # position not reachable, collision etc.
00025
00026 # Spacenav variables
00027 bool position_locked
00028 bool orientation_locked
00029
00030 bool aco_state # true - enable, false - disabled
00031
00032 string[] attached_objects
00033
00034 """
00035 __slots__ = ['planning_started','position_reachable','position_in_collision','joints_out_of_limits','error_description','position_locked','orientation_locked','aco_state','attached_objects']
00036 _slot_types = ['bool','bool','bool','bool','string','bool','bool','bool','string[]']
00037
00038 def __init__(self, *args, **kwds):
00039 """
00040 Constructor. Any message fields that are implicitly/explicitly
00041 set to None will be assigned a default value. The recommend
00042 use is keyword arguments as this is more robust to future message
00043 changes. You cannot mix in-order arguments and keyword arguments.
00044
00045 The available fields are:
00046 planning_started,position_reachable,position_in_collision,joints_out_of_limits,error_description,position_locked,orientation_locked,aco_state,attached_objects
00047
00048 :param args: complete set of field values, in .msg order
00049 :param kwds: use keyword arguments corresponding to message field names
00050 to set specific fields.
00051 """
00052 if args or kwds:
00053 super(AssistedArmNavigationState, self).__init__(*args, **kwds)
00054
00055 if self.planning_started is None:
00056 self.planning_started = False
00057 if self.position_reachable is None:
00058 self.position_reachable = False
00059 if self.position_in_collision is None:
00060 self.position_in_collision = False
00061 if self.joints_out_of_limits is None:
00062 self.joints_out_of_limits = False
00063 if self.error_description is None:
00064 self.error_description = ''
00065 if self.position_locked is None:
00066 self.position_locked = False
00067 if self.orientation_locked is None:
00068 self.orientation_locked = False
00069 if self.aco_state is None:
00070 self.aco_state = False
00071 if self.attached_objects is None:
00072 self.attached_objects = []
00073 else:
00074 self.planning_started = False
00075 self.position_reachable = False
00076 self.position_in_collision = False
00077 self.joints_out_of_limits = False
00078 self.error_description = ''
00079 self.position_locked = False
00080 self.orientation_locked = False
00081 self.aco_state = False
00082 self.attached_objects = []
00083
00084 def _get_types(self):
00085 """
00086 internal API method
00087 """
00088 return self._slot_types
00089
00090 def serialize(self, buff):
00091 """
00092 serialize message into buffer
00093 :param buff: buffer, ``StringIO``
00094 """
00095 try:
00096 _x = self
00097 buff.write(_struct_4B.pack(_x.planning_started, _x.position_reachable, _x.position_in_collision, _x.joints_out_of_limits))
00098 _x = self.error_description
00099 length = len(_x)
00100 if python3 or type(_x) == unicode:
00101 _x = _x.encode('utf-8')
00102 length = len(_x)
00103 buff.write(struct.pack('<I%ss'%length, length, _x))
00104 _x = self
00105 buff.write(_struct_3B.pack(_x.position_locked, _x.orientation_locked, _x.aco_state))
00106 length = len(self.attached_objects)
00107 buff.write(_struct_I.pack(length))
00108 for val1 in self.attached_objects:
00109 length = len(val1)
00110 if python3 or type(val1) == unicode:
00111 val1 = val1.encode('utf-8')
00112 length = len(val1)
00113 buff.write(struct.pack('<I%ss'%length, length, val1))
00114 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00115 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00116
00117 def deserialize(self, str):
00118 """
00119 unpack serialized message in str into this message instance
00120 :param str: byte array of serialized message, ``str``
00121 """
00122 try:
00123 end = 0
00124 _x = self
00125 start = end
00126 end += 4
00127 (_x.planning_started, _x.position_reachable, _x.position_in_collision, _x.joints_out_of_limits,) = _struct_4B.unpack(str[start:end])
00128 self.planning_started = bool(self.planning_started)
00129 self.position_reachable = bool(self.position_reachable)
00130 self.position_in_collision = bool(self.position_in_collision)
00131 self.joints_out_of_limits = bool(self.joints_out_of_limits)
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.error_description = str[start:end].decode('utf-8')
00139 else:
00140 self.error_description = str[start:end]
00141 _x = self
00142 start = end
00143 end += 3
00144 (_x.position_locked, _x.orientation_locked, _x.aco_state,) = _struct_3B.unpack(str[start:end])
00145 self.position_locked = bool(self.position_locked)
00146 self.orientation_locked = bool(self.orientation_locked)
00147 self.aco_state = bool(self.aco_state)
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 self.attached_objects = []
00152 for i in range(0, length):
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 start = end
00157 end += length
00158 if python3:
00159 val1 = str[start:end].decode('utf-8')
00160 else:
00161 val1 = str[start:end]
00162 self.attached_objects.append(val1)
00163 return self
00164 except struct.error as e:
00165 raise genpy.DeserializationError(e)
00166
00167
00168 def serialize_numpy(self, buff, numpy):
00169 """
00170 serialize message with numpy array types into buffer
00171 :param buff: buffer, ``StringIO``
00172 :param numpy: numpy python module
00173 """
00174 try:
00175 _x = self
00176 buff.write(_struct_4B.pack(_x.planning_started, _x.position_reachable, _x.position_in_collision, _x.joints_out_of_limits))
00177 _x = self.error_description
00178 length = len(_x)
00179 if python3 or type(_x) == unicode:
00180 _x = _x.encode('utf-8')
00181 length = len(_x)
00182 buff.write(struct.pack('<I%ss'%length, length, _x))
00183 _x = self
00184 buff.write(_struct_3B.pack(_x.position_locked, _x.orientation_locked, _x.aco_state))
00185 length = len(self.attached_objects)
00186 buff.write(_struct_I.pack(length))
00187 for val1 in self.attached_objects:
00188 length = len(val1)
00189 if python3 or type(val1) == unicode:
00190 val1 = val1.encode('utf-8')
00191 length = len(val1)
00192 buff.write(struct.pack('<I%ss'%length, length, val1))
00193 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00194 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00195
00196 def deserialize_numpy(self, str, numpy):
00197 """
00198 unpack serialized message in str into this message instance using numpy for array types
00199 :param str: byte array of serialized message, ``str``
00200 :param numpy: numpy python module
00201 """
00202 try:
00203 end = 0
00204 _x = self
00205 start = end
00206 end += 4
00207 (_x.planning_started, _x.position_reachable, _x.position_in_collision, _x.joints_out_of_limits,) = _struct_4B.unpack(str[start:end])
00208 self.planning_started = bool(self.planning_started)
00209 self.position_reachable = bool(self.position_reachable)
00210 self.position_in_collision = bool(self.position_in_collision)
00211 self.joints_out_of_limits = bool(self.joints_out_of_limits)
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 start = end
00216 end += length
00217 if python3:
00218 self.error_description = str[start:end].decode('utf-8')
00219 else:
00220 self.error_description = str[start:end]
00221 _x = self
00222 start = end
00223 end += 3
00224 (_x.position_locked, _x.orientation_locked, _x.aco_state,) = _struct_3B.unpack(str[start:end])
00225 self.position_locked = bool(self.position_locked)
00226 self.orientation_locked = bool(self.orientation_locked)
00227 self.aco_state = bool(self.aco_state)
00228 start = end
00229 end += 4
00230 (length,) = _struct_I.unpack(str[start:end])
00231 self.attached_objects = []
00232 for i in range(0, length):
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 start = end
00237 end += length
00238 if python3:
00239 val1 = str[start:end].decode('utf-8')
00240 else:
00241 val1 = str[start:end]
00242 self.attached_objects.append(val1)
00243 return self
00244 except struct.error as e:
00245 raise genpy.DeserializationError(e)
00246
00247 _struct_I = genpy.struct_I
00248 _struct_3B = struct.Struct("<3B")
00249 _struct_4B = struct.Struct("<4B")