# gloryhry/hikrobotics-camera-ros-driver architecture

> Architecture diagram of the GitHub repository gloryhry/hikrobotics-camera-ros-driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gloryhry/hikrobotics-camera-ros-driver
- Repository: https://github.com/gloryhry/hikrobotics-camera-ros-driver

## Overview

This ROS Noetic driver discovers and selects a Hikrobot industrial camera, configures acquisition and image controls, then publishes synchronized ROS image and camera-info messages. Its distinctive exposure-control path adjusts exposure from image brightness when automatic exposure is unavailable with external triggering; README also documents parameterized trigger, frame-rate, gain, digital-shift, and gamma settings. The source excerpts support the discovery/configuration and publication roles, but omit wiring details for several controls and optional LiDAR timestamps, so uncertain connections are not drawn.

Main entry points: [`src/camera.cpp`](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp) (Camera lifecycle), [`src/hik_driver.cpp`](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/hik_driver.cpp) (ROS driver entry), [`libs/libMvCameraControl.so.4.8.0.3`](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/libs/libMvCameraControl.so.4.8.0.3) (MVS camera SDK), [`launch/camera.launch`](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/launch/camera.launch) (ROS launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Camera Runtime"]
  node_driver["ROS driver entry<br/>[hik_driver.cpp]"]
  node_camera_core["Camera lifecycle<br/>[camera.cpp]"]
  node_camera_api["Camera interface<br/>[camera.h]"]
  node_image_topics["Image and info topics<br/>[camera.cpp]"]
  node_exposure_feedback["Brightness exposure control<br/>[camera.cpp]"]
end

subgraph group_sdk["MVS Integration"]
  node_mvs_sdk["MVS camera SDK"]
  node_sdk_api["MVS API declarations<br/>[MvCameraControl.h]"]
  node_platform_libs["Platform SDK libraries"]
end

subgraph group_config["Camera Configuration"]
  node_camera_params["Camera parameters<br/>[camera.yaml]"]
  node_calibration["Camera calibration<br/>[ost.yaml]"]
  node_launch["ROS launch<br/>[camera.launch]"]
end

node_operator(("ROS operator"))
node_camera(("Hikrobot camera"))
node_lidar_time[("LiDAR timestamp source")]

node_operator -->|"starts"| node_launch
node_launch -->|"launches"| node_driver
node_driver -->|"reads settings"| node_camera_params
node_driver -->|"constructs"| node_camera_api
node_driver -->|"enumerates devices"| node_mvs_sdk
node_driver -->|"selects device"| node_camera_core
node_camera_core -->|"opens and configures"| node_mvs_sdk
node_mvs_sdk -->|"controls and streams"| node_camera
node_camera_core -->|"publishes frames"| node_image_topics
node_calibration -->|"camera calibration"| node_camera_core
node_image_topics -->|"publishes image and info"| node_operator
node_camera_core -->|"feeds brightness"| node_exposure_feedback
node_exposure_feedback -->|"sets exposure"| node_camera_core
node_camera_core -.->|"optional timestamp read"| node_lidar_time
node_sdk_api -->|"declares API"| node_mvs_sdk
node_platform_libs -.->|"platform runtime"| node_mvs_sdk

click node_driver "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/hik_driver.cpp"
click node_camera_core "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp"
click node_camera_api "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/include/hik_camera_driver/camera.h"
click node_image_topics "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp"
click node_exposure_feedback "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp"
click node_mvs_sdk "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/libs/libMvCameraControl.so.4.8.0.3"
click node_sdk_api "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/include/mvs/MvCameraControl.h"
click node_platform_libs "https://github.com/gloryhry/hikrobotics-camera-ros-driver/tree/mvs_5.0.1/aarch64_libs"
click node_camera_params "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/config/camera.yaml"
click node_calibration "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/config/ost.yaml"
click node_launch "https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/launch/camera.launch"

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_driver,node_camera_core,node_camera_api,node_image_topics,node_exposure_feedback toneBlue
class node_mvs_sdk,node_sdk_api,node_platform_libs,node_lidar_time toneAmber
class node_camera_params,node_calibration,node_launch toneMint
class node_operator,node_camera toneIndigo
```

## Components

### Camera Runtime

- [ROS driver entry](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/hik_driver.cpp): `src/hik_driver.cpp`
- [Camera lifecycle](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp): `src/camera.cpp`
- [Camera interface](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/include/hik_camera_driver/camera.h): `include/hik_camera_driver/camera.h`
- [Image and info topics](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp): `src/camera.cpp`
- [Brightness exposure control](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/src/camera.cpp): `src/camera.cpp`

### MVS Integration

- [MVS camera SDK](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/libs/libMvCameraControl.so.4.8.0.3): `libs/libMvCameraControl.so.4.8.0.3`
- [MVS API declarations](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/include/mvs/MvCameraControl.h): `include/mvs/MvCameraControl.h`
- [Platform SDK libraries](https://github.com/gloryhry/hikrobotics-camera-ros-driver/tree/mvs_5.0.1/aarch64_libs): `aarch64_libs`

### Camera Configuration

- [Camera parameters](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/config/camera.yaml): `config/camera.yaml`
- [Camera calibration](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/config/ost.yaml): `config/ost.yaml`
- [ROS launch](https://github.com/gloryhry/hikrobotics-camera-ros-driver/blob/mvs_5.0.1/launch/camera.launch): `launch/camera.launch`

### Other components

- **ROS operator**
- **Hikrobot camera**
- **LiDAR timestamp source**

## Connections

- ROS operator → ROS launch: starts
- ROS launch → ROS driver entry: launches
- ROS driver entry → Camera parameters: reads settings
- ROS driver entry → Camera interface: constructs
- ROS driver entry → MVS camera SDK: enumerates devices
- ROS driver entry → Camera lifecycle: selects device
- Camera lifecycle → MVS camera SDK: opens and configures
- MVS camera SDK → Hikrobot camera: controls and streams
- Camera lifecycle → Image and info topics: publishes frames
- Camera calibration → Camera lifecycle: camera calibration
- Image and info topics → ROS operator: publishes image and info
- Camera lifecycle → Brightness exposure control: feeds brightness
- Brightness exposure control → Camera lifecycle: sets exposure
- Camera lifecycle → LiDAR timestamp source: optional timestamp read
- MVS API declarations → MVS camera SDK: declares API
- Platform SDK libraries → MVS camera SDK: platform runtime
