401c844fcc
Big waves. This function wraps the operation of getting a stimframe from the SpMcRingBuffer, and then eventually assigning it a SimultaneityStamp. For now we just always pass in the first stim frame and we don't get any simulstamps. Its callOriginalCallback() automatically calls allowNextStimulusFrame() to ensure that it doesn't deadlock future timeslices.
71 lines
2.0 KiB
C++
71 lines
2.0 KiB
C++
#ifndef _LIVOX_GEN1_PCLOUD_STIMULUS_BUFFER_H
|
|
#define _LIVOX_GEN1_PCLOUD_STIMULUS_BUFFER_H
|
|
|
|
#include <functional>
|
|
#include <user/stimulusBuffer.h>
|
|
#include <livoxProto1/device.h>
|
|
#include <asynchronousContinuation.h>
|
|
#include <callback.h>
|
|
#include "stagingBuffer.h"
|
|
#include "ioUringAssemblyEngine.h"
|
|
#include "openClCollatingAndMeshingEngine.h"
|
|
|
|
namespace smo {
|
|
namespace stim_buff {
|
|
|
|
/**
|
|
* PcloudStimulusBuffer is a specialized StimulusBuffer for point cloud data.
|
|
*
|
|
* This class extends StimulusBuffer to handle point cloud-specific stimulus
|
|
* frames, particularly those generated from LiDAR point cloud data. It
|
|
* provides additional functionality for managing point cloud frame metadata
|
|
* and processing.
|
|
*/
|
|
class PcloudStimulusBuffer
|
|
: public StimulusBuffer
|
|
{
|
|
public:
|
|
explicit PcloudStimulusBuffer(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
|
std::shared_ptr<livoxProto1::Device> &device,
|
|
const PcloudFormatDesc& formatDesc,
|
|
int histbuffMs,
|
|
size_t nDgramsPerStagingBufferFrame);
|
|
|
|
~PcloudStimulusBuffer() = default;
|
|
|
|
// Non-copyable, movable
|
|
PcloudStimulusBuffer(const PcloudStimulusBuffer&) = delete;
|
|
PcloudStimulusBuffer& operator=(const PcloudStimulusBuffer&) = delete;
|
|
PcloudStimulusBuffer(PcloudStimulusBuffer&&) = default;
|
|
PcloudStimulusBuffer& operator=(PcloudStimulusBuffer&&) = default;
|
|
|
|
// Control methods
|
|
void start() override;
|
|
void stop() override;
|
|
|
|
protected:
|
|
void stimFrameProductionTimesliceInd() override;
|
|
|
|
// Callback function type for produceFrameReq
|
|
typedef std::function<void()> produceFrameReqCbFn;
|
|
|
|
public:
|
|
void produceFrameReq(smo::Callback<produceFrameReqCbFn> callback);
|
|
|
|
std::shared_ptr<livoxProto1::Device> device;
|
|
PcloudFormatDesc formatDesc;
|
|
OpenClCollatingAndMeshingEngine openClCollatingAndMeshingEngine;
|
|
StagingBuffer assemblyBuffer;
|
|
IoUringAssemblyEngine ioUringAssemblyEngine;
|
|
StagingBuffer collationBuffer;
|
|
|
|
private:
|
|
class ProduceFrameReq;
|
|
};
|
|
|
|
} // namespace stim_buff
|
|
} // namespace smo
|
|
|
|
#endif // _LIVOX_GEN1_PCLOUD_STIMULUS_BUFFER_H
|