# memristor/mep3 architecture

> Architecture diagram of the GitHub repository memristor/mep3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/memristor/mep3
- Repository: https://github.com/memristor/mep3

## Overview

MEP3 is a ROS 2 Eurobot robot platform with behavior-tree strategy execution, navigation, localization, controllers, hardware drivers, and a Webots simulation option. Its principal workflow is to launch a physical robot or simulation, execute behavior-tree tasks and navigation, then translate commands through controllers and hardware interfaces to the robot. Separate sensor, motion, and actuator firmware provide embedded board functions. The source excerpts support the behavior-tree registrations and selected controller and firmware calls; several subsystem links are documented only by the README or remain unverified.

Main entry points: [`mep3_bringup/launch/simulation_launch.py`](https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/simulation_launch.py) (Simulation bringup), [`mep3_hardware/launch/hardware_launch.py`](https://github.com/memristor/mep3/blob/main/mep3_hardware/launch/hardware_launch.py) (Hardware launch), [`mep3_bringup/launch/robot_launch.py`](https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/robot_launch.py) (Robot bringup), [`mep3_behavior/src/mep3_behavior_tree.cpp`](https://github.com/memristor/mep3/blob/main/mep3_behavior/src/mep3_behavior_tree.cpp) (Behavior tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Robot orchestration"]
  node_physical_launch["Robot bringup<br/>[robot_launch.py]"]
  node_sim_launch["Simulation bringup"]
  node_launch_utils["Launch utilities<br/>[launch_utils.py]"]
end

subgraph group_behavior_nav["Behavior and navigation"]
  node_behavior_tree["Behavior tree"]
  node_bt_actions["Behavior actions"]
  node_bt_action_base["ROS action adapter<br/>[bt_action_node.hpp]"]
  node_navigation["Navigation actions"]
  node_pursuit_controller["Pursuit controller"]
  node_obstacle_layers["Obstacle layers"]
end

subgraph group_control_io["Control and hardware"]
  node_hardware_launch["Hardware launch<br/>[hardware_launch.py]"]
  node_motion_interface["Motion interface"]
  node_dynamixel["Dynamixel driver"]
  node_can_gpio["CAN GPIO interface"]
  node_socketcan["SocketCAN bridge"]
  node_joint_controller["Joint controller"]
  node_pump_controller["Pump controller"]
end

subgraph group_simulation_localization["Simulation and localization"]
  node_localization["ArUco localization<br/>[aruco_detector.py]"]
  node_webots["Webots interface"]
end

subgraph group_embedded["Embedded firmware"]
  node_sensor_firmware["Sensor board<br/>[main.c]"]
  node_motion_firmware["Motion board<br/>[main.c]"]
  node_motor_control["Motor control<br/>[control.c]"]
  node_motor_driver["Motor driver<br/>[motor.h]"]
  node_actuator_firmware["Actuator board<br/>[main.c]"]
end

node_operator(("Operator"))

node_operator -->|"launches robot"| node_physical_launch
node_operator -->|"launches simulation"| node_sim_launch
node_physical_launch -->|"uses"| node_launch_utils
node_sim_launch -->|"uses"| node_launch_utils
node_behavior_tree -->|"registers actions"| node_bt_actions
node_behavior_tree -->|"uses adapter"| node_bt_action_base
node_bt_action_base -.->|"sends actions"| node_navigation
node_navigation -.->|"requests velocity"| node_pursuit_controller
node_physical_launch -.->|"starts hardware"| node_hardware_launch
node_hardware_launch -.->|"configures"| node_motion_interface
node_motion_interface -.->|"uses bridge"| node_socketcan
node_hardware_launch -.->|"configures"| node_dynamixel
node_hardware_launch -.->|"configures"| node_can_gpio
node_joint_controller -.->|"commands hardware"| node_dynamixel
node_pump_controller -.->|"commands hardware"| node_can_gpio
node_sim_launch -.->|"starts simulation"| node_webots
node_sim_launch -.->|"starts localization"| node_localization
node_motion_firmware -->|"initializes"| node_motor_control
node_motion_firmware -->|"initializes"| node_motor_driver
node_sensor_firmware -.->|"sends CAN commands"| node_actuator_firmware

click node_physical_launch "https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/robot_launch.py"
click node_sim_launch "https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/simulation_launch.py"
click node_launch_utils "https://github.com/memristor/mep3/blob/main/mep3_bringup/mep3_bringup/launch_utils.py"
click node_behavior_tree "https://github.com/memristor/mep3/blob/main/mep3_behavior/src/mep3_behavior_tree.cpp"
click node_bt_actions "https://github.com/memristor/mep3/tree/main/mep3_behavior/include/mep3_behavior"
click node_bt_action_base "https://github.com/memristor/mep3/blob/main/mep3_behavior/include/mep3_behavior/bt_action_node.hpp"
click node_navigation "https://github.com/memristor/mep3/tree/main/mep3_navigation/src/move"
click node_pursuit_controller "https://github.com/memristor/mep3/blob/main/mep3_navigation/src/regulated_pure_pursuit_controller/regulated_pure_pursuit_controller.cpp"
click node_obstacle_layers "https://github.com/memristor/mep3/tree/main/mep3_navigation/src/temporal_obstacle_layer"
click node_localization "https://github.com/memristor/mep3/blob/main/mep3_localization/mep3_localization/aruco_detector.py"
click node_hardware_launch "https://github.com/memristor/mep3/blob/main/mep3_hardware/launch/hardware_launch.py"
click node_motion_interface "https://github.com/memristor/mep3/blob/main/mep3_hardware/src/motion_hardware_interface/motion_hardware_interface.cpp"
click node_dynamixel "https://github.com/memristor/mep3/blob/main/mep3_hardware/src/dynamixel_hardware_interface/dynamixel_hardware.cpp"
click node_can_gpio "https://github.com/memristor/mep3/blob/main/mep3_hardware/src/can_gpio_hardware_interface/can_gpio_hardware_interface.cpp"
click node_socketcan "https://github.com/memristor/mep3/blob/main/mep3_hardware/src/socketcan_bridge.cpp"
click node_joint_controller "https://github.com/memristor/mep3/blob/main/mep3_controllers/src/joint_position_controller.cpp"
click node_pump_controller "https://github.com/memristor/mep3/blob/main/mep3_controllers/src/pump_controller.cpp"
click node_webots "https://github.com/memristor/mep3/blob/main/mep3_simulation/src/mep3_webots_hardware_interface.cpp"
click node_sensor_firmware "https://github.com/memristor/mep3/blob/main/firmware/sensor_board/src/main.c"
click node_motion_firmware "https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/main.c"
click node_motor_control "https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/control.c"
click node_motor_driver "https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/motor.h"
click node_actuator_firmware "https://github.com/memristor/mep3/blob/main/firmware/actuator_board/ActuatorBoardV3.0/src/main.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_physical_launch,node_sim_launch,node_launch_utils toneBlue
class node_behavior_tree,node_bt_actions,node_bt_action_base,node_navigation,node_pursuit_controller,node_obstacle_layers toneAmber
class node_hardware_launch,node_motion_interface,node_dynamixel,node_can_gpio,node_socketcan,node_joint_controller,node_pump_controller toneMint
class node_localization,node_webots toneRose
class node_sensor_firmware,node_motion_firmware,node_motor_control,node_motor_driver,node_actuator_firmware,node_operator toneIndigo
```

## Components

### Robot orchestration

- [Robot bringup](https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/robot_launch.py): `mep3_bringup/launch/robot_launch.py`
- [Simulation bringup](https://github.com/memristor/mep3/blob/main/mep3_bringup/launch/simulation_launch.py): `mep3_bringup/launch/simulation_launch.py`
- [Launch utilities](https://github.com/memristor/mep3/blob/main/mep3_bringup/mep3_bringup/launch_utils.py): `mep3_bringup/mep3_bringup/launch_utils.py`

### Behavior and navigation

- [Behavior tree](https://github.com/memristor/mep3/blob/main/mep3_behavior/src/mep3_behavior_tree.cpp): `mep3_behavior/src/mep3_behavior_tree.cpp`
- [Behavior actions](https://github.com/memristor/mep3/tree/main/mep3_behavior/include/mep3_behavior): `mep3_behavior/include/mep3_behavior`
- [ROS action adapter](https://github.com/memristor/mep3/blob/main/mep3_behavior/include/mep3_behavior/bt_action_node.hpp): `mep3_behavior/include/mep3_behavior/bt_action_node.hpp`
- [Navigation actions](https://github.com/memristor/mep3/tree/main/mep3_navigation/src/move): `mep3_navigation/src/move`
- [Pursuit controller](https://github.com/memristor/mep3/blob/main/mep3_navigation/src/regulated_pure_pursuit_controller/regulated_pure_pursuit_controller.cpp): `mep3_navigation/src/regulated_pure_pursuit_controller/regulated_pure_pursuit_controller.cpp`
- [Obstacle layers](https://github.com/memristor/mep3/tree/main/mep3_navigation/src/temporal_obstacle_layer): `mep3_navigation/src/temporal_obstacle_layer`

### Control and hardware

- [Hardware launch](https://github.com/memristor/mep3/blob/main/mep3_hardware/launch/hardware_launch.py): `mep3_hardware/launch/hardware_launch.py`
- [Motion interface](https://github.com/memristor/mep3/blob/main/mep3_hardware/src/motion_hardware_interface/motion_hardware_interface.cpp): `mep3_hardware/src/motion_hardware_interface/motion_hardware_interface.cpp`
- [Dynamixel driver](https://github.com/memristor/mep3/blob/main/mep3_hardware/src/dynamixel_hardware_interface/dynamixel_hardware.cpp): `mep3_hardware/src/dynamixel_hardware_interface/dynamixel_hardware.cpp`
- [CAN GPIO interface](https://github.com/memristor/mep3/blob/main/mep3_hardware/src/can_gpio_hardware_interface/can_gpio_hardware_interface.cpp): `mep3_hardware/src/can_gpio_hardware_interface/can_gpio_hardware_interface.cpp`
- [SocketCAN bridge](https://github.com/memristor/mep3/blob/main/mep3_hardware/src/socketcan_bridge.cpp): `mep3_hardware/src/socketcan_bridge.cpp`
- [Joint controller](https://github.com/memristor/mep3/blob/main/mep3_controllers/src/joint_position_controller.cpp): `mep3_controllers/src/joint_position_controller.cpp`
- [Pump controller](https://github.com/memristor/mep3/blob/main/mep3_controllers/src/pump_controller.cpp): `mep3_controllers/src/pump_controller.cpp`

### Simulation and localization

- [ArUco localization](https://github.com/memristor/mep3/blob/main/mep3_localization/mep3_localization/aruco_detector.py): `mep3_localization/mep3_localization/aruco_detector.py`
- [Webots interface](https://github.com/memristor/mep3/blob/main/mep3_simulation/src/mep3_webots_hardware_interface.cpp): `mep3_simulation/src/mep3_webots_hardware_interface.cpp`

### Embedded firmware

- [Sensor board](https://github.com/memristor/mep3/blob/main/firmware/sensor_board/src/main.c): `firmware/sensor_board/src/main.c`
- [Motion board](https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/main.c): `firmware/motion_board/firmware/src/main.c`
- [Motor control](https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/control.c): `firmware/motion_board/firmware/src/control.c`
- [Motor driver](https://github.com/memristor/mep3/blob/main/firmware/motion_board/firmware/src/motor.h): `firmware/motion_board/firmware/src/motor.h`
- [Actuator board](https://github.com/memristor/mep3/blob/main/firmware/actuator_board/ActuatorBoardV3.0/src/main.c): `firmware/actuator_board/ActuatorBoardV3.0/src/main.c`

### Other components

- **Operator**

## Connections

- Operator → Robot bringup: launches robot
- Operator → Simulation bringup: launches simulation
- Robot bringup → Launch utilities: uses (evidence: `mep3_bringup/mep3_bringup/launch_utils.py`)
- Simulation bringup → Launch utilities: uses
- Behavior tree → Behavior actions: registers actions (evidence: `mep3_behavior/src/mep3_behavior_tree.cpp`)
- Behavior tree → ROS action adapter: uses adapter (evidence: `mep3_behavior/src/mep3_behavior_tree.cpp`)
- ROS action adapter → Navigation actions: sends actions
- Navigation actions → Pursuit controller: requests velocity
- Robot bringup → Hardware launch: starts hardware
- Hardware launch → Motion interface: configures
- Motion interface → SocketCAN bridge: uses bridge
- Hardware launch → Dynamixel driver: configures
- Hardware launch → CAN GPIO interface: configures
- Joint controller → Dynamixel driver: commands hardware
- Pump controller → CAN GPIO interface: commands hardware
- Simulation bringup → Webots interface: starts simulation
- Simulation bringup → ArUco localization: starts localization
- Motion board → Motor control: initializes (evidence: `firmware/motion_board/firmware/src/main.c`)
- Motion board → Motor driver: initializes (evidence: `firmware/motion_board/firmware/src/main.c`)
- Sensor board → Actuator board: sends CAN commands
