FilterKnownObjects.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package VisionX::ArmarXObjects::FilterKnownObjects
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2022
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
26 #include <pcl/filters/crop_box.h>
27 #include <pcl/point_types.h>
28 
30 #include <ArmarXCore/interface/observers/ObserverInterface.h>
31 
33 
36 
38 
39 namespace armarx
40 {
41  /**
42  * @defgroup Component-FilterKnownObjects FilterKnownObjects
43  * @ingroup VisionX-Components
44  * A description of the component FilterKnownObjects.
45  *
46  * @class FilterKnownObjects
47  * @ingroup Component-FilterKnownObjects
48  * @brief Brief description of class FilterKnownObjects.
49  *
50  * Detailed description of class FilterKnownObjects.
51  */
53  virtual public visionx::PointCloudProcessor,
57  {
58  /// The used point type.
59  using PointT = pcl::PointXYZRGBL;
60 
61  public:
62  /// @see armarx::ManagedIceObject::getDefaultName()
63  std::string getDefaultName() const override;
64 
65  static std::string
67  {
68  return "FilterKnownObjects";
69  }
70 
71 
72  protected:
73  /// @see PropertyUser::createPropertyDefinitions()
75 
76  /// @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
77  void onInitPointCloudProcessor() override;
78 
79  /// @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
80  void onConnectPointCloudProcessor() override;
81 
82  /// @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
83  void onDisconnectPointCloudProcessor() override;
84 
85  /// @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
86  void onExitPointCloudProcessor() override;
87 
88  /// @see visionx::PointCloudProcessor::process()
89  void process() override;
90 
91 
92  /// This function should be called once in onConnect() or when you
93  /// need to re-create the Remote GUI tab.
94  void createRemoteGuiTab();
95 
96  /// After calling `RemoteGui_startRunningTask`, this function is
97  /// called periodically in a separate thread. If you update variables,
98  /// make sure to synchronize access to them.
99  void RemoteGui_update() override;
100 
101 
102  private:
103  pcl::CropBox<PointT> filter;
104 
105  struct Properties
106  {
107  std::string objectInstanceMemoryName = "Object";
108 
109 
110  float resizeOBBFactor = 10.0;
111 
112  bool visualization = false;
113  };
114 
115  Properties properties;
116  std::mutex propertiesMutex;
117 
118  // Tab shown in the Remote GUI.
119  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
120  {
121  //armarx::RemoteGui::Client::LineEdit boxLayerName;
122  //armarx::RemoteGui::Client::IntSpinBox numBoxes;
123 
124  armarx::RemoteGui::Client::Button extractGrasps;
125  };
126 
127  RemoteGuiTab tab;
128 
129 
130  std::mutex arvizMutex;
131  };
132 } // namespace armarx
ArVizComponentPlugin.h
armarx::FilterKnownObjects
Brief description of class FilterKnownObjects.
Definition: FilterKnownObjects.h:52
armarx::FilterKnownObjects::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:45
ObjectPoseClientPlugin.h
armarx::FilterKnownObjects::RemoteGui_update
void RemoteGui_update() override
After calling RemoteGui_startRunningTask, this function is called periodically in a separate thread.
Definition: FilterKnownObjects.cpp:202
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:64
armarx::FilterKnownObjects::process
void process() override
Definition: FilterKnownObjects.cpp:74
armarx::FilterKnownObjects::getDefaultName
std::string getDefaultName() const override
Definition: FilterKnownObjects.cpp:207
LightweightRemoteGuiComponentPlugin.h
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:35
visionx::PointCloudProcessor
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
Definition: PointCloudProcessor.h:177
armarx::FilterKnownObjects::createRemoteGuiTab
void createRemoteGuiTab()
This function should be called once in onConnect() or when you need to re-create the Remote GUI tab.
Definition: FilterKnownObjects.cpp:183
PointCloudProcessor.h
armarx::FilterKnownObjects::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: FilterKnownObjects.cpp:35
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:72
Component.h
armarx::FilterKnownObjects::onDisconnectPointCloudProcessor
void onDisconnectPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:64
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::RemoteGui::Client::Button
Definition: Widgets.h:120
armarx::FilterKnownObjects::GetDefaultName
static std::string GetDefaultName()
Definition: FilterKnownObjects.h:66
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::FilterKnownObjects::onConnectPointCloudProcessor
void onConnectPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:52
armarx::FilterKnownObjects::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:69