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

How to get sensor values ? #16

Closed
Koraze opened this issue Nov 10, 2021 · 9 comments
Closed

How to get sensor values ? #16

Koraze opened this issue Nov 10, 2021 · 9 comments

Comments

@Koraze
Copy link

Koraze commented Nov 10, 2021

Hi, I just got a Sphero Bolt and I'm learning to use it with your library. Sadly all sensors return "None". Can you tell me where is the mistake ? Here is my code :

import time
from spherov2 import scanner
from spherov2.sphero_edu import SpheroEduAPI
from spherov2.types import Color

toy = scanner.find_toy()
print(toy)
with SpheroEduAPI(toy) as droid:
    droid.reset_aim()
    droid.set_main_led(Color(r=0, g=0, b=255))
    print(droid.get_acceleration())
    print(droid.get_luminosity())
    droid.set_speed(60)
    time.sleep(0.5)
    droid.set_speed(0)
    print(droid.get_location())
@Asraphaiel
Copy link

Having exactly the same issue. I'm using an Ollie though

@Cole1220
Copy link
Contributor

Ill look into this shortly. Stuck on the other issues so I'll get you an answer asap

@Cole1220
Copy link
Contributor

So i found out what's going on here, however i also found a much better way to translate the APK and am going to attempt to update code to do so, but there are calls missing with params not currently available in the library so updates will be coming with this in the forefront of my mind. Am currently working on.

@Koraze
Copy link
Author

Koraze commented Nov 16, 2021

Okey, I'm waiting for your next update. My students will love these ! Thanks for all

@Asraphaiel
Copy link

great....exciting stuff, thank you!

@Cole1220
Copy link
Contributor

Cole1220 commented Dec 1, 2021

Hey @superfashi I'm kindve a noob at this right now. Investigating still, but curious if you have insights? it appears that sensor_control for the Bolt should return StreamingControl rather than SensorControl, however in utils.py in add_listeners I'm hitting false for hasattr(toy, 'sensor_control'). Thats as far as I've gotten so far. Learning these python nuances but I'm hitting a wall at every turn LOL

@superfashi
Copy link
Member

Let's use emails for this. Mine can be found under my homepage.

@Cole1220
Copy link
Contributor

Cole1220 commented Dec 10, 2021

Hey All,
I just cracked the issue here, will be getting a fix up soon, most likely by EOD today. Sorry for the delay, hope it's not too late for your uses, let me know if there are any other scenarios you may find to not work after I submit.

Edit: Luminosity is fixed, forgot about accel and looking into now
Second Edit: I fixed all sensors now, found out the overall issue

@Cole1220
Copy link
Contributor

Pull request submitted, should be available once approved

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

4 participants