Attaching an Sick S300 Advanced to a PC with ROS
After attending the ROSCon several days ago I got the job to work with ROS in my company, which worked very well so far. Now my current project is to spark some ideas and show some possibilities, and one of the best ways to do that would be to plug one of our laser scanners (Sick S300) to a pc and show some raw data, or even work with it.
My plan is to use the cob_sick_s300 package which is already working to get the data. I have 1 issue currently and hope someone can help me:
1: Attaching the scanner to the PC: Unfortunately only the programming interface uses rs232, the data interface uses a bunch of other not directly pc compatible interfaces, one of them being rs422. As far as my knowledge goes on those interfaces rs485 is downwards compatible to rs422 and I happen to have access to an rs485->USB interface. Do you see this working when properly connected to the PC or might I run into more problems here?
Answered: Doesn't work, most likely due to the siemens converter interfering with the signal by own processing of the data. Edit: Well actually I made a bad mistake, I have an advanced version to work with which actually doesn't have an RS422 output... I carefully read that section of the manual but it seems that still wasn't careful enough
2: When I take the solution above, any clue how I can find the proper port I have to direct the s300 package towards? My searches here haven't really gotten me anywhere, maybe I missed out on some tutorial or information source here.
Answered: dmesg does work in order to find the right port.
3: Well I'm not quite through yet though. After setting up the scanner with the rs232 interface I made some final tests and got the conclusion that the Siemens interface (rs422<->rs485) doesn't work, noticed however that the SICK software can read out the raw data through the rs232 interface. So it should be possible to do that with ROS as well, right? I got a message that the scanner has been successfully opened, however I get the same message when only my USB<->RS232 connector is attached... Obviously ma data topics stay silent, though I don't know why or how to continue...
Answered: It is possible to access the data through the programming interface after all, I'll post a full answer.
4: As I can't accept my own answer yet anyways I may as well ask a last question here: Are there already finished packages for speaking with an SICK S300 Standard/Advanced? I can't seem to find any.
3: Yes, this is normal and what I would have expected. It just says that the device was opened, but states nothing about any connection as RS232 doesn't have any handshake protocol or anything. To see that it really works, you'd need to transfer some data.
3.2: For RS232, check your data rate. Usually RS422 is preferred as it offers higher throughput. 115200 is probably too slow to get all laser data through.
3.3: One other thing: The protocol might be totally different on the RS232. Doesn't mean it has to be, but look it up in the manual! I fell into this trap at another SICK scanner, when using the ethernet port that the SICK software used and nothing worked until switch to the "correct" port.
3.4 IIRC the RS232 is the round connector in the front, right? That's probably not a good connection for a robot anyways.
As for 3: There I was still using the (actually not present...) RS422 interface. I guess it was a valid attempt, I just missed a necessary piece of Information.
http://ros.org/wiki/sicks300http://ros.org/wiki/cob_sick_s300
Those are the only 2 official drivers I found before as well. Both however address the professional variant which means it won't work with the standard/advanced, unless the mentioned "serial interface" he is talking about is actually the RS232, not the RS422 like I would actually expect.