Rico Dredd Posted October 26, 2015 at 02:45 PM Posted October 26, 2015 at 02:45 PM Hallo, ich bin gerade ratlos, aber vielleicht sehe ich auch den Wald vor lauter Bäumen nicht. Mit Python möchte ich die Orientation des IMU V2.0 abfragen. Eine simple Abfrage mit get_orientation klappt problemlos. Nun würde ich gerne die Funktion CALLBACK_ORIENTATION nutzen. Komischerweise löst er die Callbackfunktion nicht aus. Das Beispiel mit CALLBACK_QUATERNATION klappt problemlos. Ein simpler Testcode müsste so aussehen: HOST = "localhost" PORT = 4223 UID = "XYZ" # Hier steht natürlich die richtige ID from ip_connection import IPConnection from brick_imu_v2 import BrickIMUV2 # Callback function for orientation callback def cb_orientation(heading, roll, pitch): print(heading) if __name__ == "__main__": ipcon = IPConnection() # Create IP connection imu = BrickIMUV2(UID, ipcon) # Create device object ipcon.connect(HOST, PORT) # Connect to brickd # Don't use device before ipcon is connected imu.register_callback(imu.CALLBACK_ORIENTATION, cb_orientation) imu.set_orientation_period(100) Aber ich bekomme keinen Wert. Wo liegt mein Fehler? Quote
borg Posted October 26, 2015 at 05:26 PM Posted October 26, 2015 at 05:26 PM Oh, du hast in der Tat einen Fehler in der Firmware gefunden . Bitte auf 2.0.1 aktualisieren, dort sollte es jetzt gefixt sein . Quote
Rico Dredd Posted October 27, 2015 at 08:16 AM Author Posted October 27, 2015 at 08:16 AM Vielen Dank für die schnelle Hilfe Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.