Here’s what ‘H’ does detecting an obstacles within one meter:
Now it’s time to get her to move around the obstacle and continue to her destination. All sensors are installed and working; this is pure code in the autopilot process*.
Here’s the general idea for how the code should work for full maze exploration:
- Takeoff, then…
- record current GPS location in map dictionary, including previous location (i.e index “here I am” : content “here I came from” in units of meters held in a python dictionary
- do Sweep 360° scan for obstacles
- find next direction based on the current map contents either…
- unexplored unobstructed direction (beyond 2m) biased towards the target GPS point (e.g. the centre of the maze)
- previously visited location marking the current location in the map dictionary as blocked to avoid further return visits
- head off on the new direction until
- obstacle found in the new direction
- unexplored direction (i.e not in the map so far) found
And in fact, this same set of rules are required for just avoiding obstacles, which is good, as I doubt I’ll ever be able to find / build a suitably sized maze, and if I did, the LiPo will run out long before the centre of the maze is reached.
* The fact it’s pure code means it’s going to be quiet on the blogging front apart from GPS tracking videos when the weather warms up. I’m also considering building a new version of Hermione from the spares I have in stock, provisionally called “Penelope”. She’s there for shows only; I can then use Hermione purely for testing new features without worrying about breaking her prior to an event.