Would it be possible to add an the epoch timestamp along with the duration based mode for ousterFileReader?

1 次查看(过去 30 天)
Would it be possible to add an arguement to allow absolute time in the form of an epoch time to be imported in the ousterFileReader object along with the relative "duration" time?

回答(1 个)

Yatharth
Yatharth 2023-8-28
Hi, I understand that you need an "absoluteTime" property along with already exisiting "Duration" property for "ousterFileReader".
To achieve this, you can modify the ousterFileReader class or create a wrapper class that extends it. Here's an example of how you can implement this:
classdef CustomOusterFileReader < ousterFileReader
properties
absoluteTime % Absolute time in epoch format
end
methods
function obj = CustomOusterFileReader(filename, duration, absoluteTime)
% Call the superclass constructor
obj@ousterFileReader(filename, duration);
% Assign the absolute time property
obj.absoluteTime = absoluteTime;
end
end
end
In this example, we create a new class called CustomOusterFileReader that extends the ousterFileReader class. We add a new property absoluteTime to store the absolute time in epoch format. While creating the object for CustomOusterFileReader you'll need to provide three inputs filename, duration, absoluteTime.
You can also refer to the ousterFileReader documentation and use properties like "StartTime" , "EndTime" they might be useful according to your need.

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by