    

 ## On this page

  

 

 # Namespace simulation\_framework::autonomy::topic\_registry

 Last update: 22.04.2026 

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")

**Definition**: `autonomy/communication/topic_registry/topic_registry.h` (line 34)

## Autonomy Topic IDs and their Topic types (RTI-DDS backed)

Use these Topic types when adding publishers/subscribers for the listed IDs.

- "KpiLoggerTopic" -&gt; `KpiMessageTopicType` (uses `rtidds::KpiMessage`)
- "DriverInputTopic" -&gt; `KpiMessageTopicType` (uses `rtidds::KpiMessage`)
- "SensorViewTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "SensorDataTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "TrafficUpdateTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "TrafficCommandTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "MotionRequestTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "FmuInput" -&gt; `FmuMessageTopicType` (uses `rtidds::FmuMessage`)
- "FmuOutput" -&gt; `FmuMessageTopicType` (uses `rtidds::FmuMessage`)
- "ScenarioVariableTopic" -&gt; `VariantMapTopicType` (uses `rtidds::VariantMap`)
- "VehicleControlInputTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)
- "ObjectSpeedInputTopic" -&gt; `GenericBytesTopicType` (uses `rtidds::GenericBytesMessage`)

**Examples**:

1. KPI (`KpiMessageTopicType`)

```cpp
// Publish to KPI logger
AddPublisher<core::topic_registry::KpiMessageTopicType>(
    "KpiLoggerTopic", [&]() { return kpi_msg_; }  // rtidds::KpiMessage kpi_msg_;
);
// Subscribe driver input
AddSubscriber<core::topic_registry::KpiMessageTopicType>(
    "DriverInputTopic", [&](const rtidds::KpiMessage& msg) { HandleDriverInput(msg); }
);

```

2. Generic bytes (`GenericBytesTopicType`) for serialized payloads (e.g., protobuf/OSI)

```cpp
AddPublisher<core::topic_registry::GenericBytesTopicType>(
    "SensorDataTopic", [&]() { return bytes_msg_; }  // rtidds::GenericBytesMessage bytes_msg_;
);
// Fill bytes_msg_ with serialized data; see communication.md for details
AddSubscriber<core::topic_registry::GenericBytesTopicType>(
    "SensorViewTopic", [&](const rtidds::GenericBytesMessage& msg) { ParseAndUse(msg); }
);

```

3. FMU I/O (`FmuMessageTopicType`)

```cpp
AddPublisher<core::topic_registry::FmuMessageTopicType>(
    "FmuInput", [&]() { return fmu_msg_; }  // rtidds::FmuMessage fmu_msg_;
);
AddSubscriber<core::topic_registry::FmuMessageTopicType>(
    "FmuOutput", [&](const rtidds::FmuMessage& msg) { HandleFmuOutputs(msg); }
);

```

4. Scenario variables (`VariantMapTopicType`)

```cpp
AddPublisher<core::topic_registry::VariantMapTopicType>(
    "ScenarioVariableTopic", [&]() { return var_map_msg_; }  // rtidds::VariantMap var_map_msg_;
);
AddSubscriber<core::topic_registry::VariantMapTopicType>(
    "ScenarioVariableTopic", [&](const rtidds::VariantMap& msg) { ApplyScenarioVariables(msg); }
);

```

?&gt; VariantMap references

- For the RTI-DDS message type and Topic alias, see `[core/communication/topic_registry.h](core_2communication_2topic__registry_8h.md`
- For the C++ native `VariantMap` API and bi-directional conversion helpers, see `core/communication/utils/variant_map.h` and `core/communication/utils/variant_map_converter.h`.

5. VehicleControlInputMsg I/O (`VehicleControlInputTopic`)

```cpp
AddPublisher<core::Topic<rtidds::GenericBytesMessage>>(
    "VehicleControlInputTopic", [&]() {
  autonomy::communication::messages::VehicleControlInputMsg msg;
  return autonomy::communication::utils::ConvertAutonomyMsgToGenericBytes(frame_counter, header_name, msg); //
rtidds::GenericBytesMessage
}
);

AddSubscriber<core::Topic<rtidds::GenericBytesMessage>>(
    "VehicleControlInputTopic", [&](const rtidds::GenericBytesMessage& msg) {
  autonomy::communication::messages::VehicleControlInputMsg inputs;
  autonomy::communication::utils::ConvertGenericBytesToAutonomyMsg(msg,inputs);}
);

```

