nros rmw-cffi
C vtable for plugging a third-party RMW backend into nros
Loading...
Searching...
No Matches
rmw_entity.h
Go to the documentation of this file.
1#ifndef NROS_RMW_ENTITY_H
2#define NROS_RMW_ENTITY_H
3
4#include <stdbool.h>
5#include <stdint.h>
6#include <stddef.h>
7
38/* ------------------------------------------------------------------ */
39/* QoS profile — full DDS shape (matches `rmw_qos_profile_t`) */
40/* ------------------------------------------------------------------ */
41
43#define NROS_RMW_RELIABILITY_BEST_EFFORT 0
44#define NROS_RMW_RELIABILITY_RELIABLE 1
45
47#define NROS_RMW_DURABILITY_VOLATILE 0
48#define NROS_RMW_DURABILITY_TRANSIENT_LOCAL 1
49
51#define NROS_RMW_HISTORY_KEEP_LAST 0
52#define NROS_RMW_HISTORY_KEEP_ALL 1
53
66
88typedef struct nros_rmw_qos_t {
89 /* ---- 8-byte core, layout-equivalent to the original subset ---- */
90 uint8_t reliability;
91 uint8_t durability;
92 uint8_t history;
94 uint16_t depth;
95 uint16_t _reserved0;
97 /* ---- 16-byte extension (Phase 109) ---- */
101 uint32_t deadline_ms;
102
105 uint32_t lifespan_ms;
106
110
118 uint8_t _reserved1[3];
125} nros_rmw_qos_t; /* 28 bytes */
126
127/* ---- Standard QoS profile constants ---- */
128/* Defined as static const initialisers at the bottom of this
129 * header so they're available in every compilation unit that
130 * includes it. Match the field set of upstream
131 * `rmw_qos_profile_default` etc. */
132
135#define NROS_RMW_QOS_PROFILE_DEFAULT \
136 ((nros_rmw_qos_t){ \
137 .reliability = NROS_RMW_RELIABILITY_RELIABLE, \
138 .durability = NROS_RMW_DURABILITY_VOLATILE, \
139 .history = NROS_RMW_HISTORY_KEEP_LAST, \
140 .liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
141 .depth = 10, \
142 ._reserved0 = 0, \
143 .deadline_ms = 0, \
144 .lifespan_ms = 0, \
145 .liveliness_lease_ms = 0, \
146 .avoid_ros_namespace_conventions = 0, \
147 ._reserved1 = {0, 0, 0}, \
148 })
149
152#define NROS_RMW_QOS_PROFILE_SENSOR_DATA \
153 ((nros_rmw_qos_t){ \
154 .reliability = NROS_RMW_RELIABILITY_BEST_EFFORT, \
155 .durability = NROS_RMW_DURABILITY_VOLATILE, \
156 .history = NROS_RMW_HISTORY_KEEP_LAST, \
157 .liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
158 .depth = 5, \
159 ._reserved0 = 0, \
160 .deadline_ms = 0, \
161 .lifespan_ms = 0, \
162 .liveliness_lease_ms = 0, \
163 .avoid_ros_namespace_conventions = 0, \
164 ._reserved1 = {0, 0, 0}, \
165 })
166
169#define NROS_RMW_QOS_PROFILE_SERVICES_DEFAULT NROS_RMW_QOS_PROFILE_DEFAULT
170
173#define NROS_RMW_QOS_PROFILE_PARAMETERS \
174 ((nros_rmw_qos_t){ \
175 .reliability = NROS_RMW_RELIABILITY_RELIABLE, \
176 .durability = NROS_RMW_DURABILITY_VOLATILE, \
177 .history = NROS_RMW_HISTORY_KEEP_LAST, \
178 .liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
179 .depth = 1000, \
180 ._reserved0 = 0, \
181 .deadline_ms = 0, \
182 .lifespan_ms = 0, \
183 .liveliness_lease_ms = 0, \
184 .avoid_ros_namespace_conventions = 0, \
185 ._reserved1 = {0, 0, 0}, \
186 })
187
189#define NROS_RMW_QOS_PROFILE_SYSTEM_DEFAULT NROS_RMW_QOS_PROFILE_DEFAULT
190
191/* ------------------------------------------------------------------ */
192/* Entity structs */
193/* ------------------------------------------------------------------ */
194
207typedef struct nros_rmw_session_t {
209 const char *node_name;
211 const char *namespace_;
214 uint8_t _reserved[8];
218
249
268
293
307
308#endif /* NROS_RMW_ENTITY_H */
nros_rmw_liveliness_kind_t
Definition rmw_entity.h:55
@ NROS_RMW_LIVELINESS_MANUAL_BY_TOPIC
Definition rmw_entity.h:62
@ NROS_RMW_LIVELINESS_NONE
Definition rmw_entity.h:58
@ NROS_RMW_LIVELINESS_MANUAL_BY_NODE
Definition rmw_entity.h:64
@ NROS_RMW_LIVELINESS_AUTOMATIC
Definition rmw_entity.h:60
Definition rmw_entity.h:234
const char * type_name
Definition rmw_entity.h:239
uint8_t _reserved[7]
Definition rmw_entity.h:245
bool can_loan_messages
Definition rmw_entity.h:243
const char * topic_name
Definition rmw_entity.h:236
void * backend_data
Definition rmw_entity.h:247
nros_rmw_qos_t qos
Definition rmw_entity.h:241
Definition rmw_entity.h:88
uint8_t history
Definition rmw_entity.h:92
uint8_t avoid_ros_namespace_conventions
Definition rmw_entity.h:117
uint8_t durability
Definition rmw_entity.h:91
uint16_t depth
Definition rmw_entity.h:94
uint8_t reliability
Definition rmw_entity.h:90
uint8_t _reserved1[3]
Definition rmw_entity.h:118
uint32_t deadline_ms
Definition rmw_entity.h:101
uint32_t liveliness_lease_ms
Definition rmw_entity.h:109
uint8_t liveliness_kind
Definition rmw_entity.h:93
uint32_t rx_buffer_hint
Definition rmw_entity.h:124
uint16_t _reserved0
Definition rmw_entity.h:95
uint32_t lifespan_ms
Definition rmw_entity.h:105
Definition rmw_entity.h:297
uint8_t _reserved[8]
Definition rmw_entity.h:303
void * backend_data
Definition rmw_entity.h:305
const char * type_name
Definition rmw_entity.h:301
const char * service_name
Definition rmw_entity.h:299
Definition rmw_entity.h:282
uint8_t _reserved[8]
Definition rmw_entity.h:289
const char * service_name
Definition rmw_entity.h:284
const char * type_name
Definition rmw_entity.h:287
void * backend_data
Definition rmw_entity.h:291
Definition rmw_entity.h:207
const char * node_name
Definition rmw_entity.h:209
const char * namespace_
Definition rmw_entity.h:211
void * backend_data
Definition rmw_entity.h:216
uint8_t _reserved[8]
Definition rmw_entity.h:214
Definition rmw_entity.h:254
bool can_loan_messages
Definition rmw_entity.h:262
uint8_t _reserved[7]
Definition rmw_entity.h:264
const char * topic_name
Definition rmw_entity.h:256
void * backend_data
Definition rmw_entity.h:266
const char * type_name
Definition rmw_entity.h:258
nros_rmw_qos_t qos
Definition rmw_entity.h:260