Olympe 7.0.2 event listener

I’ve updated from olympe 1.7 to 7.0.2 and I am trying to subscribe to events, but with no luck. This code is working fine on the older version, but I want to use it on the newest version of olympe:

import olympe
from olympe.messages.ardrone3.PilotingState import AttitudeChanged
import time

class FlightListener(olympe.EventListener):

    def AttitudeChange(self, event, scheduler):
        roll = event.args['roll']
        pitch = event.args['pitch']
        yaw = event.args['yaw']
        print(f"roll: {roll}, pitch: {pitch}, yaw: {yaw}")

olympe.log.update_config({"loggers": {"olympe": {"level": "ERROR"}}})
drone = olympe.Drone(SKYCTRL_IP)
listener = FlightListener(drone)

while True:

The print with the drone.get_state is working fine, but the one in the event listener is never triggered. Could you suggest a solution?

1 Like

I’ve made a pull request with the fix that you can check out here. It looks like this fix is working as expected, but it needs to be reviewed so that it can be used with pip as a release.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.