zenoh: update zenoh-pico from 0.7.0 to 1.0.0 (#23462)

* Update Zenoh-pico from 0.7.0 to 1.0.0
* Update the zenoh-pico version to use PX4/dev/1.0.0-px4
* Remove the rostopic and rt/ prefix
 * Unlike zenoh-bridge-dds we were using, zenoh-bridge-ros2dds is now adding the rt/ prefix automagically.
This commit is contained in:
Alexis Paques
2024-08-02 11:48:55 -04:00
committed by GitHub
parent 75ce550db3
commit abc629c2bb
12 changed files with 82 additions and 80 deletions
@@ -50,7 +50,7 @@ class uORB_Zenoh_Subscriber : public Zenoh_Subscriber
{
public:
uORB_Zenoh_Subscriber(const orb_metadata *meta, const uint32_t *ops) :
Zenoh_Subscriber(true),
Zenoh_Subscriber(),
_uorb_meta{meta},
_cdr_ops(ops)
{
@@ -61,11 +61,14 @@ public:
~uORB_Zenoh_Subscriber() override = default;
// Update the uORB Subscription and broadcast a Zenoh ROS2 message
void data_handler(const z_sample_t *sample)
void data_handler(const z_loaned_sample_t *sample)
{
char data[_uorb_meta->o_size];
dds_istream_t is = {.m_buffer = (unsigned char *)(sample->payload.start), .m_size = static_cast<int>(sample->payload.len),
const z_loaned_bytes_t *payload = z_sample_payload(sample);
size_t len = z_bytes_len(payload);
dds_istream_t is = {.m_buffer = (unsigned char *)(payload), .m_size = static_cast<int>(len),
.m_index = 4, .m_xcdr_version = DDSI_RTPS_CDR_ENC_VERSION_2
};
dds_stream_read(&is, data, &dds_allocator, _cdr_ops);