libcreate icon indicating copy to clipboard operation
libcreate copied to clipboard

Roomba 400 series (and older) do not work

Open lopsided98 opened this issue 9 years ago • 10 comments

I have a 400 series Roomba, and I wanted to see if it had the same odometry problems as the Create, only to discover that libcreate does not work with it at all. The reason for this is that the 400 series implements an older version of the protocol, which does not support the "Stream" command. This is obviously not a simple bug to fix, as it would require significant changes to how libcreate operates.

On the other hand, the "angle" sensor field is implemented differently than on the Create 1, and there is a good chance that it does not have the same problems.

lopsided98 avatar Jun 29 '16 15:06 lopsided98

Good to know. You're right that some significant changes (or additions) to the Serial class would have to be made in order to support older Roomba models.

jacobperron avatar Jun 29 '16 18:06 jacobperron

@lopsided98 What do you think about having separate SerialStream and SerialQuery classes that inherit the same interface? Then the method of acquiring sensor data over serial can be determined at run time. Or perhaps it's overkill and we could just add the query option to the existing class.

jacobperron avatar Jun 29 '16 18:06 jacobperron

That sounds like a good way of doing it. To minimize duplicated code, I think lines 82-94 of Serial::startReading() and the state machine in Serial::onData() should be moved to their own pure virtual methods that get implemented in SerialStream and SerialQuery. SerialQuery can setup a timer (which conveniently can be done with boost::asio) to request data, while SerialStream can use the "stream" command.

Another thing is that the 400 doesn't support the "Query List" command either, only the "Sensors" command, which only allows you to retrieve one group of sensor packets (or all of them) per request. This makes the processing of the response possibly a little more complicated.

lopsided98 avatar Jun 29 '16 19:06 lopsided98

We could keep it simple and always request packet group 0. This provides all sensors available on older Roombas and a minimal set for newer models. By default we should continue to use Stream for the newer models anyways.

jacobperron avatar Jun 29 '16 20:06 jacobperron

Note, there is only one small difference between the old and new protocols wrt packet group 0 and the 10th byte:
Right dirt detect (old) vs. Unused byte (new)

jacobperron avatar Jun 29 '16 20:06 jacobperron

It seems the more recent 400 series models are compatible with the create_autonomy driver. This is the accompanying manual

TheChosenZygote avatar Jun 30 '16 02:06 TheChosenZygote

Indeed. After some reading around the internet it would appear that some 400 Series Roombas are compatible with the OI Spec V2 (ie. this driver). @lopsided98 Do you have the older "Discovery" model by chance?

jacobperron avatar Jun 30 '16 02:06 jacobperron

No I have a 415 (or 4151, I'm not sure where the part number ends and the serial number begins). It looks like this: https://d3gqasl9vmjfd8.cloudfront.net/d596c2ee-09d5-44c4-b713-1cb74c03ab99.jpg

IIRC, the date printed on boot was around August 2006 - I can check again if it matters.

lopsided98 avatar Jun 30 '16 02:06 lopsided98

BTW, I have gotten my 415 partly working with libcreate - but there is still a bit of work to do.

lopsided98 avatar Jun 30 '16 02:06 lopsided98

This is the boot message:

2006-08-19-1814-L   

Roomba board revision: 7 (original-roomba-2)

lopsided98 avatar Jun 30 '16 16:06 lopsided98