mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 20:41:35 +08:00
uORB: generate ORBTypeMap and example usage (uORB::Publication2)
This commit is contained in:
@@ -70,6 +70,10 @@ topic_name = spec.short_name
|
||||
|
||||
#include <uORB/uORB.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <uORB/topics/uORBTopics.hpp>
|
||||
#endif
|
||||
|
||||
@##############################
|
||||
@# Includes for dependencies
|
||||
@##############################
|
||||
@@ -135,5 +139,11 @@ ORB_DECLARE(@multi_topic);
|
||||
@[end for]
|
||||
|
||||
#ifdef __cplusplus
|
||||
@[for multi_topic in topics]@
|
||||
template<> struct ORBTypeMap<ORB_ID::@multi_topic> {
|
||||
using type = @(uorb_struct);
|
||||
};
|
||||
@[end for]
|
||||
|
||||
void print_message(const @uorb_struct& message);
|
||||
#endif
|
||||
|
||||
@@ -73,4 +73,6 @@ enum class ORB_ID : uint8_t {
|
||||
INVALID
|
||||
};
|
||||
|
||||
template<ORB_ID> struct ORBTypeMap;
|
||||
|
||||
const struct orb_metadata *get_orb_meta(ORB_ID id);
|
||||
|
||||
Reference in New Issue
Block a user