mmwise / sphero_ros

A Sphero ROS driver.
76 stars 61 forks source link

“got a packet that isn't streaming: ” error #7

Closed irmingard closed 8 years ago

irmingard commented 8 years ago

I'm running the test.py script in PyCharm. After the Sphero is paired, I get the following error which repeats until I manually kill the process:

got a packet that isn't streaming:

Why is this happening?

irmingard commented 8 years ago

@davinellulinvega I believe you did some work on this back in November? Do you have any suggestions?

davinellulinvega commented 8 years ago

Hello, Unfortunately I have not had the time to programme a lot with the a sphero lately. My conclusion at the time was that the driver has been built with an older version of the robot and that newer version use a slightly different packet structure when acknowledging the connection. I also"discovered" that once the connection crashes, all subsequent connection work perfectly.

irmingard commented 8 years ago

Thank you for your quick response! @mmwise can you confirm this? How much code would be required to update the driver, if it's a manageable amount, I could possibly do it myself if you give me some pointers..

davinellulinvega commented 8 years ago

The problem is situated around the lines 820 - 837 in the sphero_driver.py file. If you print the raw data received (line 821) you should be able to compare with what the program is awaiting (one of the IDCODE from line 61) and from there write some quick fix. I do not know if this make a lot of sense to you, but unfortunately I do not have the robot to help you further. Sincerely.

irmingard commented 8 years ago

Last question (for now): how do I edit the sphero_driver.py file? Do I have to go in through Terminal / sudo stuff or is there a more user-friendly option of editing and saving it in PyCharm? Currently it's read-only.

davinellulinvega commented 8 years ago

The simplest way would be to fork the project to your own account (simply click the fork button in the top right corner on github). Then clone the project on your computer and you can play around with pycharm and even commit / push your own changes. Once you are satisfied with the result you can make a pull request on github on the mmwise/sphero_ros project.

To build on my previous answers, and if memory serves me well, I tried to investigate a bit further back in November when the sphero was still around. At that time I did print the raw data coming from the robot and what I observed is that "too much" data was sent to the computer. Basically, when the sphero_driver connects to the robot (the first time only?), the python script does not empty the receiving buffer, thus some data remains and on each subsequent read the interesting bit of data is truncated and in the wrong place. Therefore, if all the above is correct, it means that you might have to take a look at the connection procedure and make sure everything is read.

Sincerely.

manishravula commented 6 years ago

@irmingard , Any progress on the code? I am also running into this problem and would love to collaborate on a patch.

irmingard commented 6 years ago

@manishravula wongkaiweng's PR fixed it for me.