PDA

View Full Version : IR transmitter/receiver setup ROS-Arbotix2



calmur
01-09-2015, 05:34 AM
Hi,

I want to use an ir transmitter/receiver on my ros-enabled Arbotix2.

Following are the sensors I have:
Seeed Studio Grove - Infrared Receiver
Seeed Studio Grove - Infrarot Emitter

Is it possible to setup the above IRs to work with ROS and plugged to my Arbotix2?

BTW: I tried Sharp distance sensors and they work out of the box with Arbotix2-ROS.

Thanks and happy new year
MC

tician
01-09-2015, 05:28 PM
1) Since the Arbotix2 was only ever a prototype given to a select few users, so you are most likely using the trossen arbotix-M.
2) The grove Infrared Emitter/Receiver pair is for communications, not distance measurement.


The Sharp distance sensors use a single ADC that can already be polled by the arbotix-ros firmware, while the grove IR pair is for digital communications using a digital pin on each side of the 'link' between two disconnected devices. Since the emitter is just an IR LED and a transistor, it must be be modulated at 38kHz using the grove IR send library (http://www.seeedstudio.com/wiki/Grove_-_Infrared_Receiver) to control the digital pin switching which will occur at a faster rate than the arbotix-ros firmware could handle using discrete commands from another node over USB.

calmur
01-09-2015, 05:53 PM
Hi tician,

I don't (yet) have an Arbotix-M. Let's say I've an Arbotix V0.9 for Rev A Boards which is depicted in arbotix-manual-draft2.pdf.
The Sharp distance sensors were just an example for a kind of wishful thinking I had while writing this thread.

I've played with grove IR send library and successfully read my tv-remote signals but that setup consisted of an arduino.
My Idea is to reduce the board-overhead by using an all-in-one solution with Arbotix.

If I understand you right, the answer is "no", IR transmitter/receiver don't work with Arbotix-ROS.

Thanks
MC

tician
01-09-2015, 06:13 PM
You will have to modify the arbotix-ros firmware to use the seeed IR send library and produce an additional topic/service for the other nodes to send the value you want sent over the IR emitter. Basically, some node sends a 8~32 bit value to the new service, the arbotix node on the pc sends that value over USB to the arbotix firmware, the arbotix firmware takes the number and sends that to the IR send library. Receiving would be pretty much the same, but in reverse (receive, send over USB to pc, pc's arbotix node publishes on a new topic).

calmur
01-09-2015, 06:32 PM
Ok, I'll give it a try. In the arbotix-ros firmware there's a user_hooks.h. Is this the place to start, or is it better to create a custom.h and include it into ros.ino?

tician
01-09-2015, 08:18 PM
Been a while since I looked through the arbotix-ros files, but 'user_hooks.h' appears to be the easiest way to do it. Add any setup for the IR_Send library in the userSetup() function. Add a check in userWrite() to write the uint8_t 'param' through IR_Send when userWrite() is given the correct index (must be 100 or greater). Maybe add another check in userRead() if you want to use the IR receiver.

After that, you have to dive into the arbotix_python files to add a new controller to perform a write to the arbotix register. Not entirely sure right now how it would be done, but probably copy-paste-modify one of the existing 'controllers' to perform a write() to the arbotix with servo 'index' of '253' (arbotix), a 'start' register address of '100' or whatever selected in the arbotix firmware, and 'values' being the uint8_t to be sent with the IR_Send library.

calmur
01-10-2015, 04:21 AM
This is a nice picture of a workflow for managing such things. Thanks for pointing into the right direction, tician.