Namespace simulation_framework::autonomy::topic_registry
Last update: 22.04.2026Definition: 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" ->
KpiMessageTopicType(usesrtidds::KpiMessage) -
"DriverInputTopic" ->
KpiMessageTopicType(usesrtidds::KpiMessage) -
"SensorViewTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"SensorDataTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"TrafficUpdateTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"TrafficCommandTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"MotionRequestTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"FmuInput" ->
FmuMessageTopicType(usesrtidds::FmuMessage) -
"FmuOutput" ->
FmuMessageTopicType(usesrtidds::FmuMessage) -
"ScenarioVariableTopic" ->
VariantMapTopicType(usesrtidds::VariantMap) -
"VehicleControlInputTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage) -
"ObjectSpeedInputTopic" ->
GenericBytesTopicType(usesrtidds::GenericBytesMessage)
Examples:
- KPI (
KpiMessageTopicType)
// 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); }
);
- Generic bytes (
GenericBytesTopicType) for serialized payloads (e.g., protobuf/OSI)
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); }
);
- FMU I/O (
FmuMessageTopicType)
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); }
);
- Scenario variables (
VariantMapTopicType)
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); }
);
?> 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
VariantMapAPI and bi-directional conversion helpers, seecore/communication/utils/variant_map.handcore/communication/utils/variant_map_converter.h.
- VehicleControlInputMsg I/O (
VehicleControlInputTopic)
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);}
);
- Object speed input I/O (
ObjectSpeedInputTopic)
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);}
);
Typedef ScenarioVariableTopicType
Definition: autonomy/communication/topic_registry/topic_registry.h (line 154)
using simulation_framework::autonomy::topic_registry::ScenarioVariableTopicType = typedef simulation_framework::core::topic_registry::VariantMapTopicType
Alias for scenario variable Topic type in Autonomy.
?> Variant message aliases
In core, rtidds::VariantMessage is currently an alias of rtidds::FmuMessage. Similarly, rtidds::VariantData aliases rtidds::FmuData, and rtidds::VariantDatatype 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
Function GetExistingTopicById
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<core::ITopic> of the appropriate concrete Topic type, or throws std::runtime_error if the ID is not recognized.
Parameters:
- const std::string & topic_id
Return type: std::shared_ptr< core::ITopic >