mmwise / sphero_ros

A Sphero ROS driver.
76 stars 61 forks source link

Bad SOF RuntimeError #11

Open irmingard opened 8 years ago

irmingard commented 8 years ago

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?

davinellulinvega commented 8 years ago

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.

miscott commented 7 years ago

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!

darin-costello commented 7 years ago

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.