| ||||||||||||||||||||||
Phase 2: Add Obstacle AvoidanceAugment Phase1 to navigate around obstacles and continue CPP. This aims to give full coverage. Here are the Phase 2 aims:
A few notes on map representationThere are several different representations we can use for maps. I am going to use Cartesian co-ordinates throughout which is conceptually easy to understand. This means x=left, y=up, just like a normal graph. However, pyhon stores arrays in a different format, compasses use a different frame of reference and matplotlib can also display this data differently. This caused some confusion so I will spell out the differences here:
Created an A* (A-star) package in the same lib tree structure. Here is some pseudocode of the approach taken:
Here is a plot testing A-star only![]() This example gives a starting postion and end position (x,y cartesian co-ordinates) with obstacles in the way. The A-star algorithm successfully works around them. Here is a plot testing a hybrid (CPP/A-star) solution![]() The CPP algorithm is the default but when an obstacle is encountered, it falls back to a-star to go around it before continuing with CPP. All free squares are covered with no incursion into the blocked obstacles. This is the algorithm I will use to control the robot. It uses a function "is_obstacle_detected()" which checks the map for obstacles. This can be augmented later with sensor detection. i.e: if map_obstacle_detected or sensor_obstacle_detected: return True return False Transferred to kupePi ok. May 2026 | ||||||||||||||||||||||
| ||||||||||||||||||||||