sphero-inc / sphero-sdk-raspberrypi-python Goto Github PK
View Code? Open in Web Editor NEWSphero RVR SDK to run on Raspberry Pi using Python
License: Other
Sphero RVR SDK to run on Raspberry Pi using Python
License: Other
I was getting serial.serialutil.SerialException could not open port /dev/ttyS0 when running code.
In Raspberry Pi, I checked /boot/config.txt and saw that enable_uart=1 was indeed set.
I checked /dev/ and found no ttyS0 but instead did see ttyAMA0.
I went in to the observer client and changed the port to serial0 instead of ttyS0. This worked for me.
Here is the change I made to fix this issue.
Not sure if my problem is a common one or if it was specific to me. I was under the impression that generally when setting enable_uart=1 that ttyS0 should show up. I do have a new Raspbian install.
I tried to find if there was a way to read the motor encoder values but was unable to find a way to do so. Can you point me in the right direction or consider this as a feature request to expose the encoder values. This is extremely useful for using RVR with basic SLAM or dead-reconning algorithms that depend on or can be enhanced by odometry.
The title. It seems as if Sphero have either abandoned or stopped working on this SDK. Personally I've had many issues trying to get it to work. Would just like to know if anyone else has recently gotten this to work. I'm using a raspberry pi 3B+ with debian lite. (I am only using ssh.)
I have installed the Sphero SDK on my Raspberry Pi 4, when I run the program it says "Checking RVR firmware versions..." then quits without running it. What should I do?
I am working with Raspbian Lite fresh install.
After running first-time-setup
and reboot the pipenv --python /usr/bin/python3.7
command comes back with error
-bash: -bash:: command not found
So when it tries to run this python -m pip install pipenv
from the first time script it says
no module pip found
I had to manually run sudo apt-get install python-pip
and then manually run the install pip command
Is there something in the manual about not using Lite version? I must have missed it?
When I install the dependencies and I run any example script the RVR doesn't not complete the action I wanted it to. The wires are connected correctly and the script does not return any errors. I am using python 3.9 and a raspi 3B+
To reproduce (based on getting_started/asyncio/driving/drive_raw_motors.py
):
import asyncio
import logging
from sphero_sdk import SpheroRvrAsync
from sphero_sdk import SerialAsyncDal
from sphero_sdk import RawMotorModesEnum
# setup and test logging
logging.getLogger().setLevel(logging.INFO)
logging.info("Now the default logging works")
loop = asyncio.get_event_loop()
rvr = SpheroRvrAsync(
dal=SerialAsyncDal(
loop
)
)
logging.info("Now it does not")
This result is probably not intended, because it makes integration with existing projects more complicated.
The behavior is caused by logging_config.py's 'null_handler', so the workarounds are ether to set SpheroRvrAsync's
log_level to 2, which also cause other additional logs from the rover or to remove the 'null_handler' handler with
null_handler = [h for h in logging.getLogger().handlers if h.name == "null_handler"][0]
logging.getLogger().removeHandler(null_handler)
after the RVR has been initialized.
The proper solution would probably be to create and use a new named logger for the sdk, and block that when using
LogLevel.Silent
.
With the asyncio code I can properly set the port the Pi should use to communicate with the RVR (my Pi is set up as a USB Serial Gadget).
rvr = SpheroRvrAsync(
dal=SerialAsyncDal(
loop,
port_id = "/dev/ttyGS0"
)
)
SpheroRvrObserver, however, does not accept a dal
parameter and so changing the port is not possible. Could this be added as an option?
The readme calls out a rest example, but seems it was removed. Can you share why the rest example was removed along with cleaning up the readme.
thanks
asyncio.contols.drive_control_async.py
In the class DriveControlAsync the definition of the function __timed_drive is
__timed_drive(self, speed, heading, flags, time_to_drive)
However in both the drive_backward_seconds & drive_forward_seconds function when they call __timed_drive they use the argument order (heading, speed, flags, time_to_drive)
This results in the values of heading and speed being swapped, and unexpected behaviour of the robot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.