How to extract data from an XCDR recorded file?

3 posts / 0 new
Last post
Offline
Last seen: 8 months 1 week ago
Joined: 07/22/2019
Posts: 11
How to extract data from an XCDR recorded file?

Hi,  

I was wondering if there's a way I can extract a sample (for example first and last sample) from an XCDR log file generated using the Recording Service?

I understand this can be done if I use the Converter service and convert my log file into JSON format. However I'm using rather large data, and the process of converting the whole log file will take significant time when I just need to extract a few samples from that file. 

I tried to look into the Recording Service API, but I couldn't really find any good examples to follow. Do you know if this possible using the Recording Service API or some other RTI tool?

 

Thank you,

David

Offline
Last seen: 1 month 1 week ago
Joined: 01/15/2013
Posts: 92

Hi,

Data selection, for the moment, works by selecting time ranges. If you know the sample's timestamp (reception timestamp) then you can extract samples with that timestamp from the DB using Converter (of course you can use topics or topic groups to restrict the topics you want extracted). To extract the first and last sample you'll have to run Converter twice. For more information, see the <data_selection> tag documentation in the User's Manual.

Now, as to the Recording Service API, we're mostly talking about implementing the Storage Writer API and to use it in Converter. There is an example in the community: https://github.com/rticommunity/rticonnextdds-examples/tree/master/examples/recording_service/pluggable_storage. Implementing this API would allow you to export the data in any format you like, e.g. CSV, plain XML, plain JSON (not an SQLite JSON DB, like our default).

Thanks,

Juanlu

Offline
Last seen: 7 months 2 weeks ago
Joined: 02/12/2020
Posts: 1

Hi,

Currently records are serialized into XCDR2 correct? Is there any way to parse this quickly using Python? That way I don't have to use Converter to bring it into some other format, the record itself becomes sufficient (and useful).

Thank you,

Abhii