# s7nique/xmc7100-car architecture

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

- Interactive diagram: https://gitdiagram.com/s7nique/xmc7100-car
- Repository: https://github.com/s7nique/xmc7100-car

## Overview

This is XMC7100 warehouse-rover firmware paired with an RDK X3 ROS 2 navigation side. The main workflow receives UART wheel-speed commands, parses them, runs periodic closed-loop motor control, and reports wheel, IMU, and status frames. README-documented RDK capabilities include lidar, SLAM, navigation, and map saving; the tree exposes only one RDK bridge script, so those broader capabilities are represented at their enclosing directory. Several firmware relationships rely on the SOURCE INDEX; unsampled RDK internals are not inferred.

Main entry points: [`originbot_platform.c`](https://github.com/s7nique/xmc7100-car/blob/main/originbot_platform.c) (Platform services), [`main.c`](https://github.com/s7nique/xmc7100-car/blob/main/main.c) (Main scheduler), [`app_motion_control.c`](https://github.com/s7nique/xmc7100-car/blob/main/app_motion_control.c) (Wheel control), [`Con_uart.c`](https://github.com/s7nique/xmc7100-car/blob/main/Con_uart.c) (UART DMA transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Firmware runtime"]
  node_main["Main scheduler<br/>[main.c]"]
  node_uart["UART DMA transport<br/>[Con_uart.c]"]
  node_protocol["Command parser<br/>[protocol.c]"]
end

subgraph group_motion["Motion control"]
  node_motion["Wheel control"]
  node_pid["Wheel PID<br/>[pid.c]"]
end

subgraph group_sensing["Sensing and status"]
  node_imu["QMI8658 driver<br/>[imu.c]"]
end

subgraph group_board["Board support"]
  node_platform["Platform services"]
  node_board_setup["Board configuration"]
end

subgraph group_rdk["RDK navigation"]
  node_odom_bridge["Odometry bridge"]
  node_nav_tools["Lidar and navigation"]
end

node_rdk_host(("RDK X3"))
node_wheel_hardware["Motors and encoders"]
node_imu_sensor["QMI8658 sensor"]
node_ros["ROS 2 navigation"]

node_rdk_host -->|"sends commands"| node_uart
node_main -->|"initializes"| node_platform
node_main -->|"dispatches commands"| node_protocol
node_main -->|"services receive"| node_uart
node_main -->|"runs control"| node_motion
node_protocol -->|"sets wheel targets"| node_motion
node_protocol -->|"uses platform services"| node_platform
node_motion -->|"uses PID"| node_pid
node_platform -->|"uses board peripherals"| node_board_setup
node_platform -->|"uses IMU driver"| node_imu
node_imu -.->|"reads sensor"| node_imu_sensor
node_motion -.->|"drives and reads"| node_wheel_hardware
node_platform -->|"sends status frames"| node_uart
node_uart -->|"returns telemetry"| node_rdk_host
node_rdk_host -.->|"runs bridge"| node_odom_bridge
node_odom_bridge -.->|"bridges odometry"| node_ros
node_rdk_host -->|"runs lidar and navigation"| node_nav_tools
node_nav_tools -->|"supports SLAM and Nav2"| node_ros

click node_main "https://github.com/s7nique/xmc7100-car/blob/main/main.c"
click node_uart "https://github.com/s7nique/xmc7100-car/blob/main/Con_uart.c"
click node_protocol "https://github.com/s7nique/xmc7100-car/blob/main/protocol.c"
click node_platform "https://github.com/s7nique/xmc7100-car/blob/main/originbot_platform.c"
click node_board_setup "https://github.com/s7nique/xmc7100-car/tree/main/bsps/TARGET_APP_KIT_XMC71_EVK_LITE_V1"
click node_motion "https://github.com/s7nique/xmc7100-car/blob/main/app_motion_control.c"
click node_pid "https://github.com/s7nique/xmc7100-car/blob/main/pid.c"
click node_imu "https://github.com/s7nique/xmc7100-car/blob/main/imu.c"
click node_odom_bridge "https://github.com/s7nique/xmc7100-car/blob/main/rdk_nav_setup/xmc7100_base_odom_bridge.py"
click node_nav_tools "https://github.com/s7nique/xmc7100-car/tree/main/rdk_nav_setup"

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_main,node_uart,node_protocol toneBlue
class node_motion,node_pid toneAmber
class node_imu toneMint
class node_platform,node_board_setup toneRose
class node_odom_bridge,node_nav_tools,node_rdk_host,node_wheel_hardware,node_imu_sensor,node_ros toneIndigo
```

## Components

### Firmware runtime

- [Main scheduler](https://github.com/s7nique/xmc7100-car/blob/main/main.c): `main.c`
- [UART DMA transport](https://github.com/s7nique/xmc7100-car/blob/main/Con_uart.c): `Con_uart.c`
- [Command parser](https://github.com/s7nique/xmc7100-car/blob/main/protocol.c): `protocol.c`

### Motion control

- [Wheel control](https://github.com/s7nique/xmc7100-car/blob/main/app_motion_control.c): `app_motion_control.c`
- [Wheel PID](https://github.com/s7nique/xmc7100-car/blob/main/pid.c): `pid.c`

### Sensing and status

- [QMI8658 driver](https://github.com/s7nique/xmc7100-car/blob/main/imu.c): `imu.c`

### Board support

- [Platform services](https://github.com/s7nique/xmc7100-car/blob/main/originbot_platform.c): `originbot_platform.c`
- [Board configuration](https://github.com/s7nique/xmc7100-car/tree/main/bsps/TARGET_APP_KIT_XMC71_EVK_LITE_V1): `bsps/TARGET_APP_KIT_XMC71_EVK_LITE_V1`

### RDK navigation

- [Odometry bridge](https://github.com/s7nique/xmc7100-car/blob/main/rdk_nav_setup/xmc7100_base_odom_bridge.py): `rdk_nav_setup/xmc7100_base_odom_bridge.py`
- [Lidar and navigation](https://github.com/s7nique/xmc7100-car/tree/main/rdk_nav_setup): `rdk_nav_setup`

### Other components

- **RDK X3**
- **Motors and encoders**
- **QMI8658 sensor**
- **ROS 2 navigation**

## Connections

- RDK X3 → UART DMA transport: sends commands
- Main scheduler → Platform services: initializes (evidence: `main.c`)
- Main scheduler → Command parser: dispatches commands (evidence: `main.c`)
- Main scheduler → UART DMA transport: services receive (evidence: `main.c`)
- Main scheduler → Wheel control: runs control (evidence: `main.c`)
- Command parser → Wheel control: sets wheel targets (evidence: `protocol.c`)
- Command parser → Platform services: uses platform services (evidence: `protocol.c`)
- Wheel control → Wheel PID: uses PID (evidence: `app_motion_control.c`)
- Platform services → Board configuration: uses board peripherals (evidence: `originbot_platform.c`)
- Platform services → QMI8658 driver: uses IMU driver (evidence: `originbot_platform.c`)
- QMI8658 driver → QMI8658 sensor: reads sensor
- Wheel control → Motors and encoders: drives and reads
- Platform services → UART DMA transport: sends status frames (evidence: `originbot_platform.c`)
- UART DMA transport → RDK X3: returns telemetry
- RDK X3 → Odometry bridge: runs bridge
- Odometry bridge → ROS 2 navigation: bridges odometry
- RDK X3 → Lidar and navigation: runs lidar and navigation
- Lidar and navigation → ROS 2 navigation: supports SLAM and Nav2
