# Indoor Navigation with Ultra‑Wideband Iiwari Technology, 5G and AI - Part 2 of 2 - Savonia AMK

> Mobile Robot Indoor Navigation with Ultra‑Wideband (UWB) Technology, technical view of the components and data flows.

## Technical Architecture and Data Sources
This section details the system architecture from UWB tags to trajectory generation. The robot used is a Clearpath Dingo‑D platform running ROS Noetic and a custom Python navigation node developed by Md Al‑Naim. The key data sources are:

*   **Front and back Iiwari UWB tags:** Provide Kalman-filtered x, y positions at 10 Hz via the Iiwari cloud API, with typical noise around ±20 cm.
*   **Filtered odometry from ROS:** Provides the robot’s heading (yaw) based on wheel odometry and IMU.
*   **Floorplan image:** A high‑resolution map of the environment, converted into a 1‑metre grid for path planning.

The navigation script uses a `DualTagPoseEstimator` module to fuse the front and rear UWB tag positions with the robot’s filtered odometry to produce a stable estimate of (x, y, heading). Additionally, a lightweight extended Kalman filter is used to further stabilise the pose estimate before it is passed to the controller.

## Navigation and Path Planning
A background thread polls the Iiwari API, updates the current pose, and queries all Points of Interest (POIs) from Iiwari. These are ordered using a nearest‑neighbour heuristic to plan a multi‑stop route.

*   **Pathfinding:** Each leg is planned on a floorplan grid using an 8‑connected A* algorithm.
*   **Smoothing:** Raw A* output is processed via a randomised pruning step to remove unnecessary waypoints, followed by a Catmull–Rom-style spline fit using SciPy to generate a smooth trajectory.
*   **Re-planning:** If the robot deviates more than 2.5 metres from the path, the system triggers online re-planning for the current leg.

## AI Obstacle Detection and 5G Integration
The AI obstacle detection model, developed by Premton Canamusa (5G:llä vauhtia digitalisaatioon – Pohjois-Savon liitto, REACT-EU EAKR: A77467), runs on a server connected via Nokia 5G. When an obstacle is detected, the model sends a pause command through a TCP interface. The use of 5G provides low-latency control, which was found to be significantly more responsive than Wi-Fi.

## Motion Control
The motion is managed by a customised Pure‑Pursuit controller. Key features include:

*   **Look-ahead distance:** Reduced near the goal for precise docking.
*   **Docking profile:** A three-stage profile (2.0 m, 1.0 m, and 0.5 m) that gradually lowers speed and tightens turning rates.
*   **Alignment:** The robot performs an initial rotation to align with the first path segment before driving.

**Control Cycle Example:**
```python
cmd, target_point = self.controller.twist(
path=current_path,
pos=(x, y),
yaw=yaw
)
self.cmd_pub.publish(cmd)
```
Linear speed is capped at 0.35 m/s and angular speed at 0.9 rad/s.

## Conclusion
This project demonstrates that Ultra-Wideband positioning serves as a reliable foundation for indoor robot navigation, particularly where LiDAR-based SLAM is difficult to maintain. By combining Iiwari UWB localisation, lightweight path planning, Pure-Pursuit control, and 5G-connected AI, the navigation pipeline remains robust, compact, and suitable for research and teaching.

## Project Credits and Information
*   **Authors:** Md Al-Naim (md.al-naim@savonia.fi), Asmo Jakorinne (asmo.jakorinne@savonia.fi)
*   **Supervised by:** Premton Canamusa (Savonia UAS), Asmo Jakorinne (Savonia UAS), and Teemu Lätti (Iiwari Tracking Solutions)
*   **Developed by:** Md Al-Naim (Savonia DigiCenter North Savo)
*   **Robot Platform:** Clearpath Dingo-D
*   **Location:** Savonia UAS DigiCenter North Savo
*   **Project:** Automaatio- ja Tekoäly Tiedoksi -hanke (AuToTIE), Pohjois-Savon Liitto, EAKR

## References
*   '5G:llä vauhtia digitalisaatioon’, Pohjois-Savon liitto, REACT-EU EAKR: A77467.