98a493a8a1
* PcloudStimulusProducer now has member sh_ptr<StimulusBuffer>s. * StimulusProducer now has a vector<sh_ptr<StimulusBuffer>s. Created new stimbuff-type-specific Pcloud[Xyz|I|Ambience]StimulusBuffer classes for representing each stim feature exposed by livoxGen1's PcloudStimulusProducer.
94 lines
2.5 KiB
C++
94 lines
2.5 KiB
C++
#ifndef _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
|
#define _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
|
|
|
#include <functional>
|
|
#include <atomic>
|
|
#include <user/stimulusProducer.h>
|
|
#include <user/stimulusFrame.h>
|
|
#include <livoxProto1/device.h>
|
|
#include <asynchronousContinuation.h>
|
|
#include <callback.h>
|
|
#include "stagingBuffer.h"
|
|
#include "ioUringAssemblyEngine.h"
|
|
#include "openClCollatingAndMeshingEngine.h"
|
|
#include "pcloudXyzStimulusBuffer.h"
|
|
#include "pcloudIStimulusBuffer.h"
|
|
#include "pcloudAmbienceStimulusBuffer.h"
|
|
|
|
namespace smo {
|
|
namespace stim_buff {
|
|
|
|
/**
|
|
* PcloudDataProducer is a specialized StimulusProducer for point cloud data.
|
|
*
|
|
* This class extends StimulusProducer 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 PcloudDataProducer
|
|
: public StimulusProducer
|
|
{
|
|
public:
|
|
class PcloudFormatDesc
|
|
{
|
|
public:
|
|
enum class Format
|
|
{
|
|
XYZ,
|
|
XYZI,
|
|
};
|
|
|
|
public:
|
|
Format format;
|
|
};
|
|
|
|
public:
|
|
explicit PcloudDataProducer(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
|
std::shared_ptr<livoxProto1::Device> &device,
|
|
const PcloudFormatDesc& formatDesc,
|
|
size_t nDgramsPerStagingBufferFrame);
|
|
|
|
~PcloudDataProducer() = default;
|
|
|
|
// Non-copyable, movable
|
|
PcloudDataProducer(const PcloudDataProducer&) = delete;
|
|
PcloudDataProducer& operator=(const PcloudDataProducer&) = delete;
|
|
PcloudDataProducer(PcloudDataProducer&&) = default;
|
|
PcloudDataProducer& operator=(PcloudDataProducer&&) = 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;
|
|
StimulusFrame tempStimulusFrame;
|
|
|
|
std::shared_ptr<PcloudXyzStimulusBuffer> xyzStimulusBuffer;
|
|
std::shared_ptr<PcloudIStimulusBuffer> iStimulusBuffer;
|
|
std::shared_ptr<PcloudAmbienceStimulusBuffer> ambienceStimulusBuffer;
|
|
|
|
private:
|
|
class ProduceFrameReq;
|
|
};
|
|
|
|
} // namespace stim_buff
|
|
} // namespace smo
|
|
|
|
#endif // _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|