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

Source Code for Module create_node.msg._TurtlebotSensorState

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