Rename PcloudDataProducer=>PcloudStimulusProducer
This commit is contained in:
@@ -59,7 +59,7 @@ if(ENABLE_STIMBUFFAPI_livoxGen1)
|
|||||||
add_library(livoxGen1 SHARED
|
add_library(livoxGen1 SHARED
|
||||||
livoxGen1.cpp
|
livoxGen1.cpp
|
||||||
stagingBuffer.cpp
|
stagingBuffer.cpp
|
||||||
pcloudDataProducer.cpp
|
pcloudStimulusProducer.cpp
|
||||||
ioUringAssemblyEngine.cpp
|
ioUringAssemblyEngine.cpp
|
||||||
openClCollatingAndMeshingEngine.cpp
|
openClCollatingAndMeshingEngine.cpp
|
||||||
openClKernels.cl.S
|
openClKernels.cl.S
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <callableTracer.h>
|
#include <callableTracer.h>
|
||||||
#include <spinLock.h>
|
#include <spinLock.h>
|
||||||
#include "ioUringAssemblyEngine.h"
|
#include "ioUringAssemblyEngine.h"
|
||||||
#include "pcloudDataProducer.h"
|
#include "pcloudStimulusProducer.h"
|
||||||
#include "livoxGen1.h"
|
#include "livoxGen1.h"
|
||||||
|
|
||||||
// #define REGISTER_IOURING_BUFFERS
|
// #define REGISTER_IOURING_BUFFERS
|
||||||
@@ -56,7 +56,7 @@ struct DummyLivoxEthHeader
|
|||||||
};
|
};
|
||||||
|
|
||||||
IoUringAssemblyEngine::IoUringAssemblyEngine(
|
IoUringAssemblyEngine::IoUringAssemblyEngine(
|
||||||
PcloudDataProducer& parent_, size_t nDgramsPerStagingBufferFrame_)
|
PcloudStimulusProducer& parent_, size_t nDgramsPerStagingBufferFrame_)
|
||||||
: parent(parent_),
|
: parent(parent_),
|
||||||
frameAssemblyDesc(nullptr), ring{},
|
frameAssemblyDesc(nullptr), ring{},
|
||||||
eventfdFd(-1), eventfdDesc(nullptr), eventfd_value(0),
|
eventfdFd(-1), eventfdDesc(nullptr), eventfd_value(0),
|
||||||
|
|||||||
@@ -24,13 +24,13 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
class PcloudDataProducer;
|
class PcloudStimulusProducer;
|
||||||
|
|
||||||
class IoUringAssemblyEngine
|
class IoUringAssemblyEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit IoUringAssemblyEngine(
|
explicit IoUringAssemblyEngine(
|
||||||
PcloudDataProducer& parent, size_t nDgramsPerStagingBufferFrame);
|
PcloudStimulusProducer& parent, size_t nDgramsPerStagingBufferFrame);
|
||||||
~IoUringAssemblyEngine() = default;
|
~IoUringAssemblyEngine() = default;
|
||||||
|
|
||||||
bool setup();
|
bool setup();
|
||||||
@@ -53,7 +53,7 @@ private:
|
|||||||
bool stop();
|
bool stop();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PcloudDataProducer& parent;
|
PcloudStimulusProducer& parent;
|
||||||
|
|
||||||
// Cached descriptor for reuse across iterations
|
// Cached descriptor for reuse across iterations
|
||||||
std::shared_ptr<FrameAssemblyDesc> frameAssemblyDesc;
|
std::shared_ptr<FrameAssemblyDesc> frameAssemblyDesc;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <livoxProto1/protocol.h>
|
#include <livoxProto1/protocol.h>
|
||||||
#include <asynchronousContinuation.h>
|
#include <asynchronousContinuation.h>
|
||||||
#include <boost/asio/deadline_timer.hpp>
|
#include <boost/asio/deadline_timer.hpp>
|
||||||
#include "pcloudDataProducer.h"
|
#include "pcloudStimulusProducer.h"
|
||||||
#include "livoxGen1.h"
|
#include "livoxGen1.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const std::shared_ptr<smo::device::DeviceAttachmentSpec> spec;
|
const std::shared_ptr<smo::device::DeviceAttachmentSpec> spec;
|
||||||
std::shared_ptr<PcloudDataProducer> stimProducer;
|
std::shared_ptr<PcloudStimulusProducer> stimProducer;
|
||||||
std::shared_ptr<livoxProto1::Device> deviceTmp;
|
std::shared_ptr<livoxProto1::Device> deviceTmp;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -197,10 +197,12 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and add PcloudDataProducer to collection now that device is ready
|
// Create and add PcloudStimulusProducer to collection now that device is ready
|
||||||
PcloudDataProducer::PcloudFormatDesc formatDesc;
|
PcloudStimulusProducer::PcloudFormatDesc formatDesc;
|
||||||
formatDesc.format = PcloudDataProducer::PcloudFormatDesc::Format::XYZI;
|
formatDesc.format = PcloudStimulusProducer::PcloudFormatDesc::Format
|
||||||
auto pcloudDataProducer = std::make_shared<PcloudDataProducer>(
|
::XYZI;
|
||||||
|
|
||||||
|
auto pcloudDataProducer = std::make_shared<PcloudStimulusProducer>(
|
||||||
context->spec, context->deviceTmp, formatDesc, 30);
|
context->spec, context->deviceTmp, formatDesc, 30);
|
||||||
|
|
||||||
context->stimProducer = pcloudDataProducer;
|
context->stimProducer = pcloudDataProducer;
|
||||||
@@ -284,7 +286,7 @@ class DetachDeviceReq
|
|||||||
public:
|
public:
|
||||||
DetachDeviceReq(
|
DetachDeviceReq(
|
||||||
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& spec,
|
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& spec,
|
||||||
const std::shared_ptr<PcloudDataProducer>& stimProducer,
|
const std::shared_ptr<PcloudStimulusProducer>& stimProducer,
|
||||||
smo::Callback<sal_mlo_detachDeviceReqCbFn> cb)
|
smo::Callback<sal_mlo_detachDeviceReqCbFn> cb)
|
||||||
: smo::NonPostedAsynchronousContinuation<sal_mlo_detachDeviceReqCbFn>(
|
: smo::NonPostedAsynchronousContinuation<sal_mlo_detachDeviceReqCbFn>(
|
||||||
std::move(cb)),
|
std::move(cb)),
|
||||||
@@ -293,7 +295,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const std::shared_ptr<smo::device::DeviceAttachmentSpec> spec;
|
const std::shared_ptr<smo::device::DeviceAttachmentSpec> spec;
|
||||||
std::shared_ptr<PcloudDataProducer> stimProducer;
|
std::shared_ptr<PcloudStimulusProducer> stimProducer;
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<boost::asio::deadline_timer> delayTimer;
|
std::unique_ptr<boost::asio::deadline_timer> delayTimer;
|
||||||
|
|
||||||
@@ -522,7 +524,7 @@ extern "C" void livoxGen1_attachDeviceReq(
|
|||||||
auto request = std::make_shared<AttachDeviceReq>(desc, cb);
|
auto request = std::make_shared<AttachDeviceReq>(desc, cb);
|
||||||
|
|
||||||
// Check if stimulus producer already exists in the collection
|
// Check if stimulus producer already exists in the collection
|
||||||
auto pcloudDataProducer = std::static_pointer_cast<PcloudDataProducer>(
|
auto pcloudDataProducer = std::static_pointer_cast<PcloudStimulusProducer>(
|
||||||
getStimulusProducer(desc));
|
getStimulusProducer(desc));
|
||||||
|
|
||||||
if (pcloudDataProducer)
|
if (pcloudDataProducer)
|
||||||
@@ -653,7 +655,7 @@ extern "C" void livoxGen1_detachDeviceReq(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Check if stimulus producer exists in the collection
|
// Check if stimulus producer exists in the collection
|
||||||
auto stimProducer = std::static_pointer_cast<PcloudDataProducer>(
|
auto stimProducer = std::static_pointer_cast<PcloudStimulusProducer>(
|
||||||
getStimulusProducer(desc));
|
getStimulusProducer(desc));
|
||||||
|
|
||||||
if (!stimProducer)
|
if (!stimProducer)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <user/stimulusFrame.h>
|
#include <user/stimulusFrame.h>
|
||||||
#include "livoxGen1.h"
|
#include "livoxGen1.h"
|
||||||
#include "openClCollatingAndMeshingEngine.h"
|
#include "openClCollatingAndMeshingEngine.h"
|
||||||
#include "pcloudDataProducer.h"
|
#include "pcloudStimulusProducer.h"
|
||||||
#include "openClKernels.h"
|
#include "openClKernels.h"
|
||||||
#include "frameAssemblyDesc.h"
|
#include "frameAssemblyDesc.h"
|
||||||
#include "ioUringAssemblyEngine.h"
|
#include "ioUringAssemblyEngine.h"
|
||||||
@@ -82,7 +82,7 @@ static bool validateOpenClVersion(
|
|||||||
}
|
}
|
||||||
|
|
||||||
OpenClCollatingAndMeshingEngine::OpenClCollatingAndMeshingEngine(
|
OpenClCollatingAndMeshingEngine::OpenClCollatingAndMeshingEngine(
|
||||||
PcloudDataProducer& parent_)
|
PcloudStimulusProducer& parent_)
|
||||||
: parent(parent_),
|
: parent(parent_),
|
||||||
platform(nullptr),
|
platform(nullptr),
|
||||||
device(nullptr),
|
device(nullptr),
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
class PcloudDataProducer;
|
class PcloudStimulusProducer;
|
||||||
|
|
||||||
class OpenClCollatingAndMeshingEngine
|
class OpenClCollatingAndMeshingEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit OpenClCollatingAndMeshingEngine(PcloudDataProducer& parent);
|
explicit OpenClCollatingAndMeshingEngine(PcloudStimulusProducer& parent);
|
||||||
~OpenClCollatingAndMeshingEngine();
|
~OpenClCollatingAndMeshingEngine();
|
||||||
|
|
||||||
// Non-copyable, movable
|
// Non-copyable, movable
|
||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
std::chrono::milliseconds getCollateKernelDuration() const;
|
std::chrono::milliseconds getCollateKernelDuration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PcloudDataProducer& parent;
|
PcloudStimulusProducer& parent;
|
||||||
|
|
||||||
// OpenCL infrastructure
|
// OpenCL infrastructure
|
||||||
cl_platform_id platform;
|
cl_platform_id platform;
|
||||||
|
|||||||
+10
-10
@@ -7,7 +7,7 @@
|
|||||||
#include <componentThread.h>
|
#include <componentThread.h>
|
||||||
#include <asynchronousLoop.h>
|
#include <asynchronousLoop.h>
|
||||||
#include <user/stimulusFrame.h>
|
#include <user/stimulusFrame.h>
|
||||||
#include "pcloudDataProducer.h"
|
#include "pcloudStimulusProducer.h"
|
||||||
#include "frameAssemblyDesc.h"
|
#include "frameAssemblyDesc.h"
|
||||||
|
|
||||||
namespace smo {
|
namespace smo {
|
||||||
@@ -19,7 +19,7 @@ extern const SmoCallbacks* smoHooksPtr;
|
|||||||
static SpMcRingBuffer::InputEngineConstraints openClInputConstraints(
|
static SpMcRingBuffer::InputEngineConstraints openClInputConstraints(
|
||||||
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), sizeof(void *));
|
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), sizeof(void *));
|
||||||
|
|
||||||
PcloudDataProducer::PcloudDataProducer(
|
PcloudStimulusProducer::PcloudStimulusProducer(
|
||||||
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
||||||
std::shared_ptr<livoxProto1::Device> &device,
|
std::shared_ptr<livoxProto1::Device> &device,
|
||||||
const PcloudFormatDesc& formatDesc,
|
const PcloudFormatDesc& formatDesc,
|
||||||
@@ -58,7 +58,7 @@ collationBuffer(
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
std::string errMsg = std::string(__func__) +
|
std::string errMsg = std::string(__func__) +
|
||||||
": PcloudDataProducer constructor called on non-world/body thread " +
|
": PcloudStimulusProducer constructor called on non-world/body thread " +
|
||||||
smoHooksPtr->ComponentThread_getSelf()->name;
|
smoHooksPtr->ComponentThread_getSelf()->name;
|
||||||
|
|
||||||
std::cout << errMsg << std::endl;
|
std::cout << errMsg << std::endl;
|
||||||
@@ -66,7 +66,7 @@ collationBuffer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PcloudDataProducer::start()
|
void PcloudStimulusProducer::start()
|
||||||
{
|
{
|
||||||
// Call ioUringAssemblyEngine setup() as the first step
|
// Call ioUringAssemblyEngine setup() as the first step
|
||||||
if (!ioUringAssemblyEngine.setup())
|
if (!ioUringAssemblyEngine.setup())
|
||||||
@@ -87,7 +87,7 @@ void PcloudDataProducer::start()
|
|||||||
StimulusProducer::start();
|
StimulusProducer::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PcloudDataProducer::stop()
|
void PcloudStimulusProducer::stop()
|
||||||
{
|
{
|
||||||
// Call base class stop() as the first step
|
// Call base class stop() as the first step
|
||||||
StimulusProducer::stop();
|
StimulusProducer::stop();
|
||||||
@@ -100,22 +100,22 @@ void produceStimFrameAck(void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void PcloudDataProducer::stimFrameProductionTimesliceInd()
|
void PcloudStimulusProducer::stimFrameProductionTimesliceInd()
|
||||||
{
|
{
|
||||||
produceFrameReq({nullptr, nullptr});
|
produceFrameReq({nullptr, nullptr});
|
||||||
}
|
}
|
||||||
|
|
||||||
class PcloudDataProducer::ProduceFrameReq
|
class PcloudStimulusProducer::ProduceFrameReq
|
||||||
: public PostedAsynchronousContinuation<produceFrameReqCbFn>
|
: public PostedAsynchronousContinuation<produceFrameReqCbFn>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
PcloudDataProducer& pcloudProducer;
|
PcloudStimulusProducer& pcloudProducer;
|
||||||
AsynchronousLoop frameAssemblyResult;
|
AsynchronousLoop frameAssemblyResult;
|
||||||
StimulusFrame& stimulusFrame;
|
StimulusFrame& stimulusFrame;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProduceFrameReq(
|
ProduceFrameReq(
|
||||||
PcloudDataProducer& producer,
|
PcloudStimulusProducer& producer,
|
||||||
const std::shared_ptr<ComponentThread>& caller,
|
const std::shared_ptr<ComponentThread>& caller,
|
||||||
Callback<produceFrameReqCbFn> cb)
|
Callback<produceFrameReqCbFn> cb)
|
||||||
: PostedAsynchronousContinuation<produceFrameReqCbFn>(caller, cb),
|
: PostedAsynchronousContinuation<produceFrameReqCbFn>(caller, cb),
|
||||||
@@ -204,7 +204,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void PcloudDataProducer::produceFrameReq(
|
void PcloudStimulusProducer::produceFrameReq(
|
||||||
smo::Callback<produceFrameReqCbFn> callback)
|
smo::Callback<produceFrameReqCbFn> callback)
|
||||||
{
|
{
|
||||||
/** EXPLANATION:
|
/** EXPLANATION:
|
||||||
+11
-12
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
#ifndef _LIVOX_GEN1_PCLOUD_STIMULUS_PRODUCER_H
|
||||||
#define _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
#define _LIVOX_GEN1_PCLOUD_STIMULUS_PRODUCER_H
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@@ -19,14 +19,14 @@ namespace smo {
|
|||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PcloudDataProducer is a specialized StimulusProducer for point cloud data.
|
* PcloudStimulusProducer is a specialized StimulusProducer for point cloud data.
|
||||||
*
|
*
|
||||||
* This class extends StimulusProducer to handle point cloud-specific stimulus
|
* This class extends StimulusProducer to handle point cloud-specific stimulus
|
||||||
* frames, particularly those generated from LiDAR point cloud data. It
|
* frames, particularly those generated from LiDAR point cloud data. It
|
||||||
* provides additional functionality for managing point cloud frame metadata
|
* provides additional functionality for managing point cloud frame metadata
|
||||||
* and processing.
|
* and processing.
|
||||||
*/
|
*/
|
||||||
class PcloudDataProducer
|
class PcloudStimulusProducer
|
||||||
: public StimulusProducer
|
: public StimulusProducer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -44,19 +44,19 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PcloudDataProducer(
|
explicit PcloudStimulusProducer(
|
||||||
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
||||||
std::shared_ptr<livoxProto1::Device> &device,
|
std::shared_ptr<livoxProto1::Device> &device,
|
||||||
const PcloudFormatDesc& formatDesc,
|
const PcloudFormatDesc& formatDesc,
|
||||||
size_t nDgramsPerStagingBufferFrame);
|
size_t nDgramsPerStagingBufferFrame);
|
||||||
|
|
||||||
~PcloudDataProducer() = default;
|
~PcloudStimulusProducer() = default;
|
||||||
|
|
||||||
// Non-copyable, movable
|
// Non-copyable, movable
|
||||||
PcloudDataProducer(const PcloudDataProducer&) = delete;
|
PcloudStimulusProducer(const PcloudStimulusProducer&) = delete;
|
||||||
PcloudDataProducer& operator=(const PcloudDataProducer&) = delete;
|
PcloudStimulusProducer& operator=(const PcloudStimulusProducer&) = delete;
|
||||||
PcloudDataProducer(PcloudDataProducer&&) = default;
|
PcloudStimulusProducer(PcloudStimulusProducer&&) = default;
|
||||||
PcloudDataProducer& operator=(PcloudDataProducer&&) = default;
|
PcloudStimulusProducer& operator=(PcloudStimulusProducer&&) = default;
|
||||||
|
|
||||||
// Control methods
|
// Control methods
|
||||||
void start() override;
|
void start() override;
|
||||||
@@ -78,7 +78,6 @@ public:
|
|||||||
IoUringAssemblyEngine ioUringAssemblyEngine;
|
IoUringAssemblyEngine ioUringAssemblyEngine;
|
||||||
StagingBuffer collationBuffer;
|
StagingBuffer collationBuffer;
|
||||||
StimulusFrame tempStimulusFrame;
|
StimulusFrame tempStimulusFrame;
|
||||||
|
|
||||||
std::shared_ptr<PcloudXyzStimulusBuffer> xyzStimulusBuffer;
|
std::shared_ptr<PcloudXyzStimulusBuffer> xyzStimulusBuffer;
|
||||||
std::shared_ptr<PcloudIStimulusBuffer> iStimulusBuffer;
|
std::shared_ptr<PcloudIStimulusBuffer> iStimulusBuffer;
|
||||||
std::shared_ptr<PcloudAmbienceStimulusBuffer> ambienceStimulusBuffer;
|
std::shared_ptr<PcloudAmbienceStimulusBuffer> ambienceStimulusBuffer;
|
||||||
@@ -90,4 +89,4 @@ private:
|
|||||||
} // namespace stim_buff
|
} // namespace stim_buff
|
||||||
} // namespace smo
|
} // namespace smo
|
||||||
|
|
||||||
#endif // _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
#endif // _LIVOX_GEN1_PCLOUD_STIMULUS_PRODUCER_H
|
||||||
Reference in New Issue
Block a user