| [ Home | Comics | Robots | Humans | Projects | About | Account ] | |
18 Aug 2003 raquib »
OK, here's some really basic code for one of my subroutine
programs. This one will be the one that "blindly" builds a
map of where the robot is and where other things may be.
The map itself is only used as a secondary source (more for
seeing "am i headed in the right direction" then for
planning out complex moves).
sensors used: 3 IR sensors that measure proximity to robot. They are placed facing foward, foward left, and foward right.Distance tracking: x,y, and degree values of the robot are measured by the robot. There may be a lot of imprecision here, which is why the map is a secondary source! (NOTE: the x and y values may be negative! the robot starts off in the state 0,0 ) The pseudocode: /* NOTES: if you use this, email me...! raquib0@lycos.com i'd like to hear about your robot! (credit would be nice too..) a map is made up of areas an area is a matrix of doubles (real numbers) where the location of each element (x,y) represents a set distance and the value of each element represents the probability that is is "filled". when I say "mark" an area, i mean that you will do this: the elements in the matrix with a value above a certain threshold are likely to be filled... you can use this to plan a overall route to a point. */ |