Robotics StackExchange | Archived questions

Odometer_Arduino

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 question posted here. Basically, I need to get something like this:

<timestamp.sec>
<timestamp.usec>
<camera pose w.r.t. odom frame  (x,y,z,qx,qy,qz,qw)>

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.

Asked by Rai on 2017-03-09 04:27:16 UTC

Comments

What is it that you were trying to achive ?

Using IR scans , all you get is the obstacles not the odometry .

Odometry can come from

  • Visual Odometry
  • Encoder based odometry

Asked by chrissunny94 on 2018-01-12 06:38:30 UTC

https://github.com/agnunez/espros

This is a beautiful implementation of ROS on cheap NodeMCU boards .

Asked by chrissunny94 on 2018-01-12 06:42:27 UTC

Answers