Go to the documentation of this file.
32 #include <VisionX/interface/core/DataTypes.h>
33 #include <VisionX/interface/core/PointCloudProcessorInterface.h>
34 #include <VisionX/interface/core/PointCloudProviderInterface.h>
48 defineOptionalProperty<std::string>(
"frameName",
"",
"name of the source");
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;
127 if (!sharedMemoryProvider)
129 ARMARX_WARNING <<
"Shared memory provider is null (possibly shutting down)";
132 MetaPointCloudFormatPtr info(MetaPointCloudFormatPtr::dynamicCast(
133 sharedMemoryProvider->
getMetaInfo()->ice_clone()));
135 info->type = visionx::tools::getPointContentType<PointT>();
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();
192 unsigned char* buffer = sharedMemoryProvider->
getBuffer();
194 memcpy(buffer, intermediateBuffer.data(), info->size);
250 sharedMemoryProvider;
255 MetaPointCloudFormatPtr pointCloudFormat;
265 std::vector<unsigned char> intermediateBuffer;
void updateComponentMetaInfo(const MetaPointCloudFormatPtr &info)
MemoryObject * getBuffer()
Retrieve pointer to buffer.
void onConnectComponent() override
SharedMemoryScopedWriteLockPtr getScopedWriteLock() const
Retrieve scoped lock for writing to the memory.
#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_CHECK_GREATER(lhs, rhs)
This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will thro...
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
bool hasSharedMemorySupport(const Ice::Current &c=Ice::emptyCurrent) override
void setMetaInfo(const typename MemoryObjectMetaInfo::PointerType &info, bool threadSafe=true)
std::shared_ptr< SharedMemoryScopedWriteLock > SharedMemoryScopedWriteLockPtr
armarx::Blob getPointCloud(MetaPointCloudFormatPtr &info, const Ice::Current &c=Ice::emptyCurrent) override
Retrieve point clouds via Ice.
MemoryObjectMetaInfo::PointerType getMetaInfo(bool threadSafe=true) const
getMetaInfo returns a copy of the memory object information
void onDisconnectComponent() override
Hook for subclass.
void onExitComponent() override
PointCloudProviderPropertyDefinitions(std::string prefix)
MetaPointCloudFormatPtr getPointCloudFormat(const Ice::Current &c=Ice::emptyCurrent) override
Returns the point cloud format info struct via Ice.
PointCloudProcessorInterfacePrx pointCloudProcessorProxy
Ice proxy of the point cloud processor interface.
void onInitComponent() override
pcl::PointCloud< PointT > PointCloudT
#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...
Baseclass for all ArmarX ManagedIceObjects requiring properties.
virtual MetaPointCloudFormatPtr getDefaultPointCloudFormat()
default point cloud format used to initialize shared memory
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
void enablePointCloudVisualization(bool enable, bool preferRGB, const Ice::Current &c=Ice::emptyCurrent)
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
void providePointCloud(PointCloudPtrT pointCloudPtr)
offer the new point cloud.
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
virtual void onInitPointCloudProvider()=0
This is called when the Component::onInitComponent() is called.
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.
bool isExiting() const
Retrieve whether provider is exiting.
virtual void onExitPointCloudProvider()=0
This is called when the Component::onExitComponent() setup is called.
PointCloudProvider abstract class defines a component which provide point clouds via ice or shared me...
virtual void onConnectPointCloudProvider()
This is called when the Component::onConnectComponent() setup is called.
The FPSCounter class provides methods for calculating the frames per second (FPS) count in periodic t...