update to allow talker/listener demos to run

This commit adds stubs for the missing functions and fixes a few bugs in
the serialisation code and topic creation.  With these changes, the
talker and listener demos of ROS2 Crystal Clemmys work.
This commit is contained in:
Erik Boasson 2019-05-03 17:12:51 +08:00
parent c9a23a9b8a
commit 315d39a2ec
4 changed files with 182 additions and 36 deletions

View file

@ -157,6 +157,11 @@ static struct ddsi_serdata *serdata_rmw_from_sample (const struct ddsi_sertopic
(void) typed_typesupport->serializeROSmessage (wrap->data, sd, prefix);
}
}
/* FIXME: CDR padding in DDSI makes me do this to avoid reading beyond the bounds of the vector
when copying data to network. Should fix Cyclone to handle that more elegantly. */
while (d->data.size () % 4) {
d->data.push_back (0);
}
return d;
}
@ -295,6 +300,8 @@ struct sertopic_rmw *create_sertopic (const char *topicname, const char *type_su
st->name = const_cast<char *> (st->cpp_name.c_str ());
st->type_name = const_cast<char *> (st->cpp_type_name.c_str ());
st->iid = ddsi_iid_gen ();
st->status_cb = nullptr;
st->status_cb_entity = nullptr; /* set by dds_create_topic_arbitrary */
ddsrt_atomic_st32 (&st->refc, 1);
st->type_support.typesupport_identifier_ = type_support_identifier;