# ros-industrial/abb_libegm architecture

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

- Interactive diagram: https://gitdiagram.com/ros-industrial/abb_libegm
- Repository: https://github.com/ros-industrial/abb_libegm

## Overview

abb_libegm is a C++ library for exchanging ABB Externally Guided Motion (EGM) references with robot controllers over UDP. The principal flow is controller feedback into a UDP server, through a base or specialized interface, and back as a reference reply. Users can instead supply outputs through the controller interface or enqueue trajectories for interpolation. The graph also includes shared data/math and logging layers. The README and excerpts establish the main workflow; some protocol-schema and internal implementation links are not shown, so uncertain relationships are omitted.

Main entry points: [`src/egm_base_interface.cpp`](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_base_interface.cpp) (Base interface), [`src/egm_trajectory_interface.cpp`](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_trajectory_interface.cpp) (Trajectory interface), [`src/egm_udp_server.cpp`](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_udp_server.cpp) (UDP server), [`src/egm_controller_interface.cpp`](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_controller_interface.cpp) (Controller interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_transport["UDP transport"]
  node_udp["UDP server<br/>[egm_udp_server.cpp]"]
end

subgraph group_interfaces["EGM interfaces"]
  node_base["Base interface"]
  node_controller["Controller interface"]
  node_trajectory["Trajectory interface"]
end

subgraph group_motion["Motion support"]
  node_common["Shared types<br/>[egm_common.cpp]"]
  node_auxiliary["Motion math"]
  node_interpolator["Interpolator"]
  node_logger["EGM logger<br/>[egm_logger.cpp]"]
end

subgraph group_protocol["Protocol data"]
  node_egm_proto["EGM messages<br/>[egm.proto]"]
  node_wrapper_proto["Wrapper messages<br/>[egm_wrapper.proto]"]
  node_trajectory_proto["Trajectory messages"]
end

node_robot(("ABB controller"))
node_user(("Library user"))

node_robot -->|"sends feedback"| node_udp
node_udp -->|"dispatches messages"| node_base
node_base -->|"returns replies"| node_udp
node_base -->|"uses motion math"| node_auxiliary
node_base -->|"configures logging"| node_logger
node_user -->|"supplies outputs"| node_controller
node_user -->|"queues trajectories"| node_trajectory
node_trajectory -->|"updates interpolation"| node_interpolator
node_controller -->|"inherits behavior"| node_base
node_trajectory -->|"inherits behavior"| node_base

click node_udp "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_udp_server.cpp"
click node_base "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_base_interface.cpp"
click node_controller "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_controller_interface.cpp"
click node_trajectory "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_trajectory_interface.cpp"
click node_common "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_common.cpp"
click node_auxiliary "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_common_auxiliary.cpp"
click node_interpolator "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_interpolator.cpp"
click node_logger "https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_logger.cpp"
click node_egm_proto "https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm.proto"
click node_wrapper_proto "https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm_wrapper.proto"
click node_trajectory_proto "https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm_wrapper_trajectory.proto"

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_udp,node_user toneBlue
class node_base,node_controller,node_trajectory toneAmber
class node_common,node_auxiliary,node_interpolator,node_logger toneMint
class node_egm_proto,node_wrapper_proto,node_trajectory_proto toneRose
class node_robot toneIndigo
```

## Components

### UDP transport

- [UDP server](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_udp_server.cpp): `src/egm_udp_server.cpp`

### EGM interfaces

- [Base interface](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_base_interface.cpp): `src/egm_base_interface.cpp`
- [Controller interface](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_controller_interface.cpp): `src/egm_controller_interface.cpp`
- [Trajectory interface](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_trajectory_interface.cpp): `src/egm_trajectory_interface.cpp`

### Motion support

- [Shared types](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_common.cpp): `src/egm_common.cpp`
- [Motion math](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_common_auxiliary.cpp): `src/egm_common_auxiliary.cpp`
- [Interpolator](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_interpolator.cpp): `src/egm_interpolator.cpp`
- [EGM logger](https://github.com/ros-industrial/abb_libegm/blob/master/src/egm_logger.cpp): `src/egm_logger.cpp`

### Protocol data

- [EGM messages](https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm.proto): `proto/egm.proto`
- [Wrapper messages](https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm_wrapper.proto): `proto/egm_wrapper.proto`
- [Trajectory messages](https://github.com/ros-industrial/abb_libegm/blob/master/proto/egm_wrapper_trajectory.proto): `proto/egm_wrapper_trajectory.proto`

### Other components

- **ABB controller**
- **Library user**

## Connections

- ABB controller → UDP server: sends feedback (evidence: `README.md`)
- UDP server → Base interface: dispatches messages (evidence: `README.md`)
- Base interface → UDP server: returns replies (evidence: `README.md`)
- Base interface → Motion math: uses motion math (evidence: `src/egm_base_interface.cpp`)
- Base interface → EGM logger: configures logging (evidence: `src/egm_base_interface.cpp`)
- Library user → Controller interface: supplies outputs (evidence: `README.md`)
- Library user → Trajectory interface: queues trajectories (evidence: `README.md`)
- Trajectory interface → Interpolator: updates interpolation (evidence: `src/egm_trajectory_interface.cpp`)
- Controller interface → Base interface: inherits behavior
- Trajectory interface → Base interface: inherits behavior
