Adaptive mapping for newbie


hello everybody,
i new programming , arduino, that`s why questions maybe stupid..:)
i`am trying write code (my version of adaptive mapping) robot platform - http://i40.tinypic.com/tz9kl.jpg
it has 2 motors , 2 wheel encoders. code:
there 3 main parts of code:
1. robot goes, scans area can go , no, , stores information(map) sd.
2. when area scanned , map complete. can give command robot  - go there or here(go target).
3. if on way target old way (that stored sd) not more actual, because there on way (chair or else). need change map on sd , write way no more possible. calculate new way target , go there.
the first part of code think know how write. map on picture, should discretized square units same size robot. robot can turn 90 degrees.
and store the information map 500500, first 3 digits x , second 500 y. docking station 500500(x=0,y=0)
if x = 12, y = 74 512574
if x = -50, y = -20 450480

and comes question: 
for example
500500 - robot here(docking station).
497502 -  target.

so code must this
read current position;
read target position;
currentpostion = 500500;
target position = 497502;
if(current position != target position)
and here comes clever algorithm..:) should tell go 500501
if (500501 == free(read ping)) {
go new postion = 500501;
}
else
write map(sd) 500501 not free;
clever algorithm();

so maybe can give me tip how should clever algorithm calculate way target?

why i`am using 500500 , not x=0,y=0, because me(newbie) way seem more easy.
so result should
http://www.youtube.com/watch?v=n7zdispa3_e
p.s. why don`t use code clever guy that`s on video? because code difficult me , can`t understand it. better write own able change or configure it.
thank much!

it better idea cut down problem 2 smaller problems: waking along x , along y axis.

current_x_position = 500
target_x_position = 502

current_x_position = cleveralgorithm( current_x_position, target_x_position )
...

how program "cleveralgorithm"?
hint: note target_x_position can smaller current_x_position.

once have written cleveralgorithm can apply same procedure y axis.

oliver



Arduino Forum > Using Arduino > Programming Questions > Adaptive mapping for newbie


arduino

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO