[C++] Get timestamp of last received telemetry


I saw how to get timestamp of last received telemetry (Get timestamp of last received telemetry) and I’m now wondering how to get same in C++.

I have 2 consumer_reg_struct_ptr to cv@hello and drone_controller.

When I execute tlm_consumer_get_sample(consumer, NULL, TLM_LATEST), it fill my telemetry struct. How can I get the timestamp of the two different telemetry that has been get during get_sample. If drone telemetry publish at 200Hz and my CV algorithm at 30Hz, I should have 2 different timestamp for each telemetry message I got.

Any ideas ?


Hi Clément,

You can switch from a struct description to:


Specify each field using TLM_CONSUMER_REG_ENTRY_SCALAR macro and setting a pointer pointing to a timestamp of type ‘struct timespec’ for each field.

libtelemtry is stil not up to date on github so you will have to check directly the header (libtelemetry.h) from the sdk to get information about the available macros.

The consumer registering will have to be done using: Library API - 7.3


I’ll try to do it and post my code if I succeed :smiley:


This topic was automatically closed after 30 days. New replies are no longer allowed.