|
Features:
|
Wall-e's advanced programming structure provides an interface to a map of his surroundings. A 2-D array of information is constantly
updated during Scans.c functions. This feature provides the Movements.c functions ability to determine escape paths and understand
it's enviromental surroundings.
This is all done with only 1 IR Distance Sensor.
When any of my code asks to scan, the data is put into an array . the array is 2-d and looks like this...
The First column is the array index. The other 14 points from left To right are his vision values, the center values being his head position center. Each column of the array history. I only keep 10 rows of history, and 14 points across becuase his head has 14 positions.
10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- Everytime Wall-e moves forward, the array index is increased and the data is moved back one row.
- If Wall-e moves backwards, the array index is decreased and the data is moved forward one row.
- If Wall-e turns either direction, some magic occures and the table transforms.
If Wall-e is beside a wall with something in front of him, it'd look like ths...
10, 38, 36, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9, 0, 0, 0, 0, 23, 22, 22, 0, 0, 0, 0, 0, 11, 0
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0
6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0
3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0
2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0
Now when ever his next decision is randomly generated by his personality module. that's a whole new topic. But when the decision is made, it may or may not actually do anything. becuase that decision might not have enough room to complete the action.
So now we move onto the movements.c file. Which references the Scans.C 2-D array. Whenever a movement is requested by his personality, the movement examines the array and determines if it can be done. Maybe only partially be done. Or maybe entirely done. That's up to the data in the array.
Wall-e now knows how far he can turn in either direction. How to navigate through table legs and chair legs. He also now knows how to far to backup if he wants to go against a wall. You can see that demonstrated in the last video.
Now on top of all that. Becuase i have this array. I can also reference it to determine if something magically appeared or disappeared. If that is the case, then guess what? it must be human! If it moves, interact with it! So he will turn towards the change, and do some animations (random of course). And now he's somewhat life like.


|