|
| 1 | +.. _design: |
| 2 | + |
| 3 | +Core Design and Architecture |
| 4 | +############################ |
| 5 | + |
| 6 | +EasyNav is designed around **modularity**, **real-time performance**, and **extensibility**. Its architecture separates concerns clearly, making it both easy to adapt and efficient to run. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +.. figure:: ../images/easynav_simple_design.png |
| 11 | + :align: center |
| 12 | + :width: 90% |
| 13 | + :alt: EasyNav Core Design |
| 14 | + |
| 15 | + Figure: Core architecture of EasyNav. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +.. figure:: ../images/easynav_cycle.png |
| 20 | + :align: center |
| 21 | + :width: 90% |
| 22 | + :alt: EasyNav Cycles view |
| 23 | + |
| 24 | + Figure: Ral-Time and no real-Time cycle accesing to the NavState. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +.. figure:: ../images/easynav_design.png |
| 29 | + :align: center |
| 30 | + :width: 90% |
| 31 | + :alt: EasyNav Core Design |
| 32 | + |
| 33 | + Figure: Core architecture of EasyNav with real-time and non-real-time flows. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +.. figure:: ../images/easynav_cycle.png |
| 38 | + :align: center |
| 39 | + :width: 90% |
| 40 | + :alt: EasyNav Cycles view |
| 41 | + |
| 42 | + Figure: Ral-Time and no real-Time cycle accesing to the NavState. |
| 43 | + |
| 44 | + |
| 45 | +Main Concepts |
| 46 | +************* |
| 47 | + |
| 48 | +At the heart of EasyNav lies a **EasyNav Node**, responsible for orchestrating the entire navigation process. It coordinates multiple subordinate nodes and delegates the actual implementation of functionality to plugins. |
| 49 | + |
| 50 | +These subordinate modules include: |
| 51 | + |
| 52 | +- **Sensor Manager**: Acquires and integrates raw sensor data into the system. |
| 53 | +- **Maps Manager**: Maintains maps. |
| 54 | +- **Localizer**: Estimates the robot pose. |
| 55 | +- **Planner**: Generates global paths. |
| 56 | +- **Controller**: Translates paths into velocity commands. |
| 57 | + |
| 58 | +Each of these (except the Sensor Manager) is implemented as a **plugin** and loaded dynamically based on the configuration file. This enables the user to choose or create alternative implementations as needed. |
| 59 | + |
| 60 | +NavState |
| 61 | +******** |
| 62 | + |
| 63 | +All modules operate over a central data structure called **NavState**, which contains the current state of the system: |
| 64 | + |
| 65 | +- Sensor perceptions |
| 66 | +- Robot pose |
| 67 | +- Dynamic and static maps |
| 68 | +- Planned path |
| 69 | +- Velocity commands |
| 70 | + |
| 71 | +Each plugin reads from the NavState **in read-only mode**. Only the main node is allowed to update it. This guarantees data consistency and avoids race conditions during concurrent execution. |
| 72 | + |
| 73 | +Execution Model |
| 74 | +*************** |
| 75 | + |
| 76 | +The execution model is built around two parallel loops: |
| 77 | + |
| 78 | +- **Real-time loop (RT)**: High-frequency operations, typically 10–100 Hz. Prioritizes minimal latency. |
| 79 | +- **Non-real-time loop (NRT)**: Lower-frequency operations for background or heavy processing tasks. |
| 80 | + |
| 81 | +Each plugin specifies its desired execution frequencies for both loops. If invoked prematurely, it simply returns, ensuring no over-execution or priority inversion occurs. |
| 82 | + |
| 83 | +Unlike typical ROS 2 systems, EasyNav **avoids using ROS timers** for execution. Instead, the main node directly calls each plugin, improving determinism and lowering latency. |
| 84 | + |
| 85 | +In the RT loop, a plugin can **propagate an execution trigger** to the next module when new data is available. For example, when the maps manager updates a dynamic map, it can immediately notify the localizer to react, followed by the planner and controller. This reduces total response time from perception to action. |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +Plugin Types |
| 90 | +************ |
| 91 | + |
| 92 | +Each subordinate module loads one or more plugins. These are implemented as classes derived from a common interface and declared via ROS 2 pluginlib. |
| 93 | + |
| 94 | +The most common plugin types are: |
| 95 | + |
| 96 | +- `MapsManagerMethodBase` |
| 97 | +- `LocalizerMethodBase` |
| 98 | +- `PlannerMethodBase` |
| 99 | +- `ControllerMethodBase` |
| 100 | + |
| 101 | +Each plugin must implement: |
| 102 | + |
| 103 | +- `internal_update_rt()` – for fast real-time updates |
| 104 | +- `internal_update()` – for slower, background updates |
| 105 | +- Configuration parameters for frequency, QoS, and logic |
| 106 | + |
| 107 | +Refer to the source code or stack-specific documentation for implementation details. |
| 108 | + |
| 109 | +Summary |
| 110 | +******* |
| 111 | + |
| 112 | +The EasyNav core: |
| 113 | + |
| 114 | +- Offers a **minimal and efficient** architecture for robot navigation. |
| 115 | +- Enables **runtime modularity** through plugins. |
| 116 | +- Is optimized for **real-time response** and **deterministic execution**. |
| 117 | +- Provides a unified access point to all navigation data via `NavState`. |
| 118 | + |
| 119 | +For details on each plugin type and examples, see the :ref:`stacks <stacks>` section. |
| 120 | + |
0 commit comments