Package create_node :: Package msg :: Module _RawTurtlebotSensorState
[frames] | no frames]

Source Code for Module create_node.msg._RawTurtlebotSensorState

  1  # This Python file uses the following encoding: utf-8 
  2  """autogenerated by genpy from create_node/RawTurtlebotSensorState.msg. Do not edit.""" 
  3  import sys 
  4  python3 = True if sys.hexversion > 0x03000000 else False 
  5  import genpy 
  6  import struct 
  7   
  8  import std_msgs.msg 
  9   
10 -class RawTurtlebotSensorState(genpy.Message):
11 _md5sum = "103d192c45e953c8bb1c3c046e89e2ff" 12 _type = "create_node/RawTurtlebotSensorState" 13 _has_header = True #flag to mark the presence of a Header object 14 _full_text = """uint8 OI_MODE_OFF = 0 15 uint8 OI_MODE_PASSIVE = 1 16 uint8 OI_MODE_SAFE = 2 17 uint8 OI_MODE_FULL = 3 18 19 uint8 REMOTE_LEFT = 129 20 uint8 REMOTE_FORWARD = 130 21 uint8 REMOTE_RIGHT = 131 22 uint8 REMOTE_SPOT = 132 23 uint8 REMOTE_MAX = 133 24 uint8 REMOTE_SMALL = 134 25 uint8 REMOTE_MEDIUM = 135 26 uint8 REMOTE_LARGE = 136 27 uint8 REMOTE_CLEAN = 136 28 uint8 REMOTE_PAUSE = 137 29 uint8 REMOTE_POWER = 138 30 uint8 REMOTE_ARC_LEFT = 139 31 uint8 REMOTE_ARC_RIGHT = 140 32 uint8 REMOTE_DRIVE_STOP = 141 33 # Scheduling remote 34 uint8 REMOTE_SEND_ALL = 142 35 uint8 REMOTE_SEEK_DOCK = 143 36 # Home base 37 uint8 REMOTE_RESERVED = 240 38 uint8 REMOTE_FORCE_FIELD = 242 39 uint8 REMOTE_GREEN_BUOY = 244 40 uint8 REMOTE_GREEN_BUOY_AND_FORCE_FIELD = 246 41 uint8 REMOTE_RED_BUOY = 248 42 uint8 REMOTE_RED_BUOY_AND_FORCE_FIELD = 250 43 uint8 REMOTE_RED_BUOY_AND_GREEN_BUOY = 252 44 uint8 REMOTE_RED_BUOY_AND_GREEN_BUOY_AND_FORCE_FIELD = 254 45 uint8 REMOTE_NONE = 255 46 47 uint8 CHARGING_NOT_CHARGING = 0 48 uint8 CHARGING_CHARGING_RECOVERY = 1 49 uint8 CHARGING_CHARGING = 2 50 uint8 CHARGING_TRICKLE_CHARGING = 3 51 uint8 CHARGING_WAITING = 4 52 uint8 CHARGING_CHARGING_ERROR = 5 53 54 Header header 55 56 uint8 bumps_wheeldrops 57 bool wall 58 bool cliff_left 59 bool cliff_front_left 60 bool cliff_front_right 61 bool cliff_right 62 bool virtual_wall 63 uint8 motor_overcurrents 64 uint8 dirt_detector_left #roomba_only 65 uint8 dirt_detector_right #roomba_only 66 uint8 remote_opcode 67 uint8 buttons 68 int16 distance # mm 69 int16 angle # degrees 70 uint8 charging_state 71 uint16 voltage # mV 72 int16 current # mA 73 int8 temperature # C 74 uint16 charge # mAh 75 uint16 capacity # mAh 76 77 uint16 wall_signal 78 uint16 cliff_left_signal 79 uint16 cliff_front_left_signal 80 uint16 cliff_front_right_signal 81 uint16 cliff_right_signal 82 uint8 user_digital_inputs 83 uint16 user_analog_input 84 uint8 charging_sources_available 85 uint8 oi_mode 86 uint8 song_number 87 bool song_playing 88 89 uint8 number_of_stream_packets 90 int16 requested_velocity # mm/s 91 int16 requested_radius # mm 92 int16 requested_right_velocity # mm/s 93 int16 requested_left_velocity # mm/s 94 95 96 ================================================================================ 97 MSG: std_msgs/Header 98 # Standard metadata for higher-level stamped data types. 99 # This is generally used to communicate timestamped data 100 # in a particular coordinate frame. 101 # 102 # sequence ID: consecutively increasing ID 103 uint32 seq 104 #Two-integer timestamp that is expressed as: 105 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs') 106 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs') 107 # time-handling sugar is provided by the client library 108 time stamp 109 #Frame this data is associated with 110 # 0: no frame 111 # 1: global frame 112 string frame_id 113 """ 114 # Pseudo-constants 115 OI_MODE_OFF = 0 116 OI_MODE_PASSIVE = 1 117 OI_MODE_SAFE = 2 118 OI_MODE_FULL = 3 119 REMOTE_LEFT = 129 120 REMOTE_FORWARD = 130 121 REMOTE_RIGHT = 131 122 REMOTE_SPOT = 132 123 REMOTE_MAX = 133 124 REMOTE_SMALL = 134 125 REMOTE_MEDIUM = 135 126 REMOTE_LARGE = 136 127 REMOTE_CLEAN = 136 128 REMOTE_PAUSE = 137 129 REMOTE_POWER = 138 130 REMOTE_ARC_LEFT = 139 131 REMOTE_ARC_RIGHT = 140 132 REMOTE_DRIVE_STOP = 141 133 REMOTE_SEND_ALL = 142 134 REMOTE_SEEK_DOCK = 143 135 REMOTE_RESERVED = 240 136 REMOTE_FORCE_FIELD = 242 137 REMOTE_GREEN_BUOY = 244 138 REMOTE_GREEN_BUOY_AND_FORCE_FIELD = 246 139 REMOTE_RED_BUOY = 248 140 REMOTE_RED_BUOY_AND_FORCE_FIELD = 250 141 REMOTE_RED_BUOY_AND_GREEN_BUOY = 252 142 REMOTE_RED_BUOY_AND_GREEN_BUOY_AND_FORCE_FIELD = 254 143 REMOTE_NONE = 255 144 CHARGING_NOT_CHARGING = 0 145 CHARGING_CHARGING_RECOVERY = 1 146 CHARGING_CHARGING = 2 147 CHARGING_TRICKLE_CHARGING = 3 148 CHARGING_WAITING = 4 149 CHARGING_CHARGING_ERROR = 5 150 151 __slots__ = ['header','bumps_wheeldrops','wall','cliff_left','cliff_front_left','cliff_front_right','cliff_right','virtual_wall','motor_overcurrents','dirt_detector_left','dirt_detector_right','remote_opcode','buttons','distance','angle','charging_state','voltage','current','temperature','charge','capacity','wall_signal','cliff_left_signal','cliff_front_left_signal','cliff_front_right_signal','cliff_right_signal','user_digital_inputs','user_analog_input','charging_sources_available','oi_mode','song_number','song_playing','number_of_stream_packets','requested_velocity','requested_radius','requested_right_velocity','requested_left_velocity'] 152 _slot_types = ['std_msgs/Header','uint8','bool','bool','bool','bool','bool','bool','uint8','uint8','uint8','uint8','uint8','int16','int16','uint8','uint16','int16','int8','uint16','uint16','uint16','uint16','uint16','uint16','uint16','uint8','uint16','uint8','uint8','uint8','bool','uint8','int16','int16','int16','int16'] 153
154 - def __init__(self, *args, **kwds):
155 """ 156 Constructor. Any message fields that are implicitly/explicitly 157 set to None will be assigned a default value. The recommend 158 use is keyword arguments as this is more robust to future message 159 changes. You cannot mix in-order arguments and keyword arguments. 160 161 The available fields are: 162 header,bumps_wheeldrops,wall,cliff_left,cliff_front_left,cliff_front_right,cliff_right,virtual_wall,motor_overcurrents,dirt_detector_left,dirt_detector_right,remote_opcode,buttons,distance,angle,charging_state,voltage,current,temperature,charge,capacity,wall_signal,cliff_left_signal,cliff_front_left_signal,cliff_front_right_signal,cliff_right_signal,user_digital_inputs,user_analog_input,charging_sources_available,oi_mode,song_number,song_playing,number_of_stream_packets,requested_velocity,requested_radius,requested_right_velocity,requested_left_velocity 163 164 :param args: complete set of field values, in .msg order 165 :param kwds: use keyword arguments corresponding to message field names 166 to set specific fields. 167 """ 168 if args or kwds: 169 super(RawTurtlebotSensorState, self).__init__(*args, **kwds) 170 #message fields cannot be None, assign default values for those that are 171 if self.header is None: 172 self.header = std_msgs.msg.Header() 173 if self.bumps_wheeldrops is None: 174 self.bumps_wheeldrops = 0 175 if self.wall is None: 176 self.wall = False 177 if self.cliff_left is None: 178 self.cliff_left = False 179 if self.cliff_front_left is None: 180 self.cliff_front_left = False 181 if self.cliff_front_right is None: 182 self.cliff_front_right = False 183 if self.cliff_right is None: 184 self.cliff_right = False 185 if self.virtual_wall is None: 186 self.virtual_wall = False 187 if self.motor_overcurrents is None: 188 self.motor_overcurrents = 0 189 if self.dirt_detector_left is None: 190 self.dirt_detector_left = 0 191 if self.dirt_detector_right is None: 192 self.dirt_detector_right = 0 193 if self.remote_opcode is None: 194 self.remote_opcode = 0 195 if self.buttons is None: 196 self.buttons = 0 197 if self.distance is None: 198 self.distance = 0 199 if self.angle is None: 200 self.angle = 0 201 if self.charging_state is None: 202 self.charging_state = 0 203 if self.voltage is None: 204 self.voltage = 0 205 if self.current is None: 206 self.current = 0 207 if self.temperature is None: 208 self.temperature = 0 209 if self.charge is None: 210 self.charge = 0 211 if self.capacity is None: 212 self.capacity = 0 213 if self.wall_signal is None: 214 self.wall_signal = 0 215 if self.cliff_left_signal is None: 216 self.cliff_left_signal = 0 217 if self.cliff_front_left_signal is None: 218 self.cliff_front_left_signal = 0 219 if self.cliff_front_right_signal is None: 220 self.cliff_front_right_signal = 0 221 if self.cliff_right_signal is None: 222 self.cliff_right_signal = 0 223 if self.user_digital_inputs is None: 224 self.user_digital_inputs = 0 225 if self.user_analog_input is None: 226 self.user_analog_input = 0 227 if self.charging_sources_available is None: 228 self.charging_sources_available = 0 229 if self.oi_mode is None: 230 self.oi_mode = 0 231 if self.song_number is None: 232 self.song_number = 0 233 if self.song_playing is None: 234 self.song_playing = False 235 if self.number_of_stream_packets is None: 236 self.number_of_stream_packets = 0 237 if self.requested_velocity is None: 238 self.requested_velocity = 0 239 if self.requested_radius is None: 240 self.requested_radius = 0 241 if self.requested_right_velocity is None: 242 self.requested_right_velocity = 0 243 if self.requested_left_velocity is None: 244 self.requested_left_velocity = 0 245 else: 246 self.header = std_msgs.msg.Header() 247 self.bumps_wheeldrops = 0 248 self.wall = False 249 self.cliff_left = False 250 self.cliff_front_left = False 251 self.cliff_front_right = False 252 self.cliff_right = False 253 self.virtual_wall = False 254 self.motor_overcurrents = 0 255 self.dirt_detector_left = 0 256 self.dirt_detector_right = 0 257 self.remote_opcode = 0 258 self.buttons = 0 259 self.distance = 0 260 self.angle = 0 261 self.charging_state = 0 262 self.voltage = 0 263 self.current = 0 264 self.temperature = 0 265 self.charge = 0 266 self.capacity = 0 267 self.wall_signal = 0 268 self.cliff_left_signal = 0 269 self.cliff_front_left_signal = 0 270 self.cliff_front_right_signal = 0 271 self.cliff_right_signal = 0 272 self.user_digital_inputs = 0 273 self.user_analog_input = 0 274 self.charging_sources_available = 0 275 self.oi_mode = 0 276 self.song_number = 0 277 self.song_playing = False 278 self.number_of_stream_packets = 0 279 self.requested_velocity = 0 280 self.requested_radius = 0 281 self.requested_right_velocity = 0 282 self.requested_left_velocity = 0
283
284 - def _get_types(self):
285 """ 286 internal API method 287 """ 288 return self._slot_types
289
290 - def serialize(self, buff):
291 """ 292 serialize message into buffer 293 :param buff: buffer, ``StringIO`` 294 """ 295 try: 296 _x = self 297 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 298 _x = self.header.frame_id 299 length = len(_x) 300 if python3 or type(_x) == unicode: 301 _x = _x.encode('utf-8') 302 length = len(_x) 303 if python3: 304 buff.write(struct.pack('<I%sB'%length, length, *_x)) 305 else: 306 buff.write(struct.pack('<I%ss'%length, length, _x)) 307 _x = self 308 buff.write(_struct_12B2hBHhb7HBH5B4h.pack(_x.bumps_wheeldrops, _x.wall, _x.cliff_left, _x.cliff_front_left, _x.cliff_front_right, _x.cliff_right, _x.virtual_wall, _x.motor_overcurrents, _x.dirt_detector_left, _x.dirt_detector_right, _x.remote_opcode, _x.buttons, _x.distance, _x.angle, _x.charging_state, _x.voltage, _x.current, _x.temperature, _x.charge, _x.capacity, _x.wall_signal, _x.cliff_left_signal, _x.cliff_front_left_signal, _x.cliff_front_right_signal, _x.cliff_right_signal, _x.user_digital_inputs, _x.user_analog_input, _x.charging_sources_available, _x.oi_mode, _x.song_number, _x.song_playing, _x.number_of_stream_packets, _x.requested_velocity, _x.requested_radius, _x.requested_right_velocity, _x.requested_left_velocity)) 309 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 310 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
311
312 - def deserialize(self, str):
313 """ 314 unpack serialized message in str into this message instance 315 :param str: byte array of serialized message, ``str`` 316 """ 317 try: 318 if self.header is None: 319 self.header = std_msgs.msg.Header() 320 end = 0 321 _x = self 322 start = end 323 end += 12 324 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 325 start = end 326 end += 4 327 (length,) = _struct_I.unpack(str[start:end]) 328 start = end 329 end += length 330 if python3: 331 self.header.frame_id = str[start:end].decode('utf-8') 332 else: 333 self.header.frame_id = str[start:end] 334 _x = self 335 start = end 336 end += 52 337 (_x.bumps_wheeldrops, _x.wall, _x.cliff_left, _x.cliff_front_left, _x.cliff_front_right, _x.cliff_right, _x.virtual_wall, _x.motor_overcurrents, _x.dirt_detector_left, _x.dirt_detector_right, _x.remote_opcode, _x.buttons, _x.distance, _x.angle, _x.charging_state, _x.voltage, _x.current, _x.temperature, _x.charge, _x.capacity, _x.wall_signal, _x.cliff_left_signal, _x.cliff_front_left_signal, _x.cliff_front_right_signal, _x.cliff_right_signal, _x.user_digital_inputs, _x.user_analog_input, _x.charging_sources_available, _x.oi_mode, _x.song_number, _x.song_playing, _x.number_of_stream_packets, _x.requested_velocity, _x.requested_radius, _x.requested_right_velocity, _x.requested_left_velocity,) = _struct_12B2hBHhb7HBH5B4h.unpack(str[start:end]) 338 self.wall = bool(self.wall) 339 self.cliff_left = bool(self.cliff_left) 340 self.cliff_front_left = bool(self.cliff_front_left) 341 self.cliff_front_right = bool(self.cliff_front_right) 342 self.cliff_right = bool(self.cliff_right) 343 self.virtual_wall = bool(self.virtual_wall) 344 self.song_playing = bool(self.song_playing) 345 return self 346 except struct.error as e: 347 raise genpy.DeserializationError(e) #most likely buffer underfill
348 349
350 - def serialize_numpy(self, buff, numpy):
351 """ 352 serialize message with numpy array types into buffer 353 :param buff: buffer, ``StringIO`` 354 :param numpy: numpy python module 355 """ 356 try: 357 _x = self 358 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 359 _x = self.header.frame_id 360 length = len(_x) 361 if python3 or type(_x) == unicode: 362 _x = _x.encode('utf-8') 363 length = len(_x) 364 if python3: 365 buff.write(struct.pack('<I%sB'%length, length, *_x)) 366 else: 367 buff.write(struct.pack('<I%ss'%length, length, _x)) 368 _x = self 369 buff.write(_struct_12B2hBHhb7HBH5B4h.pack(_x.bumps_wheeldrops, _x.wall, _x.cliff_left, _x.cliff_front_left, _x.cliff_front_right, _x.cliff_right, _x.virtual_wall, _x.motor_overcurrents, _x.dirt_detector_left, _x.dirt_detector_right, _x.remote_opcode, _x.buttons, _x.distance, _x.angle, _x.charging_state, _x.voltage, _x.current, _x.temperature, _x.charge, _x.capacity, _x.wall_signal, _x.cliff_left_signal, _x.cliff_front_left_signal, _x.cliff_front_right_signal, _x.cliff_right_signal, _x.user_digital_inputs, _x.user_analog_input, _x.charging_sources_available, _x.oi_mode, _x.song_number, _x.song_playing, _x.number_of_stream_packets, _x.requested_velocity, _x.requested_radius, _x.requested_right_velocity, _x.requested_left_velocity)) 370 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 371 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
372
373 - def deserialize_numpy(self, str, numpy):
374 """ 375 unpack serialized message in str into this message instance using numpy for array types 376 :param str: byte array of serialized message, ``str`` 377 :param numpy: numpy python module 378 """ 379 try: 380 if self.header is None: 381 self.header = std_msgs.msg.Header() 382 end = 0 383 _x = self 384 start = end 385 end += 12 386 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 387 start = end 388 end += 4 389 (length,) = _struct_I.unpack(str[start:end]) 390 start = end 391 end += length 392 if python3: 393 self.header.frame_id = str[start:end].decode('utf-8') 394 else: 395 self.header.frame_id = str[start:end] 396 _x = self 397 start = end 398 end += 52 399 (_x.bumps_wheeldrops, _x.wall, _x.cliff_left, _x.cliff_front_left, _x.cliff_front_right, _x.cliff_right, _x.virtual_wall, _x.motor_overcurrents, _x.dirt_detector_left, _x.dirt_detector_right, _x.remote_opcode, _x.buttons, _x.distance, _x.angle, _x.charging_state, _x.voltage, _x.current, _x.temperature, _x.charge, _x.capacity, _x.wall_signal, _x.cliff_left_signal, _x.cliff_front_left_signal, _x.cliff_front_right_signal, _x.cliff_right_signal, _x.user_digital_inputs, _x.user_analog_input, _x.charging_sources_available, _x.oi_mode, _x.song_number, _x.song_playing, _x.number_of_stream_packets, _x.requested_velocity, _x.requested_radius, _x.requested_right_velocity, _x.requested_left_velocity,) = _struct_12B2hBHhb7HBH5B4h.unpack(str[start:end]) 400 self.wall = bool(self.wall) 401 self.cliff_left = bool(self.cliff_left) 402 self.cliff_front_left = bool(self.cliff_front_left) 403 self.cliff_front_right = bool(self.cliff_front_right) 404 self.cliff_right = bool(self.cliff_right) 405 self.virtual_wall = bool(self.virtual_wall) 406 self.song_playing = bool(self.song_playing) 407 return self 408 except struct.error as e: 409 raise genpy.DeserializationError(e) #most likely buffer underfill
410 411 _struct_I = genpy.struct_I 412 _struct_3I = struct.Struct("<3I") 413 _struct_12B2hBHhb7HBH5B4h = struct.Struct("<12B2hBHhb7HBH5B4h") 414