Roomba 400 series (and older) do not work
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.
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.
@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.
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.
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.
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)
It seems the more recent 400 series models are compatible with the create_autonomy driver. This is the accompanying manual
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?
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.
BTW, I have gotten my 415 partly working with libcreate - but there is still a bit of work to do.
This is the boot message:
2006-08-19-1814-L
Roomba board revision: 7 (original-roomba-2)