39 def->optional(properties.visualization,
"Visualization");
40 def->optional(properties.resizeOBBFactor,
"ResizeOBBFactor");
47 filter.setNegative(
true);
77 pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
78 pcl::PointCloud<PointT>::Ptr removedObjects(
new pcl::PointCloud<PointT>());
86 ARMARX_VERBOSE <<
"Timeout or error while waiting for point cloud data.";
92 std::vector<std::string> objects_removed;
99 if (!objectPose.oobbGlobal().has_value())
106 std::string s = objectPose.objectID.str();
109 s.begin(), s.end(), s.begin(), [](
unsigned char c) { return std::tolower(c); });
111 if (s.find(
"building") != std::string::npos)
116 if (s.find(
"interior") != std::string::npos)
121 if (s.find(
"workbench") != std::string::npos)
127 objects_removed.push_back(objectPose.objectID.str());
129 const Eigen::Matrix4f globalPose = objectPose.objectPoseGlobal;
131 const simox::OrientedBoxf localOOBB = objectPose.localOOBB.value();
133 Eigen::Vector3f dim = localOOBB.dimensions();
134 dim += Eigen::Vector3f::Ones() * properties.resizeOBBFactor;
136 Eigen::Vector3f maxPt = dim / 2.0;
137 Eigen::Vector3f minPt = -1.0 * maxPt;
139 Eigen::Matrix4f m = globalPose * localOOBB.transformation_centered();
143 filter.setTransform(
transform.inverse());
144 filter.setMin(Eigen::Vector4f(minPt.x(), minPt.y(), minPt.z(), 1.0));
145 filter.setMax(Eigen::Vector4f(maxPt.x(), maxPt.y(), maxPt.z(), 1.0));
147 filter.setInputCloud(inputCloud);
149 filter.setNegative(
false);
150 pcl::PointCloud<PointT>::Ptr object(
new pcl::PointCloud<PointT>());
151 filter.filter(*
object);
152 (*removedObjects) += (*object);
154 filter.setNegative(
true);
155 filter.filter(*inputCloud);
157 if (properties.visualization)
162 b.
color(simox::Color::blue(128, 128));
170 <<
" from point cloud";
172 if (properties.visualization)
193 grid.
add(tab.extractGrasps, {row, 0}, {2, 1});
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
armarx::viz::Client arviz
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Brief description of class FilterKnownObjects.
void RemoteGui_update() override
After calling RemoteGui_startRunningTask, this function is called periodically in a separate thread.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitPointCloudProcessor() override
void onConnectPointCloudProcessor() override
void onDisconnectPointCloudProcessor() override
static std::string GetDefaultName()
void onInitPointCloudProcessor() override
void createRemoteGuiTab()
This function should be called once in onConnect() or when you need to re-create the Remote GUI tab.
std::string getDefaultName() const override
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.
objpose::ObjectPoseSeq getObjectPoses()
DerivedT & pose(Eigen::Matrix4f const &pose)
DerivedT & color(Color color)
Properties of PointCloudProcessor.
void enableResultPointClouds(std::string resultProviderName="")
Enables visualization.
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
#define ARMARX_INFO
The normal logging level.
#define ARMARX_VERBOSE
The logging level for verbose information.
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...
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void RemoteGui_startRunningTask()
void RemoteGui_createTab(std::string const &name, RemoteGui::Client::Widget const &rootWidget, RemoteGui::Client::Tab *tab)
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
An object pose as stored by the ObjectPoseStorage.
Box & size(Eigen::Vector3f const &s)
void add(ElementT const &element)