6. Object speed input I/O (`ObjectSpeedInputTopic`)

```cpp
AddPublisher<core::Topic<rtidds::GenericBytesMessage>>(
    "ObjectSpeedInputTopic", [&]() {
  autonomy::communication::messages::ObjectSpeedInputMsg msg;
  return autonomy::communication::utils::ConvertAutonomyMsgToGenericBytes(frame_counter, header_name, msg); //
rtidds::GenericBytesMessage
}
);

AddSubscriber<core::Topic<rtidds::GenericBytesMessage>>(
    "ObjectSpeedInputTopic", [&](const rtidds::GenericBytesMessage& msg) {
  autonomy::communication::messages::ObjectSpeedInputMsg speed_input;
  autonomy::communication::utils::ConvertGenericBytesToAutonomyMsg(msg, speed_input);}
);

```

<a id="autonomy_2communication_2topic__registry_2topic__registry_8h_1abc5d170dec018a5f04fd69307316a25a"></a>

### Typedef ScenarioVariableTopicType

![](https://img.shields.io/badge/-public-brightgreen "public")

**Definition**: `autonomy/communication/topic_registry/topic_registry.h` (line 154)

```cpp
using simulation_framework::autonomy::topic_registry::ScenarioVariableTopicType = typedef simulation_framework::core::topic_registry::VariantMapTopicType

```

Alias for scenario variable Topic type in Autonomy.

?&gt; Variant message aliases

In core, `<a href="namespacertidds.md#namespacertidds_1a442f59bc02e5668d37a306af1c6faacd">rtidds::VariantMessage</a>` is currently an alias of `rtidds::FmuMessage`. Similarly, `<a href="namespacertidds.md#namespacertidds_1a5d98a2ba88abe876a19cf09c458e06e1">rtidds::VariantData</a>` aliases `rtidds::FmuData`, and `<a href="namespacertidds.md#namespacertidds_1ae065fe2b5abd93b78891593a53ef039b">rtidds::VariantDatatype</a>` aliases `rtidds::FmuDatatype`. This provides a semantic "Variant" naming today while retaining full compatibility with FMU message structure. If dedicated Variant types are introduced in the future, these aliases can be updated centrally. Maps to `simulation_framework::core::topic_registry::VariantMapTopicType` which uses `rtidds::VariantMap` as the underlying RTI-DDS message. **See also**: \[core/communication/topic\_registry.h\](core\_2communication\_2topic\_\_registry\_8h.md

**Return type**: [simulation\_framework::core::topic\_registry::VariantMapTopicType](classsimulation__framework_1_1core_1_1Topic.md#classsimulation__framework_1_1core_1_1Topic)

<a id="autonomy_2communication_2topic__registry_2topic__registry_8h_1a7e5a96139f19e44af79116bc58dd0341"></a>

### Function GetExistingTopicById

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
std::shared_ptr< core::ITopic > simulation_framework::autonomy::topic_registry::GetExistingTopicById(const std::string &topic_id)

```

Return a concrete Topic instance for a known Autonomy Topic ID.

**Parameters**:

- **topic\_id**: One of: "KpiLoggerTopic", "DriverInputTopic", "SensorViewTopic", "SensorDataTopic", "TrafficUpdateTopic", "TrafficCommandTopic", "MotionRequestTopic", "FmuInput", "FmuOutput", "ScenarioVariableTopic", "VehicleControlInputTopic", "ObjectSpeedInputTopic".

**Returns**:

A `std::shared_ptr<<a href="classsimulation__framework_1_1core_1_1ITopic.md#classsimulation__framework_1_1core_1_1ITopic">core::ITopic</a>>` of the appropriate concrete Topic type, or throws `std::runtime_error` if the ID is not recognized.

**Parameters**:

- [const](classsimulation__framework_1_1core_1_1Topic.md#classsimulation__framework_1_1core_1_1Topic) std::string &amp; **topic\_id**

**Return type**: std::shared\_ptr&lt; [core::ITopic](classsimulation__framework_1_1core_1_1ITopic.md#classsimulation__framework_1_1core_1_1ITopic) &gt;