Skip to content

get_location() returning rounded floating point #39

@mattkiim

Description

@mattkiim

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions