nros C API
Lightweight ROS 2 client for embedded real-time systems
Loading...
Searching...
No Matches
publisher.h
Go to the documentation of this file.
1
9
10#ifndef NROS_PUBLISHER_H
11#define NROS_PUBLISHER_H
12
13/* Type and function definitions live in <rclc/detail/nros_generated.h>.
14 * This per-module header is kept as a thin shim so existing code that
15 * does `#include <rclc/publisher.h>` continues to compile. */
16#include "rclc/types.h"
17
28#ifndef NROS_NO_DEPRECATED_PUBLISH_RAW_ALIAS
29#if defined(__GNUC__) || defined(__clang__)
30// Renamed; see the message below.
31__attribute__((deprecated("renamed to rclc_publish_serialized; call that instead")))
32#endif
33static inline rcl_ret_t
34rclc_publish_raw(const rcl_publisher_t* publisher, const uint8_t* data, size_t len) {
35 return rclc_publish_serialized(publisher, data, len);
36}
37#endif /* NROS_NO_DEPRECATED_PUBLISH_RAW_ALIAS */
38
76 const struct rcl_node_t* node,
77 const struct rclc_message_type_t* type_info,
78 const char* topic_name) {
79 return rclc_publisher_init_with_qos(publisher, node, type_info, topic_name,
81}
82
83#endif /* NROS_PUBLISHER_H */
84
85/* Every upstream-path header carries the whole C API, as `<rclc/rclc.h>` does:
86 * a ported file that includes only `<rclc/publisher.h>` still finds
87 * `RCLC_CHECK_RET`, `RCLC_LOG_*` and the rcl spellings. Outside the guard, so
88 * this header's own declarations are complete before the umbrella reads them. */
89#include "rclc/rclc.h"
rcl_ret_t rclc_publisher_init_with_qos(struct rcl_publisher_t *publisher, const struct rcl_node_t *node, const struct rclc_message_type_t *type_info, const char *topic_name, const struct rclc_qos_t *qos)
rcl_ret_t rclc_publish_serialized(const struct rcl_publisher_t *publisher, const uint8_t *data, size_t len)
const struct rclc_qos_t RCLC_QOS_SENSOR_DATA
int rcl_ret_t
Definition nros_generated.h:993
static rcl_ret_t rclc_publish_raw(const rcl_publisher_t *publisher, const uint8_t *data, size_t len)
Deprecated: renamed to rclc_publish_serialized().
Definition publisher.h:34
static rcl_ret_t rclc_publisher_init_best_effort(struct rcl_publisher_t *publisher, const struct rcl_node_t *node, const struct rclc_message_type_t *type_info, const char *topic_name)
rclc's best-effort preset constructor for a publisher.
Definition publisher.h:75
Umbrella header for the nano-ros C API, at upstream's path.
Definition nros_generated.h:1625
Definition nros_generated.h:2469
Definition nros_generated.h:2252
Shared types and constants for the nros C API.