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