26#include <pcl/io/pcd_io.h>
27#include <pcl/point_types.h>
36#include <VisionX/components/pointcloud_processor/PointCloudToArMem/PointCloudToArMemInterface.h>
39#include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZ.aron.generated.h>
40#include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZL.aron.generated.h>
41#include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZRGBA.aron.generated.h>
42#include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZRGBL.aron.generated.h>
67 return "PointCloudToArMem";
83 template <
class Po
intT,
class AronT>
85 getDataAndSendToMemory()
90 typename pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
102 if (p.numClouds <= 0 || currentCloud <= p.numClouds)
115 arondto.pointcloud = *inputCloud;
132 auto result = memoryWriter.commit(
c);
134 if (not result.allSuccess())
137 <<
"An error occured when sending pointclouds to the memory. "
138 "Try to continue with next PC. The message was: "
139 << result.allErrorMessages();
148 ARMARX_INFO <<
"Timeout or error while waiting for point cloud data";
156 armarx::armem::client::Writer memoryWriter;
161 bool removeNaNs =
true;
165 std::string targetMemoryName =
"Vision";
169 std::atomic_bool processing =
false;
static Duration MicroSeconds(std::int64_t microSeconds)
Constructs a duration in microseconds.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
std::int64_t toMilliSeconds() const
Returns the amount of milliseconds.
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
void provideResultPointClouds(const PointCloudPtrT &pointClouds, std::string providerName="")
sends result PointClouds for visualization
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onExitPointCloudProcessor() override
Exit the ImapeProcessor component.
void onConnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component is fully i...
void onDisconnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component looses net...
void onInitPointCloudProcessor() override
Setup the vision component.
std::string getDefaultName() const override
Retrieve default name of component.
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_VERBOSE
The logging level for verbose information.
#define TIMING_START(name)
Helper macro to do timing tests.
#define TIMING_END_STREAM(name, os)
Prints duration.
plugins::PluginUser PluginUser
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
const constexpr char * POINT_XYZRGBA_SLUG
std::string GetCoreSegmentNameFor()
const constexpr char * ENTITY_NAME
void filterNaNs(pcl::PointCloud< PointT > &pc)
A bundle of updates to be sent to the memory.
An update of an entity for a specific point in time.
float confidence
An optional confidence, may be used for things like decay.
MemoryID entityID
The entity's ID.
Time referencedTime
Time when this entity update was created (e.g.
std::vector< aron::data::DictPtr > instancesData
The entity data.
Time sentTime
Time when this update was sent to the memory server.