Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roomba 400 series (and older) do not work #23

Open
lopsided98 opened this issue Jun 29, 2016 · 10 comments
Open

Roomba 400 series (and older) do not work #23

lopsided98 opened this issue Jun 29, 2016 · 10 comments

Comments

@lopsided98
Copy link
Contributor

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.

@jacobperron
Copy link
Member

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
Copy link
Member

@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.

@lopsided98
Copy link
Contributor Author

lopsided98 commented Jun 29, 2016

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.

@jacobperron
Copy link
Member

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
Copy link
Member

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)

@TheChosenZygote
Copy link

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

@jacobperron
Copy link
Member

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?

@lopsided98
Copy link
Contributor Author

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
Copy link
Contributor Author

lopsided98 commented Jun 30, 2016

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

@lopsided98
Copy link
Contributor Author

This is the boot message:

2006-08-19-1814-L   

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants