Go Down

### Topic: Is it possible to make the robot to turn X degrees and Move Y meters? (Read 2151 times)previous topic - next topic

##### Jun 22, 2012, 02:13 pm
Hello Everyone,

I was thinking to work on robot navigation and use SLAM. but due to the limitation and SLAM computation I changed my mind.

I am planing to make a function and ask the robot to turn x degree and move y meters like "MOVE(45degree, 100Meter)".

Was wondering if it is possible and doable with Arduino.

any recommendations or suggestions.

Thank you

#### MikMo

#1
##### Jun 22, 2012, 02:26 pm
The biggest problem will be to determine when has it turned 45 degrees nd when has it moved 100m

If you can solve that i can't see why it should not be possible.

#### AWOL

#2
##### Jun 22, 2012, 02:43 pm
Quote
I am planing to make a function and ask the robot to turn x degree and move y meters like "MOVE(45degree, 100Meter)".

I'd plan on making (at least) two functions; one to do the turn, and one to do the move.
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#3
##### Jun 22, 2012, 03:37 pm
AWOL

I agree with you, two functions sounds a better approach.

As Mike Said, it is difficult to determine if it has turned or moved 100 meter. However, It may be possible to use digital compass for this as I heard that it is used to measure the rotation of objects like motors.

the other challenge might be the obstacle. for example, if it turned 45 degrees and moved 10 meters and sees a wall, still need to travel 90 meters after passing the wall. so it looks for a way to pass the wall. any recommendations in this point?

Kind regards

#### AWOL

#4
##### Jun 22, 2012, 03:42 pm
Quote
However, It may be possible to use digital compass for this as I heard that it is used to measure the rotation of objects like motors.

Not unless the magnetic field of the motor interferes in some repeatable way with the compass.
A compass can give an indication of direction, but not distance.
For that you need an odometer or a location-finding mechanism like GPS.
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### clvrmnky

#5
##### Jun 22, 2012, 04:17 pm

AWOL

I agree with you, two functions sounds a better approach.

As Mike Said, it is difficult to determine if it has turned or moved 100 meter. However, It may be possible to use digital compass for this as I heard that it is used to measure the rotation of objects like motors.

the other challenge might be the obstacle. for example, if it turned 45 degrees and moved 10 meters and sees a wall, still need to travel 90 meters after passing the wall. so it looks for a way to pass the wall. any recommendations in this point?

Kind regards

Look up "rotary encoders" and "Gray codes", as this is what is typically used to figure out distance and rotation.  Well, you will have to figure out the obstacle avoidance and wall-following stuff. But you are nowhere unless you know how many turns a wheel has taken, or in what direction a steering mechanism has turned you.
I yield() for co-routines.

#6
##### Jun 22, 2012, 04:38 pm
Thank you very much for your help. I am going to look at the suggested approaches.

Do you guys think that GPS works in indoor environment? I doubt it does as I read somewhere that it has 10 to 15 feet inaccuracy.

Regards

#### AWOL

#7
##### Jun 22, 2012, 04:47 pm
GPS may not work well indoors, but differentiial GPS is capable of very much better than 5metre accuracy.
(when you wrote earlier of tens of metres, I assumed outdoors)
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### PeterH

#8
##### Jun 22, 2012, 11:46 pm

Look up "rotary encoders" and "Gray codes", as this is what is typically used to figure out distance and rotation.  Well, you will have to figure out the obstacle avoidance and wall-following stuff. But you are nowhere unless you know how many turns a wheel has taken, or in what direction a steering mechanism has turned you.

This approach is what I'd call dead reckoning - you turn the wheels the right amount and assume the 'bot has turned/moved the corresponding amount. This doesn't account for any slip, or inaccuracy in measuring/calculating the amount the wheel has moved. It is preferable to measure the orientation and position directly as this enables you to compensate for any errors or inaccuracy in the movement. But getting an accurate measurement of orientation and position is hard on a small scale.

#### florinc

#9
##### Jun 22, 2012, 11:53 pm
Some markers (e.g. beacons, RFID tags, sensors, camera etc) would also help to find the relative position in the field. Especially easy to set up if the action happens indoors.

#### OscylO

#10
##### Jun 23, 2012, 12:29 am
If you want your robot to work indoors on flat and hard surface you can use mouse sensor to calculate position and heading of robot in relation to starting point.
My robot demonstrates this approach in those videos:

<a href="http://vimeo.com/35251478"></a>
Programmed circle equation:

<a href="http://vimeo.com/34097090"></a>

Programmed sinusoidal equation:

<a href="http://vimeo.com/34250883"></a>

Hope it helps.

Best regards,
Oskar Wicha