Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to read sensor data other than battery life off of Parrot Swing via bluetooth? #225

Open
Chris-Sorini opened this issue Jan 5, 2024 · 0 comments

Comments

@Chris-Sorini
Copy link

I would like to read sensor data (speed_x, speed_y, speed_z, speed_ts, altitude, and battery state variables) from a Parrot Swing via bluetooth while it is in flight, but the values for all state variables except for battery do not change.

I have modified the example "demoMamboTricks.py" (https://github.com/amymcgovern/pyparrot/blob/master/examples/demoMamboTricks.py) to work with my Swing instead of a Mambo, changed use_wifi to False since I am using bluetooth, and have added the following after each of the lines in "demoMamboTricks.py" that print the flying state (i.e., print("flying state is %s" % mambo.sensors.flying_state)) to print the state variable values while in flight:

        print("flying state is %s" % mambo.sensors.flying_state)

        mambo.ask_for_state_update()
        mambo.smart_sleep(5)
        print("battery is %s" % mambo.sensors.battery)
        print("speed_x is %s" % mambo.sensors.speed_x)
        print("speed_y is %s" % mambo.sensors.speed_y)
        print("speed_ts is %s" % mambo.sensors.speed_ts)
        print("altitude is %s" % mambo.sensors.altitude)
        print("mambo.sensors_dict is: %s" % mambo.sensors.sensors_dict)
        print("mambo.sensors is: %s" % mambo.sensors)

Note that "mambo" in the above is an instance of the Swing class, not the Mambo class (I just kept the name mambo from the original example). Anyways, when I run this code, the battery state variable is clearly changing (decreasing) each time I print mambo.sensors.battery during the flight, but speed_x, speed_y, speed_z, speed_ts, altitude do not change (speed_x, speed_y, speed_z, speed_ts are always 0 whereas altitude is always -1). Does anyone either know why this is or know of any changes I can make to be able to read off the actual values of speed_x, speed_y, speed_z, speed_ts, and altitude during flight? Any suggestions would be greatly appreciated. Thanks!

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant