32#include <VisionX/interface/core/DataTypes.h>
33#include <VisionX/interface/core/PointCloudProcessorInterface.h>
34#include <VisionX/interface/core/PointCloudProviderInterface.h>
60 virtual public PointCloudProviderInterface
72 const Ice::Current&
c = Ice::emptyCurrent)
override;
77 MetaPointCloudFormatPtr
88 const Ice::Current&
c = Ice::emptyCurrent);
120 template <
typename Po
intCloudPtrT>
124 using PointCloudT =
typename PointCloudPtrT::element_type;
125 using PointT =
typename PointCloudT::PointType;
127 if (!sharedMemoryProvider)
129 ARMARX_WARNING <<
"Shared memory provider is null (possibly shutting down)";
132 MetaPointCloudFormatPtr info(MetaPointCloudFormatPtr::dynamicCast(
133 sharedMemoryProvider->getMetaInfo()->ice_clone()));
136 info->size = pointCloudPtr->width * pointCloudPtr->height *
139 if (info->size > info->capacity)
141 const size_t maxPoints =
144 <<
"Exceeding the capacity limit of supported points (" << (maxPoints)
145 <<
" points). The provided point cloud contains "
146 << pointCloudPtr->width * pointCloudPtr->height
147 <<
" points. Cropping the point cloud to fit into limit.";
149 pointCloudPtr->width = maxPoints;
150 pointCloudPtr->height = 1;
151 pointCloudPtr->resize(maxPoints);
155 info->width = pointCloudPtr->width;
156 info->height = pointCloudPtr->height;
158 if (pointCloudPtr->header.stamp)
160 info->timeProvided = pointCloudPtr->header.stamp;
167 if (pointCloudPtr->header.seq)
169 info->seq = pointCloudPtr->header.seq;
183 auto buf = intermediateBuffer.data();
188 sharedMemoryProvider->getScopedWriteLock());
190 sharedMemoryProvider->setMetaInfo(info,
false);
192 unsigned char* buffer = sharedMemoryProvider->getBuffer();
194 memcpy(buffer, intermediateBuffer.data(), info->size);
250 sharedMemoryProvider;
255 MetaPointCloudFormatPtr pointCloudFormat;
265 std::vector<unsigned char> intermediateBuffer;
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Baseclass for all ArmarX ManagedIceObjects requiring properties.
IceUtil::Handle< IceSharedMemoryProvider< MemoryObject, MemoryObjectMetaInfo > > pointer_type
pointer type for convenience.
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
std::string getName() const
Retrieve name of object.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
The FPSCounter class provides methods for calculating the frames per second (FPS) count in periodic t...
PointCloudProviderPropertyDefinitions(std::string prefix)
PointCloudProvider abstract class defines a component which provide point clouds via ice or shared me...
bool hasSharedMemorySupport(const Ice::Current &c=Ice::emptyCurrent) override
void onInitComponent() override
virtual void onInitPointCloudProvider()=0
This is called when the Component::onInitComponent() is called.
void onDisconnectComponent() override
Hook for subclass.
void updateComponentMetaInfo(const MetaPointCloudFormatPtr &info)
MetaPointCloudFormatPtr getPointCloudFormat(const Ice::Current &c=Ice::emptyCurrent) override
Returns the point cloud format info struct via Ice.
void enablePointCloudVisualization(bool enable, bool preferRGB, const Ice::Current &c=Ice::emptyCurrent)
void providePointCloud(PointCloudPtrT pointCloudPtr)
offer the new point cloud.
bool isExiting() const
Retrieve whether provider is exiting.
virtual void onConnectPointCloudProvider()
This is called when the Component::onConnectComponent() setup is called.
void onConnectComponent() override
virtual MetaPointCloudFormatPtr getDefaultPointCloudFormat()
default point cloud format used to initialize shared memory
virtual void onExitPointCloudProvider()=0
This is called when the Component::onExitComponent() setup is called.
void onExitComponent() override
PointCloudProcessorInterfacePrx pointCloudProcessorProxy
Ice proxy of the point cloud processor interface.
armarx::Blob getPointCloud(MetaPointCloudFormatPtr &info, const Ice::Current &c=Ice::emptyCurrent) override
Retrieve point clouds via Ice.
#define ARMARX_CHECK_GREATER(lhs, rhs)
This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will thro...
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_CHECK_GREATER_EQUAL(lhs, rhs)
This macro evaluates whether lhs is greater or equal (>=) rhs and if it turns out to be false it will...
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
std::shared_ptr< SharedMemoryScopedWriteLock > SharedMemoryScopedWriteLockPtr