37 resultCloud.reset(
new pcl::PointCloud<pcl::PointXYZ>());
40 filter.setStddevMulThresh(1.0);
66 const std::string& name,
67 const LaserScan& scan,
69 const Ice::Current&
c)
71 pcl::PointCloud<pcl::PointXYZ> cloud;
72 cloud.points.reserve(scan.size());
74 for (
const LaserScanStep& l : scan)
77 p.x = -l.distance * std::sin(l.angle);
78 p.y = l.distance * std::cos(l.angle);
80 cloud.points.push_back(p);
84 cloud.width = cloud.points.size();
87 std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);
89 if (!lock.owns_lock())
99 const std::string& frameName = name;
101 if (localRobot->hasRobotNode(frameName))
103 Eigen::Matrix4f
transform = localRobot->getRobotNode(frameName)->getPoseInRootFrame();
104 pcl::transformPointCloud(cloud, clouds[name],
transform);
106 resultCloud->clear();
107 for (
auto& kv : clouds)
109 const pcl::PointCloud<pcl::PointXYZ>&
c = kv.second;
118 if (resultCloud->empty())
121 <<
"Input point cloud is empty. Will not report anything.";
125 pcl::PointCloud<pcl::PointXYZ>::Ptr cloudFiltered(
new pcl::PointCloud<pcl::PointXYZ>());
126 filter.setInputCloud(resultCloud);
127 filter.filter(*cloudFiltered);
140 def->topic<LaserScannerUnitListener>(
141 "LaserScans",
"laser_scanner_topic",
"Name of the laser scanner topic.");
146 visionx::MetaPointCloudFormatPtr
149 visionx::MetaPointCloudFormatPtr info =
new visionx::MetaPointCloudFormat();
151 info->size = info->capacity;
152 info->type = visionx::PointContentType::ePoints;
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
void reportSensorValues(const std::string &, const std::string &, const LaserScan &, const TimestampBasePtr &, const Ice::Current &c=Ice::emptyCurrent) override
visionx::MetaPointCloudFormatPtr getDefaultPointCloudFormat() override
default point cloud format used to initialize shared memory
void onConnectPointCloudProvider() override
This is called when the Component::onConnectComponent() setup is called.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitPointCloudProvider() override
This is called when the Component::onInitComponent() is called.
void onExitPointCloudProvider() override
This is called when the Component::onExitComponent() setup is called.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
void providePointCloud(PointCloudPtrT pointCloudPtr)
offer the new point cloud.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
This file offers overloads of toIce() and fromIce() functions for STL container types.
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
const std::size_t MAX_LASER_SCANNER_POINTS
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.