This project is a Python-based simulation that demonstrates an autonomous navigation system using a Finite State Machine (FSM). The agent navigates a grid environment, intelligently handling obstacles, intersections, and destination detection.
-
Finite State Machine Logic:
- States include:
Start
,Stop
,Slow Down
,Forward
,Turn
,Avoid Obstacle
, andStop-End Trip
. - Dynamic state transitions based on environmental inputs.
- States include:
-
Obstacle Detection and Avoidance:
- Simulated LiDAR sensors detect obstacles within the grid.
- The agent recalculates its path to avoid collisions.
-
Grid Navigation:
- Agent starts at a predefined location and navigates toward a destination in a 10x10 grid.
-
Randomized Environment:
- Obstacle positions and GPS commands are randomly generated to simulate real-world unpredictability.
-
Initialize Environment:
- The grid environment is set up with random obstacle placements.
- The agent is initialized at a starting point with a target destination.
-
State Transition Logic:
- The FSM transitions between states based on:
- Obstacle proximity.
- Reaching the destination.
- GPS commands for turning.
- The FSM transitions between states based on:
-
Simulation Steps:
- Each step updates the agent’s position, checks for obstacles, and determines the next state.
-
End of Simulation:
- The simulation terminates when the agent reaches the destination or a maximum step limit is reached.