# jixingao/kilvo architecture

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

- Interactive diagram: https://gitdiagram.com/jixingao/kilvo
- Repository: https://github.com/jixingao/kilvo

## Overview

KILVO is a ROS1 humanoid-robot odometry and mapping system. Its principal workflow combines asynchronous leg-kinematic updates with inertial prediction and sequential LiDAR/camera updates to estimate motion and build a map, with contact estimation and modality adaptation supporting robustness. The mapper is the runtime entry point and apparent coordinator. The README documents the hybrid estimator and capabilities; some internal call paths are not visible in the supplied excerpts, so those links are marked unverified rather than asserted as source-confirmed.

Main entry points: [`src/LIVMapper.cpp`](https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp) (Mapping coordinator), [`src/vio.cpp`](https://github.com/jixingao/kilvo/blob/main/src/vio.cpp) (Visual odometry), [`src/preprocess.cpp`](https://github.com/jixingao/kilvo/blob/main/src/preprocess.cpp) (LiDAR preprocessing), [`src/kio.cpp`](https://github.com/jixingao/kilvo/blob/main/src/kio.cpp) (Kinematic odometry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime coordination"]
  node_entry["ROS entry point<br/>[main.cpp]"]
  node_mapper["Mapping coordinator<br/>[LIVMapper.cpp]"]
  node_sensor_sync["Sensor synchronization<br/>[LIVMapper.cpp]"]
  node_adaptation["Modality adaptation<br/>[LIVMapper.cpp]"]
  node_outputs["Odometry and map outputs<br/>[LIVMapper.cpp]"]
end

subgraph group_sensing["Sensor preparation"]
  node_lidar_preprocess["LiDAR preprocessing<br/>[preprocess.cpp]"]
end

subgraph group_estimation["State estimation"]
  node_imu_process["IMU prediction<br/>[IMU_Processing.cpp]"]
end

subgraph group_mapping["Map and vision"]
  node_lio_map[("LiDAR odometry map<br/>[voxel_map.cpp]")]
  node_vio["Visual odometry<br/>[vio.cpp]"]
  node_frame["Camera frame<br/>[frame.cpp]"]
  node_visual_points[("Visual map points<br/>[visual_point.cpp]")]
  node_feature["Image features<br/>[feature.h]"]
end

subgraph group_kinematics["Contact and kinematics"]
  node_kio["Kinematic odometry<br/>[kio.cpp]"]
  node_contact["Contact estimation<br/>[kio.cpp]"]
end

node_robot_sensors(("Robot sensors"))
node_ros_bag(("ROS bag input"))

node_robot_sensors -.->|"supply measurements"| node_mapper
node_ros_bag -.->|"replay topics"| node_mapper
node_entry -->|"constructs and runs"| node_mapper
node_mapper -.->|"synchronizes streams"| node_sensor_sync
node_mapper -.->|"switches modalities"| node_adaptation
node_mapper -.->|"dispatches LiDAR"| node_lidar_preprocess
node_mapper -.->|"requests prediction"| node_imu_process
node_mapper -.->|"updates LiDAR state"| node_lio_map
node_mapper -.->|"updates visual state"| node_vio
node_mapper -.->|"processes leg data"| node_kio
node_mapper -.->|"estimates contact"| node_contact
node_mapper -.->|"publishes results"| node_outputs
node_vio -->|"creates frames"| node_frame
node_vio -->|"updates visual map"| node_visual_points
node_vio -->|"uses image patches"| node_feature
node_kio -.->|"tracks contact state"| node_contact
node_lidar_preprocess -.->|"provides point clouds"| node_lio_map

click node_entry "https://github.com/jixingao/kilvo/blob/main/src/main.cpp"
click node_mapper "https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp"
click node_sensor_sync "https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp"
click node_adaptation "https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp"
click node_lidar_preprocess "https://github.com/jixingao/kilvo/blob/main/src/preprocess.cpp"
click node_imu_process "https://github.com/jixingao/kilvo/blob/main/src/IMU_Processing.cpp"
click node_lio_map "https://github.com/jixingao/kilvo/blob/main/src/voxel_map.cpp"
click node_vio "https://github.com/jixingao/kilvo/blob/main/src/vio.cpp"
click node_frame "https://github.com/jixingao/kilvo/blob/main/src/frame.cpp"
click node_visual_points "https://github.com/jixingao/kilvo/blob/main/src/visual_point.cpp"
click node_feature "https://github.com/jixingao/kilvo/blob/main/include/feature.h"
click node_kio "https://github.com/jixingao/kilvo/blob/main/src/kio.cpp"
click node_contact "https://github.com/jixingao/kilvo/blob/main/src/kio.cpp"
click node_outputs "https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp"

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_entry,node_mapper,node_sensor_sync,node_adaptation,node_outputs toneBlue
class node_lidar_preprocess toneAmber
class node_imu_process toneMint
class node_lio_map,node_vio,node_frame,node_visual_points,node_feature toneRose
class node_kio,node_contact,node_robot_sensors,node_ros_bag toneIndigo
```

## Components

### Runtime coordination

- [ROS entry point](https://github.com/jixingao/kilvo/blob/main/src/main.cpp): `src/main.cpp`
- [Mapping coordinator](https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp): `src/LIVMapper.cpp`
- [Sensor synchronization](https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp): `src/LIVMapper.cpp`
- [Modality adaptation](https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp): `src/LIVMapper.cpp`
- [Odometry and map outputs](https://github.com/jixingao/kilvo/blob/main/src/LIVMapper.cpp): `src/LIVMapper.cpp`

### Sensor preparation

- [LiDAR preprocessing](https://github.com/jixingao/kilvo/blob/main/src/preprocess.cpp): `src/preprocess.cpp`

### State estimation

- [IMU prediction](https://github.com/jixingao/kilvo/blob/main/src/IMU_Processing.cpp): `src/IMU_Processing.cpp`

### Map and vision

- [LiDAR odometry map](https://github.com/jixingao/kilvo/blob/main/src/voxel_map.cpp): `src/voxel_map.cpp`
- [Visual odometry](https://github.com/jixingao/kilvo/blob/main/src/vio.cpp): `src/vio.cpp`
- [Camera frame](https://github.com/jixingao/kilvo/blob/main/src/frame.cpp): `src/frame.cpp`
- [Visual map points](https://github.com/jixingao/kilvo/blob/main/src/visual_point.cpp): `src/visual_point.cpp`
- [Image features](https://github.com/jixingao/kilvo/blob/main/include/feature.h): `include/feature.h`

### Contact and kinematics

- [Kinematic odometry](https://github.com/jixingao/kilvo/blob/main/src/kio.cpp): `src/kio.cpp`
- [Contact estimation](https://github.com/jixingao/kilvo/blob/main/src/kio.cpp): `src/kio.cpp`

### Other components

- **Robot sensors**
- **ROS bag input**

## Connections

- Robot sensors → Mapping coordinator: supply measurements (evidence: `README.md`)
- ROS bag input → Mapping coordinator: replay topics (evidence: `README.md`)
- ROS entry point → Mapping coordinator: constructs and runs (evidence: `src/main.cpp`)
- Mapping coordinator → Sensor synchronization: synchronizes streams (evidence: `src/LIVMapper.cpp`)
- Mapping coordinator → Modality adaptation: switches modalities (evidence: `README.md`)
- Mapping coordinator → LiDAR preprocessing: dispatches LiDAR
- Mapping coordinator → IMU prediction: requests prediction
- Mapping coordinator → LiDAR odometry map: updates LiDAR state
- Mapping coordinator → Visual odometry: updates visual state
- Mapping coordinator → Kinematic odometry: processes leg data
- Mapping coordinator → Contact estimation: estimates contact
- Mapping coordinator → Odometry and map outputs: publishes results (evidence: `src/LIVMapper.cpp`)
- Visual odometry → Camera frame: creates frames (evidence: `src/vio.cpp`)
- Visual odometry → Visual map points: updates visual map (evidence: `src/vio.cpp`)
- Visual odometry → Image features: uses image patches (evidence: `src/vio.cpp`)
- Kinematic odometry → Contact estimation: tracks contact state (evidence: `src/kio.cpp`)
- LiDAR preprocessing → LiDAR odometry map: provides point clouds
