Maze Solver in ROS

Objective

This was a 12 week long project with main focus industry level project management lifecycle for embedded software development while making a 'turtle' solve mazes in a ROS environment. We started off by noting key requirements of the project followed by coming up with algorithms and flowcharts even before writing a single line of code. There were weekly peer reviews for the design documents and code. Finally we wrote unite tests to get full code coverage and tested our algorithm on various previously unseen mazes.

High Level Requirements

PR-1. General Requirements.
PR-1a. The turtle shall not move more than one adjacent square per call to tick.
PR-1b. The turtle shall rotate at most 90 degrees per tick.
PR-1c. The turtle shall only move in the direction it is facing.
PR-1d. The turtle shall be facing the potential wall segment that it is calling bumped for.
PR-1e. The turtle shall make at most one call to bumped per tick.
PR-1f. The turtle shall not move through walls.
PR-1g. The turtle shall stop when goal is reached.

PR-2. Scanning mode.
PR-2a. Turtle shall rotate LEFT for four times
PR-2b At each orientation, turtle shall check if wall is present in front of it.
PR-2c. Turtle shall save presence of wall for corresponding orientation.
PR-2d.Turtle shall not leave its square.

PR-3. Move mode.
PR-3a. Turtle shall compute the direction with minimum number of visits.
PR-3b. Turtle shall rotate RIGHT till its orientation matches the chosen direction.
PR-3c. Turtle shall move one unit in the computed direction.
PR-3d. Turtle shall update number of visits for the new square.

PR-4. Changing modes.
PR-4a. Turtle shall start with scanning mode.
PR-4b. Turtle shall then perform move mode.
PR-4c. Toggle between the scanning and move till goal is reached.


Sequence Diagrams

Sequence Diagram Traceability with Requirements

State Charts

State chart traceability with requirements

Peer Review

Week 5 - Sequence Diagrams and State Charts

Week 8 - Preliminary C code review

Maze Solver

Few of the mazes solved by the 'turtle'. The number in each square denotes the number of times the 'turtle' crossed that particular position. Red cross is the starting position while the green cross is the goal.

Conclusion

It was very straight forward to implement the actual code as most of the things had been cleared out before implementation. I felt confident to showcase my algorithm as there was almost 100% code covergae with unit tests. It was easy to add and remove features as all dependancies were captured with traceabilty matrix. My experience of following this methodology proved to be less frustrating resulting in more efficient and robust project execution.Â