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

get_location() returning rounded floating point #39

Open
MatthewK0617 opened this issue Sep 21, 2023 · 2 comments
Open

get_location() returning rounded floating point #39

MatthewK0617 opened this issue Sep 21, 2023 · 2 comments

Comments

@MatthewK0617
Copy link

MatthewK0617 commented Sep 21, 2023

Hi, the get_location() api seems to return a value that is either a rounded floating point, or an integer value that was transformed into a floating value. I'm suspecting it's the latter because of the binary locator flags in [1] and the StreamingService classes in spherov2.py/spherov2/controls/v2.py.

[1]:

class LocatorFlags(IntFlag):
    AUTO_CALIBRATE = 0x1  # 0b1

To reproduce this:

from spherov2 import scanner
from spherov2.adapter.tcp_adapter import get_tcp_adapter
from spherov2.sphero_edu import SpheroEduAPI

toy = scanner.find_toy()
with SpheroEduAPI(toy) as api:
    print(api.get_location())

I am working with Python 3.11.3 64-bit, spherov2 version 0.12, and a Sphero SPRK+.

Other than this issue, this has been a great and simple package to work with, thank you!

@superfashi
Copy link
Member

Hi, what do you get as the return value?

@MatthewK0617
Copy link
Author

{'x': 0, 'y': -1} (had to tell the Sphero to spin first, otherwise None is returned)

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

2 participants