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 / View on Github external
# base 64
        buff64 = base64.b64encode(buff)
        full = "data:image/png;base64," + buff64
        # show app
        self.memory.raiseEvent(["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)
    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:
    my_service = ExplorationManager(session)
    register_id = session.registerService("ExplorationManager", my_service)
github pepperhacking / studiotoolkit / python / stk / View on Github external
def get_logger(session, app_id):
    """Returns a qi logger object."""
    logger = qi.logging.Logger(app_id)
        qicore = qi.module("qicore")
        log_manager = session.service("LogManager")
        provider = qicore.createObject("LogProvider", log_manager)
    except RuntimeError:
        # no qicore, we're not running on a robot, it doesn't matter
    except AttributeError:
        # old version of NAOqi - logging will probably not work.
    return logger