update for fixes in Cyclone sertopic interface
This commit is contained in:
parent
d298359822
commit
b925d5591c
2 changed files with 12 additions and 11 deletions
|
@ -475,7 +475,7 @@ static CddsPublisher *create_cdds_publisher (const rmw_node_t *node, const rosid
|
|||
std::string fqtopic_name = make_fqtopic (ros_topic_prefix, topic_name, "", qos_policies);
|
||||
|
||||
auto sertopic = create_sertopic (fqtopic_name.c_str (), type_support->typesupport_identifier, create_message_type_support (type_support->data, type_support->typesupport_identifier), false);
|
||||
if ((topic = dds_create_topic_arbitrary (gcdds.ppant, sertopic, fqtopic_name.c_str (), nullptr, nullptr, nullptr)) < 0) {
|
||||
if ((topic = dds_create_topic_arbitrary (gcdds.ppant, sertopic, nullptr, nullptr, nullptr)) < 0) {
|
||||
RMW_SET_ERROR_MSG ("failed to create topic");
|
||||
goto fail_topic;
|
||||
}
|
||||
|
@ -604,7 +604,7 @@ static CddsSubscription *create_cdds_subscription (const rmw_node_t *node, const
|
|||
std::string fqtopic_name = make_fqtopic (ros_topic_prefix, topic_name, "", qos_policies);
|
||||
|
||||
auto sertopic = create_sertopic (fqtopic_name.c_str (), type_support->typesupport_identifier, create_message_type_support (type_support->data, type_support->typesupport_identifier), false);
|
||||
if ((topic = dds_create_topic_arbitrary (gcdds.ppant, sertopic, fqtopic_name.c_str (), nullptr, nullptr, nullptr)) < 0) {
|
||||
if ((topic = dds_create_topic_arbitrary (gcdds.ppant, sertopic, nullptr, nullptr, nullptr)) < 0) {
|
||||
RMW_SET_ERROR_MSG ("failed to create topic");
|
||||
goto fail_topic;
|
||||
}
|
||||
|
@ -1097,11 +1097,11 @@ static rmw_ret_t rmw_init_cs (CddsCS *cs, const rmw_node_t *node, const rosidl_s
|
|||
auto sub_st = create_sertopic (subtopic_name.c_str (), type_support->typesupport_identifier, sub_type_support, true);
|
||||
|
||||
dds_qos_t *qos;
|
||||
if ((pubtopic = dds_create_topic_arbitrary (gcdds.ppant, pub_st, pubtopic_name.c_str (), nullptr, nullptr, nullptr)) < 0) {
|
||||
if ((pubtopic = dds_create_topic_arbitrary (gcdds.ppant, pub_st, nullptr, nullptr, nullptr)) < 0) {
|
||||
RMW_SET_ERROR_MSG ("failed to create topic");
|
||||
goto fail_pubtopic;
|
||||
}
|
||||
if ((subtopic = dds_create_topic_arbitrary (gcdds.ppant, sub_st, subtopic_name.c_str (), nullptr, nullptr, nullptr)) < 0) {
|
||||
if ((subtopic = dds_create_topic_arbitrary (gcdds.ppant, sub_st, nullptr, nullptr, nullptr)) < 0) {
|
||||
RMW_SET_ERROR_MSG ("failed to create topic");
|
||||
goto fail_subtopic;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ static void serdata_rmw_free (struct ddsi_serdata *dcmn)
|
|||
delete d;
|
||||
}
|
||||
|
||||
static struct serdata_rmw *new_serdata_rmw (const struct ddsi_sertopic *topic, enum ddsi_serdata_kind kind)
|
||||
static struct serdata_rmw *rmw_serdata_new (const struct ddsi_sertopic *topic, enum ddsi_serdata_kind kind)
|
||||
{
|
||||
struct serdata_rmw *sd = new serdata_rmw;
|
||||
ddsi_serdata_init (sd, topic, kind);
|
||||
|
@ -104,7 +104,7 @@ static struct serdata_rmw *new_serdata_rmw (const struct ddsi_sertopic *topic, e
|
|||
|
||||
static struct ddsi_serdata *serdata_rmw_from_ser (const struct ddsi_sertopic *topic, enum ddsi_serdata_kind kind, const struct nn_rdata *fragchain, size_t size)
|
||||
{
|
||||
struct serdata_rmw *d = new_serdata_rmw (topic, kind);
|
||||
struct serdata_rmw *d = rmw_serdata_new (topic, kind);
|
||||
uint32_t off = 0;
|
||||
assert (fragchain->min == 0);
|
||||
assert (fragchain->maxp1 >= off); /* CDR header must be in first fragment */
|
||||
|
@ -124,13 +124,13 @@ static struct ddsi_serdata *serdata_rmw_from_ser (const struct ddsi_sertopic *to
|
|||
static struct ddsi_serdata *serdata_rmw_from_keyhash (const struct ddsi_sertopic *topic, const struct nn_keyhash *keyhash __attribute__ ((unused)))
|
||||
{
|
||||
/* there is no key field, so from_keyhash is trivial */
|
||||
return new_serdata_rmw (topic, SDK_KEY);
|
||||
return rmw_serdata_new (topic, SDK_KEY);
|
||||
}
|
||||
|
||||
static struct ddsi_serdata *serdata_rmw_from_sample (const struct ddsi_sertopic *topiccmn, enum ddsi_serdata_kind kind, const void *sample)
|
||||
{
|
||||
const struct sertopic_rmw *topic = static_cast<const struct sertopic_rmw *> (topiccmn);
|
||||
struct serdata_rmw *d = new_serdata_rmw (topic, kind);
|
||||
struct serdata_rmw *d = rmw_serdata_new (topic, kind);
|
||||
if (kind != SDK_DATA) {
|
||||
/* ROS2 doesn't do keys, so SDK_KEY is trivial */
|
||||
} else if (!topic->is_request_header) {
|
||||
|
@ -168,7 +168,7 @@ static struct ddsi_serdata *serdata_rmw_from_sample (const struct ddsi_sertopic
|
|||
static struct ddsi_serdata *serdata_rmw_to_topicless (const struct ddsi_serdata *dcmn)
|
||||
{
|
||||
const struct serdata_rmw *d = static_cast<const struct serdata_rmw *> (dcmn);
|
||||
struct serdata_rmw *d1 = new_serdata_rmw (d->topic, SDK_KEY);
|
||||
struct serdata_rmw *d1 = rmw_serdata_new (d->topic, SDK_KEY);
|
||||
d1->topic = nullptr;
|
||||
return d1;
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ static const struct ddsi_serdata_ops serdata_rmw_ops = {
|
|||
.free = serdata_rmw_free
|
||||
};
|
||||
|
||||
static void sertopic_rmw_deinit (struct ddsi_sertopic *tpcmn)
|
||||
static void sertopic_rmw_free (struct ddsi_sertopic *tpcmn)
|
||||
{
|
||||
struct sertopic_rmw *tp = static_cast<struct sertopic_rmw *> (tpcmn);
|
||||
delete tp;
|
||||
|
@ -278,10 +278,11 @@ static void sertopic_rmw_free_samples (const struct ddsi_sertopic *d __attribute
|
|||
/* Not using code paths that rely on this (dispose, unregister with instance handle, content
|
||||
filters) */
|
||||
assert (!(op & DDS_FREE_ALL_BIT));
|
||||
(void) op;
|
||||
}
|
||||
|
||||
static const struct ddsi_sertopic_ops sertopic_rmw_ops = {
|
||||
.deinit = sertopic_rmw_deinit,
|
||||
.free = sertopic_rmw_free,
|
||||
.zero_samples = sertopic_rmw_zero_samples,
|
||||
.realloc_samples = sertopic_rmw_realloc_samples,
|
||||
.free_samples = sertopic_rmw_free_samples
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue