Generate default Zenoh config from dds_topics.yaml

For easy transition from uxrce to zenoh and a sane base config to begin with
This commit is contained in:
Peter van der Perk
2025-05-05 13:39:19 +02:00
committed by Beat Küng
parent bac009c2b8
commit 0763bbe2cf
4 changed files with 53 additions and 6 deletions
+2 -3
View File
@@ -113,7 +113,7 @@ int ZENOH::generate_rmw_zenoh_topic_keyexpr(const char *topic, const uint8_t *ri
if (type_name) {
strcpy(type, type_name);
toCamelCase(type); // Convert uORB type to camel case
return snprintf(keyexpr, KEYEXPR_SIZE, "%" PRId32 "/%s/"
return snprintf(keyexpr, KEYEXPR_SIZE, "%" PRId32 "%s/"
KEYEXPR_MSG_NAME "%s_/RIHS01_"
"%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x"
@@ -156,7 +156,7 @@ int ZENOH::generate_rmw_zenoh_topic_liveliness_keyexpr(const z_id_t *id, const c
return snprintf(keyexpr, KEYEXPR_SIZE,
"@ros2_lv/%" PRId32 "/"
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x/"
"0/11/%s/%%/%%/px4_%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x/%%%s/"
"0/11/%s/%%/%%/px4_%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x/%s/"
KEYEXPR_MSG_NAME "%s_/RIHS01_"
"%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x"
@@ -330,7 +330,6 @@ int ZENOH::setupTopics(px4_pollfd_struct_t *pfds)
for (i = 0; i < _pub_count; i++) {
if (_config.getPublisherMapping(topic, type)) {
printf("Index %i ret %i Topic %s Type %s", i, ret, topic, type);
_zenoh_publishers[i] = genPublisher(type);
const uint8_t *rihs_hash = getRIHS01_Hash(type);