Go to the documentation of this file.
34 #include <VisionX/interface/core/DataTypes.h>
35 #include <VisionX/interface/core/PointCloudProcessorInterface.h>
36 #include <VisionX/interface/core/PointCloudProviderInterface.h>
50 defineOptionalProperty<std::string>(
"frameName",
"",
"name of the source");
62 virtual public PointCloudProviderInterface
73 armarx::Blob
getPointCloud(MetaPointCloudFormatPtr& info,
const Ice::Current&
c = Ice::emptyCurrent)
override;
115 template<
typename Po
intCloudPtrT>
118 using PointCloudT =
typename PointCloudPtrT::element_type;
119 using PointT =
typename PointCloudT::PointType;
121 if (!sharedMemoryProvider)
123 ARMARX_WARNING <<
"Shared memory provider is null (possibly shutting down)";
126 MetaPointCloudFormatPtr info(MetaPointCloudFormatPtr::dynamicCast(sharedMemoryProvider->
getMetaInfo()->ice_clone()));
128 info->type = visionx::tools::getPointContentType<PointT>();
131 if (info->size > info->capacity)
135 << (maxPoints) <<
" points). The provided point cloud contains "
136 << pointCloudPtr->width* pointCloudPtr->height
137 <<
" points. Cropping the point cloud to fit into limit.";
139 pointCloudPtr->width = maxPoints;
140 pointCloudPtr->height = 1;
141 pointCloudPtr->resize(maxPoints);
145 info->width = pointCloudPtr->width;
146 info->height = pointCloudPtr->height;
148 if (pointCloudPtr->header.stamp)
150 info->timeProvided = pointCloudPtr->header.stamp;
157 if (pointCloudPtr->header.seq)
159 info->seq = pointCloudPtr->header.seq;
173 auto buf = intermediateBuffer.data();
181 unsigned char* buffer = sharedMemoryProvider->
getBuffer();
183 memcpy(buffer, intermediateBuffer.data(), info->size);
244 MetaPointCloudFormatPtr pointCloudFormat;
254 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...