Week 10: New obstacle configuration and Improving the Path Finding Algorithm based on Verilog Simulation
May 7, 2024
Welcome back, everyone! Last week, I debugged one of the bugs in my algorithm. I continued creating different maps of obstacle positions and start and destination locations. I added the obstacle at location (column #, row #): (1,4) and (2,4). So, the overall obstacle positions were at (3,1), (4,1), (1,2), (2,2), (1,3), (2,3), (1,4), (2,4), (3,4), (4,4). I changed my start location to (0,2) and kept my destination location as (5,3).
The starting location, initialized at (0,2), represents the system’s initial state, while the destination coordinates, at (5,3), represent the desired final state. The state machine implementing the path-finding algorithm compares destination column 5 with starting location column 0. Since the destination column is more than the starting column and the next column position is occupied by the obstacle (1,2) based on the grid map, the state machine could not move into a column incrementing state. Instead, due to an obstacle in the following column location, the state machine moved to a state where the start row is compared to the destination row. Since the start row is 2 and the destination row is 3, the state machine moved to a state where the row is incremented. Then, the state machine compared the current row 3 to destination row 3 and realized it reached the destination row. However, the current column 0 still does not equal destination column 5, so the state machine moved to a state where the column can be incremented. Still, again, the location (1,3) has an obstacle. This is a critical scenario because the state machine arrived at the destination row but not the destination column. It cannot move to a state where it could increment the column because an obstacle is located at (1,3). So, the state machine goes to an exception-handling state where it increments a row even though it already reached the destination row. In the current location (0,3), the state machine still cannot move to a column incrementing state because even the following location (1,3) is also an obstacle. So, the state machine remains in an exception handling state and increments the row to 4. The current location is (0,4). Then, the state machine looks at the destination row and cannot decrease the row because the robot has already visited the previous row. So, now the state machine compares the destination column 5 with current column 0 and tries to increment the column, and the next column location (1,4) does not have an obstacle, and hence, the state machine goes to a state where it increments the column. The current location is (1,4). Then, the state machine again compares the current column 1 to destination column 5 and checks if the following column location (2,4) does not have an obstacle, and since it does not have an obstacle, the state machine increments to column 2. Then, the state machine still compares current column 2 with destination column 5; it checks if the following column location (3,4) has an obstacle, and since it has an obstacle. So, the state machine can’t increment the column, nor can it decrement the row to go to the destination row. So, it again goes to the exception handling state, increments the row to 5, and goes to (2,5). Then, the state machine compares the current column 2 with destination column 5 and checks if the following column location (3,5) has an obstacle. Since there is no obstacle at (3,5), the state machine increments the column and goes to (3,5). Then, the state machine compares the current column 3 with the destination column 5 and checks if the next column position (4,5) has an obstacle. Since no obstacle exists at (4,5), the state machine increments the column to 4 and goes to location (4,5). Then, the state machine compares the current column 4 with destination column 5 and checks if the following column location (5,5) has an obstacle. Since there is no obstacle at (5,5), the state machine increments the column to 5 and goes to location (5,5). Since the state machine has already reached the destination column, it now compares the current row 5 with destination row 3 and checks if the following row location (5,4) has an obstacle. Since no obstacle exists at (5,4), the row is decremented to 4 and moves to the (5,4) location. Then, the state machine again compares the destination row 3 with current row 4, decrements the row to 3, and moves to (5,3), the destination location.
In my next blog, I will delve into the synthesis of the RTL Verilog code I’ve written, discussing the challenges I’ve encountered and how I’ve resolved them.
Leave a Reply
You must be logged in to post a comment.