def __init__(self, mainLogger):
		self.__mainLogger = mainLogger
		self.__psValue = [0,0,0,0,0,0,0]
		self.__psGroundAmbiantSensors = [0,0]
		self.__psGroundReflectedSensors = [0,0]
		self.__psGroundDeltaSensors = [0,0]
		self.__motorspeed = [0,0]
		self.__color = [0,0,0]
		
		self.__performActionReq = threading.Condition()
		self.__rSensorsReq = False
		self.__rGroundSensorsReq = False
		self.__wMotorspeedReq = False
		self.__wColorReq = False
		self.__stopThymioReq = False
		self.__killReq = False

		self.__commandsListener = None
		self.__simulationStarted = threading.Event()
		self.__simulation = None
		self.__simLogger = None

		# Init the main loop
		dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
		# Get stub of the Aseba network
		bus = dbus.SessionBus()
		# Create Aseba network 
		asebaNetworkObject = bus.get_object('ch.epfl.mobots.Aseba', '/')
		self.__asebaNetwork = dbus.Interface(asebaNetworkObject, dbus_interface='ch.epfl.mobots.AsebaNetwork')
		# self.__mainLogger.debug('Aseba nodes: ' + str(self.__asebaNetwork.GetNodesList()))
		# Load the aesl file
		self.__asebaNetwork.LoadScripts(AESL_PATH, reply_handler=self.__dbusEventReply, error_handler=self.__dbusError)
		# Schedules first run of the controller
		glib.idle_add(self.__execute)
    def __init__(self, mainLogger):
        self.__mainLogger = mainLogger
        self.__psValue = [0, 0, 0, 0, 0, 0, 0]
        self.__psGroundAmbiantSensors = [0, 0]
        self.__psGroundReflectedSensors = [0, 0]
        self.__psGroundDeltaSensors = [0, 0]
        self.__motorspeed = [0, 0]
        self.__realMotorSpeed = [0, 0]
        self.__color = [0, 0, 0, 0]
        self.__temperature = [0]
        self.__sound = [0]

        self.__performActionReq = threading.Condition()
        self.__rSensorsReq = False
        self.__temperatureReq = False
        self.__rGroundSensorsReq = False
        self.__wMotorspeedReq = False
        self.__rMotorspeedReq = False
        self.__wColorReq = False
        self.__stopThymioReq = False
        self.__killReq = False
        self.__soundReq = False

        self.__commandsListener = None
        self.__simulationStarted = threading.Event()
        self.__simulation = None
        self.__simLogger = None

        # Init the main loop
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        # Get stub of the Aseba network
        bus = dbus.SessionBus()
        # Create Aseba network
        asebaNetworkObject = bus.get_object('ch.epfl.mobots.Aseba', '/')
        self.__asebaNetwork = dbus.Interface(
            asebaNetworkObject, dbus_interface='ch.epfl.mobots.AsebaNetwork')
        # self.__mainLogger.debug('Aseba nodes: ' + str(self.__asebaNetwork.GetNodesList()))
        # Load the aesl file
        self.__asebaNetwork.LoadScripts(cl.AESL_PATH,
                                        reply_handler=self.__dbusEventReply,
                                        error_handler=self.__dbusError)
        # Schedules first run of the controller
        glib.idle_add(self.__execute)
Example #3
0
 def on_ready_cb(self, app):
     self.app_ready = True
     import glib
     if self.splash is not None:
         glib.idle_add(self.splash.destroy)
     self.post_start()
Example #4
0
 def on_ready_cb(self, app):
     self.app_ready = True
     import glib
     if self.splash is not None:
         glib.idle_add(self.splash.destroy)
     self.post_start()