Odometer_Arduino [closed]

asked 2017-03-09 03:27:16 -0600

Rai gravatar image

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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-04-27 14:13:44.077742

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
chrissunny94 gravatar image chrissunny94  ( 2018-01-12 05:38:30 -0600 )edit

https://github.com/agnunez/espros

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

chrissunny94 gravatar image chrissunny94  ( 2018-01-12 05:42:27 -0600 )edit