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/point_types.h>
27 
29 #include <ArmarXCore/interface/observers/ObserverInterface.h>
30 
35 
36 
37 
38 #include <pcl/filters/crop_box.h>
39 
40 namespace armarx
41 {
42  /**
43  * @defgroup Component-FilterKnownObjects FilterKnownObjects
44  * @ingroup VisionX-Components
45  * A description of the component FilterKnownObjects.
46  *
47  * @class FilterKnownObjects
48  * @ingroup Component-FilterKnownObjects
49  * @brief Brief description of class FilterKnownObjects.
50  *
51  * Detailed description of class FilterKnownObjects.
52  */
54  virtual public visionx::PointCloudProcessor,
58  {
59  /// The used point type.
60  using PointT = pcl::PointXYZRGBL;
61 
62  public:
63 
64  /// @see armarx::ManagedIceObject::getDefaultName()
65  std::string getDefaultName() const override;
66 
67  static std::string GetDefaultName()
68  {
69  return "FilterKnownObjects";
70  }
71 
72 
73  protected:
74 
75  /// @see PropertyUser::createPropertyDefinitions()
77 
78  /// @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
79  void onInitPointCloudProcessor() override;
80 
81  /// @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
82  void onConnectPointCloudProcessor() override;
83 
84  /// @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
85  void onDisconnectPointCloudProcessor() override;
86 
87  /// @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
88  void onExitPointCloudProcessor() override;
89 
90  /// @see visionx::PointCloudProcessor::process()
91  void process() override;
92 
93 
94  /// This function should be called once in onConnect() or when you
95  /// need to re-create the Remote GUI tab.
96  void createRemoteGuiTab();
97 
98  /// After calling `RemoteGui_startRunningTask`, this function is
99  /// called periodically in a separate thread. If you update variables,
100  /// make sure to synchronize access to them.
101  void RemoteGui_update() override;
102 
103 
104 
105 
106 
107  private:
108 
109  pcl::CropBox<PointT> filter;
110 
111  struct Properties
112  {
113  std::string objectInstanceMemoryName = "Object";
114 
115 
116  float resizeOBBFactor = 10.0;
117 
118  bool visualization = false;
119 
120  };
121  Properties properties;
122  std::mutex propertiesMutex;
123 
124  // Tab shown in the Remote GUI.
125  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
126  {
127  //armarx::RemoteGui::Client::LineEdit boxLayerName;
128  //armarx::RemoteGui::Client::IntSpinBox numBoxes;
129 
130  armarx::RemoteGui::Client::Button extractGrasps;
131  };
132  RemoteGuiTab tab;
133 
134 
135  std::mutex arvizMutex;
136 
137 
138 
139  };
140 }
141 
ArVizComponentPlugin.h
armarx::FilterKnownObjects
Brief description of class FilterKnownObjects.
Definition: FilterKnownObjects.h:53
armarx::FilterKnownObjects::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:44
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:200
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:67
armarx::FilterKnownObjects::process
void process() override
Definition: FilterKnownObjects.cpp:73
armarx::FilterKnownObjects::getDefaultName
std::string getDefaultName() const override
Definition: FilterKnownObjects.cpp:205
LightweightRemoteGuiComponentPlugin.h
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
visionx::PointCloudProcessor
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
Definition: PointCloudProcessor.h:186
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:181
PointCloudProcessor.h
armarx::FilterKnownObjects::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: FilterKnownObjects.cpp:35
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:73
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:67
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::FilterKnownObjects::onConnectPointCloudProcessor
void onConnectPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:51
armarx::FilterKnownObjects::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Definition: FilterKnownObjects.cpp:68