| 33 | |
| 34 | == 6/20/07 - Day 13 == |
| 35 | |
| 36 | We accomplished a few things today. In particular, we've written two python scripts which perform some wifi related tasks. |
| 37 | |
| 38 | The first, the one I started coding yesterday, is an implementation of the Nelder-Mead algorithm for finding minimums. The robot wanders around the floor of Orbit (x,y coordinates) and surveys the signal strength using iwconfig. Based on the input it receives from iwconfig it attempts to move to the point of greatest wifi connection. At each point it surveys, the robot speaks the signal strength, a task accomplished by feeding the output to ''flite''. The algorithm may not be quite appropriate because of the random fluctuations in connectivity; if the robot gets a burst of strong connectivity that is due solely to natural variations it will remember that point forever. One solution might be to program the robot to 'forget' good points after a few subsequent scannings. |
| 39 | |
| 40 | The second performs a related task. It wanders aimlessly around the room, recording the signal strength from iwconfig at regular intervals. The real accomplishment here was making two tasks (wandering and surveying signal strength) occuring simultaneously. The first step is to turn a python function into an ERSP recognized task. The important python command to do so is: |
| 41 | {{{ |
| 42 | someTask = ersp.task.registerTask("idstring", function_name) |
| 43 | }}} |
| 44 | The purpose of "idstring" is elusive, but as long as it's a string the software seems to accept it. Once this assignment is completed, someTask can be passed as an argument in to a parallel object:\ |
| 45 | {{{ |
| 46 | p = ersp.task.Parallel() |
| 47 | p.addTask(someTask) |
| 48 | }}} |
| 49 | |
| 50 | We've been issued a challenge. A week from today there is to be a race. One of the nodes in Orbit will become an access point, and each robot will attempt a time-trial to locate the node as quickly as possible. Robot #1 will probably use the Nelder-Mead script completed today, but we have flexibility regarding the algorithm for the other two. |
| 51 | |
| 52 | Another short term goal: have object-avoidance behavior run in the background while we are running our own python scripts. In general, the python MoveTo commands have timeout values, so if the robot is trying to reach an unreachable location (ie, inside a pillar) it should give up after n seconds. This will affect our scanning algorithms. |