Technical Documentation: Navigation Screen
The Navigation Screen is the most complex component, integrating the MapView widget with ROS 2 Action Servers and navigation stacks.


Architecture
The Navigation module serves as the primary coordination layer between the user interface and the Nav2 (Navigation 2) stack running on the robot.
- File Path: lib/screens/navigation_screen.dart
- ROS Topics:
- /map: Receives static environment data.
- /goal_pose: Publishes the destination coordinate.
- /initialpose: Publishes manual localization corrections.
- /plan: Subscribes to the Nav2 global path.
- /local_plan: Subscribes to local trajectory updates.
Interaction Logic
Map Tapping & Coordinate Transformation
The onTap logic converts screen coordinates (Pixels) into Map coordinates (Meters) using the map.info.resolution and map.info.origin.




Initial Pose Tools (Manual Localization)
Manual localization is performed via the /initialpose topic. The UI triggers a set of tools to publish the estimated coordinate and orientation.




Sidebar & System Integration
Map Loading
The Navigation screen integrates with the CustomSidebar to allow real-time map switching. When a map is selected, the UI triggers a ROS-level map load service.




Device Trigger Interactions
Users can initiate direct device commands (triggers) which are passed through to the ROS backend for low-level hardware interaction.


State Management & Pose Persistence
The system tracks the robot's current pose by subscribing to the tf (Transform Tree) map -> base_link transform.




Safety Systems
- Auto-Stop: Listens to the /estop topic; if triggered, the Navigation Screen visually locks and displays a critical warning overlay.