uorb topics generator: add multi-topics to the list of all topics

topic names with '# TOPICS <name>' were previously not in orb_get_topics().
This means the logger could not find them.

Affects for example actuator_controls_0.
This commit is contained in:
Beat Küng
2016-08-15 15:19:14 +02:00
parent 4e1652fa6b
commit 89a7e0cf87
2 changed files with 13 additions and 5 deletions
+7 -4
View File
@@ -8,6 +8,7 @@
@#
@# Context:
@# - msgs (List) list of all msg files
@# - multi_topics (List) list of all multi-topic names
@###############################################
/****************************************************************************
*
@@ -45,17 +46,19 @@
#include <uORB/uORBTopics.h>
#include <uORB/uORB.h>
@{
msgs_count = len(msgs)
msg_names = [mn.replace(".msg", "") for mn in msgs]
msgs_count = len(msg_names)
msg_names_all = list(set(msg_names + multi_topics)) # set() filters duplicates
msgs_count_all = len(msg_names_all)
}@
@[for msg_name in msg_names]@
#include <uORB/topics/@(msg_name).h>
@[end for]
const size_t _uorb_topics_count = @(msgs_count);
const size_t _uorb_topics_count = @(msgs_count_all);
const struct orb_metadata* _uorb_topics_list[_uorb_topics_count] = {
@[for idx, msg_name in enumerate(msg_names, 1)]@
ORB_ID(@(msg_name))@[if idx != msgs_count],@[end if]
@[for idx, msg_name in enumerate(msg_names_all, 1)]@
ORB_ID(@(msg_name))@[if idx != msgs_count_all],@[end if]
@[end for]
};