Society of Robots - Robot Forum

Software => Software => Topic started by: newbie on August 24, 2008, 04:23:39 AM

Title: Wavefront
Post by: newbie on August 24, 2008, 04:23:39 AM
basically i understand how the wavefront algorithm works but the c code =  ??? :D
need someone to explain about the wavefront code:
1.
Quote
int counter=0
what is counter? is it counter means times of run?
Quote
y++
Quote
x++
2.what do the above symbols mean?
Quote
!=
3.what does this symbol mean?
4.what do the "mean node location in up, down, left, right "mean?

the question is based on the irobot\wave_front.c

i will really appreciate if someone can explain the whole code to me. I am too greedy?? ;D ;)

Thank you.
Title: Re: Wavefront
Post by: Admin on August 24, 2008, 03:59:45 PM
It sounds like you are a very weak programmer . . .
http://www.societyofrobots.com/robot_faq.shtml#programming_tutorial

I suggest getting some books on programming in C:
http://www.societyofrobots.com/robot_faq.shtml#robot_books

It will really help you understand code.

Google around for programming tutorials too:
http://www.google.com/search?q=program+C+tutorial

counters are for while/for loops

y++;
is the same as
y=y+1;

!=
means
'does not equal'

Quote
what do the "mean node location in up, down, left, right "mean?
a node is a location in the grid
Title: Re: Wavefront
Post by: newbie on August 26, 2008, 07:53:17 AM
how i upload the code to my arduino , by using normal arduino official software or others using isp programmer?
my maze is 6x6 (although simple but i ....  ???,haha), i do not know my goal coordinate and starting point coordinate, can i still using this method?
i want my robot has a speed run mode after the first searching mode, how to program it???

thank you.

pls reply  :'(
Title: Re: Wavefront
Post by: Admin on August 28, 2008, 08:29:43 AM
you can just use the normal Arduino software
Title: Re: Wavefront
Post by: newbie on September 01, 2008, 03:01:48 AM
you can just use the normal Arduino software
i receive the below error:
Quote
error: 'long int map [6][6]' redeclared as different kind of symbolC:\Users\user\Desktop\arduino-0011\hardware\cores\arduino/WProgram.h:19: error: previous declaration of 'long int map(long int, long int, long int, long int, long int)'


 In function 'int propagate_wavefront(int, int, int, int)':
 In function 'void unpropagate(int, int)':
 In function 'void clear_map()':
 In function 'int min_surrounding_node_value(int, int)':
Title: Re: Wavefront
Post by: newbie on September 01, 2008, 04:21:26 AM
Quote
abs(new_state-old_state)==2
Quote
(signed int) (old_state-new_state)==-1

can anyone explain the above code? thank you in advance
Title: Re: Wavefront
Post by: Admin on September 01, 2008, 08:11:19 AM
Look through those links I sent you before. The answers are in those programming tutorials. Its very basic stuff, you just need to spend the time reading it . . .