sphero_ros icon indicating copy to clipboard operation
sphero_ros copied to clipboard

Bad SOF RuntimeError

Open irmingard opened this issue 8 years ago • 3 comments

What am I doing wrong if I get this line/error?

Line 837: raise RuntimeError("Bad SOF : " + self.data2hexstr(data))

I'm assuming it's because the connections weren't shut down correctly during a previous run, however, I do not know what to do besides calling the disconnect method for each Sphero before exiting a script run.

Any ideas, @mmwise and others?

irmingard avatar Sep 05 '16 15:09 irmingard

I think this is the same problem as before (https://github.com/mmwise/sphero_ros/issues/7), because no care is given to the state of the buffer at any time and because the author relies on precise indexing to unpack messages whenever you have data left in the buffer it will raise some kind of exception. So it does not mean you are doing anything wrong, but rather that the source code should be revised to correct those errors.

davinellulinvega avatar Sep 05 '16 15:09 davinellulinvega

Hello, I am running into a similar error. I am using the node to control several spheros for some research work. Is there a way either of you know how to just clear all data from the socket at the begging of the script? That way this error won't occur anymore? Thanks!

miscott avatar Dec 11 '16 19:12 miscott

clearing the buffer doesn't work.I too work with multiple spheros, what you need to do is make sure the packets are formed correctly by calculating a checksum and see if it matches, If it doesn't then read to the beginning of a packet (or what looks like the beginning) and try again. I have the changes on a private repo, but if you message me I can send you my updated driver file.

darin-costello avatar Jun 07 '17 01:06 darin-costello