Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 50

Odometer_Arduino

$
0
0
Hi, OKAY, I hate to admit it but I am a total NOOB. But I really work hard to learn this stuff. So, yeah... I have made an odometer using Arduino and a couple of IR LEDs. Below is the sketch: int counter; int currReading; int prevReading = 0; int threashold = 600; void setup() { Serial.begin(9600); } void loop() { currReading = analogRead (A0); delay(1); if(currReading > threashold && prevReading < threashold) { counter = ++counter; } prevReading = currReading; Serial.println (counter); } By adjusting the delay time delay(1); I can get readings in different intervals: when starting 0 0 0 0 ... when first turn 1 1 1 1 ... when second turn etc. 2 2 2 2 ... My question is how can I connect this to ROS in order to get the location of the base. (actually I need the location of the camera but I am assuming the camera is fixed on top) I am actually working on finding answers to [this](http://answers.ros.org/question/256226/find-3d-location-of-the-sensor-when-a-depth-image-arrives/) question posted here. Basically, I need to get something like this: I don't have any special hardware that supports current libraries. I am making my own stuff. I am literally lost, so any help is pretty much appreciated. Millions of thanks in advance.

Viewing all articles
Browse latest Browse all 50

Trending Articles