How to use the qi.module function in qi

To help you get started, we’ve selected a few qi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aldebaran / naoqi_navigation_samples / places / explorationManager.py View on Github external
# base 64
        buff64 = base64.b64encode(buff)
        full = "data:image/png;base64," + buff64
        # show app
        self.memory.raiseEvent(self.events["metricalMap"], [mpp, size, map[3], full])

    def getOccupancyMapParams(self):
        return [self.occMap.size, self.occMap.metersPerPixel, self.occMap.originOffset.toVector()]

if __name__ == "__main__":
    app = qi.Application(sys.argv)
    app.start()
    session = app.session

    #get the logs
    mod = qi.module("qicore")
    provider = mod.initializeLogging(app.session)

    # don't forget to check that the services you use are ready!
    for required_service in ["ALMemory", "ALNavigation", "ALTabletService"]:
        future = session.waitForService(required_service)
        if future is not None:
            future.wait()
    my_service = ExplorationManager(session)
    register_id = session.registerService("ExplorationManager", my_service)
    app.run()
github pepperhacking / studiotoolkit / python / stk / logging.py View on Github external
def get_logger(session, app_id):
    """Returns a qi logger object."""
    logger = qi.logging.Logger(app_id)
    try:
        qicore = qi.module("qicore")
        log_manager = session.service("LogManager")
        provider = qicore.createObject("LogProvider", log_manager)
        log_manager.addProvider(provider)
    except RuntimeError:
        # no qicore, we're not running on a robot, it doesn't matter
        pass
    except AttributeError:
        # old version of NAOqi - logging will probably not work.
        pass
    return logger