mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 00:31:36 +08:00
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:
@@ -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]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user