parameters: (self)
docstring: process state changes
docstring_summary: process state changes
docstring_tokens: process state changes
function: def process_run_state(self):
          """
          process state changes
          """
          command = None
  
          # get last command
          while not self.carla_control_queue.empty():
              command = self.carla_control_queue.get()
  
          while not command is None and not rospy.is_shutdown():
              self.carla_run_state = command
  
              if self.carla_run_state == CarlaControl.PAUSE:
                  # wait for next command
                  rospy.loginfo("State set to PAUSED")
                  self.status_publisher.set_synchronous_mode_running(False)
                  command = self.carla_control_queue.get()
              elif self.carla_run_state == CarlaControl.PLAY:
                  rospy.loginfo("State set to PLAY")
                  self.status_publisher.set_synchronous_mode_running(True)
                  return
              elif self.carla_run_state == CarlaControl.STEP_ONCE:
                  rospy.loginfo("Execute single step.")
                  self.status_publisher.set_synchronous_mode_running(True)
                  self.carla_control_queue.put(CarlaControl.PAUSE)
                  return
function_tokens: def process_run_state ( self ) : command = None # get last command while not self . carla_control_queue . empty ( ) : command = self . carla_control_queue . get ( ) while not command is None and not rospy . is_shutdown ( ) : self . carla_run_state = command if self . carla_run_state == CarlaControl . PAUSE : # wait for next command rospy . loginfo ( "State set to PAUSED" ) self . status_publisher . set_synchronous_mode_running ( False ) command = self . carla_control_queue . get ( ) elif self . carla_run_state == CarlaControl . PLAY : rospy . loginfo ( "State set to PLAY" ) self . status_publisher . set_synchronous_mode_running ( True ) return elif self . carla_run_state == CarlaControl . STEP_ONCE : rospy . loginfo ( "Execute single step." ) self . status_publisher . set_synchronous_mode_running ( True ) self . carla_control_queue . put ( CarlaControl . PAUSE ) return