ArVizDrawer.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 RobotComponents::ArmarXObjects::
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2021
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 <Eigen/Geometry>
27 
29 // TODO(fabian.reister): use forward decl
30 #include <RobotComponents/libraries/cartographer/map_registration/MapRegistration.h>
31 
32 namespace armarx
33 {
34 
35 }
36 
37 namespace armarx::viz
38 {
39  struct Layer;
40 }
41 
42 namespace armarx::cartographer
43 {
44  class ArVizDrawer : virtual public armarx::viz::ScopedClient
45  {
46  public:
48  virtual ~ArVizDrawer();
49 
50  void drawFrames(const Eigen::Affine3f& world_T_map);
51 
53  const Eigen::Affine3f& world_T_map);
54 
55  void drawClusters(const MapRegistration::Clusters& clusters,
56  const Eigen::Affine3f& world_T_map);
57 
58  void drawRobotPoses(const std::vector<Eigen::Affine3f>& robotPoses,
59  const Eigen::Affine3f& world_T_map);
60 
61  void drawModels(const std::vector<wykobi::Model>& models);
62 
63  void drawModelAssociations(const std::vector<MapRegistration::Association>& associations,
64  const Eigen::Affine3f& world_T_map);
65 
66  void drawMapBoundaries(const RotatedRect& boundingRect, const Eigen::Affine3f& world_T_map);
67 
68  void drawSelectedBoundingBoxCorner(const Eigen::Affine3f& boundingBoxCornerPose,
69  const Eigen::Affine3f& world_T_map);
70 
71  void clear();
72 
73  protected:
74  void drawCluster(const MapRegistration::Cluster& cluster,
75  const Eigen::Affine3f& world_T_map,
76  viz::Layer& layer) const;
77 
78  void drawRobotPose(const Eigen::Affine3f& robotPose,
79  const Eigen::Affine3f& world_T_map,
80  viz::Layer& layer) const;
81 
82  void drawModel(const wykobi::Model& model, viz::Layer& layer) const;
83 
84  void drawModelAssociation(const MapRegistration::Association& association,
85  const Eigen::Affine3f& world_T_map,
86  viz::Layer& layer) const;
87 
88  private:
89  struct
90  {
91  std::string mapBoundaries{"map_boundaries"};
92  std::string modelSceneAssociations{"model_scene_associations"};
93  std::string sceneModels{"scene_models"};
94  std::string robotPoses{"robot_poses"};
95  std::string selectedBoundingBoxCorner{"selected_bounding_box_corner"};
96  std::string clusters{"clusters"};
97  std::string pointCloud{"point_cloud"};
98  std::string frames{"frames"};
99  } layers;
100  };
101 
102 } // namespace armarx::cartographer
armarx::wykobi::Model
Definition: models.h:32
armarx::cartographer::ArVizDrawer::selectedBoundingBoxCorner
std::string selectedBoundingBoxCorner
Definition: ArVizDrawer.h:95
armarx::cartographer::ArVizDrawer
Definition: ArVizDrawer.h:44
armarx::cartographer::ArVizDrawer::sceneModels
std::string sceneModels
Definition: ArVizDrawer.h:93
armarx::cartographer::ArVizDrawer::drawFrames
void drawFrames(const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:57
armarx::cartographer::ArVizDrawer::mapBoundaries
std::string mapBoundaries
Definition: ArVizDrawer.h:91
ScopedClient.h
armarx::cartographer::ArVizDrawer::drawModelAssociations
void drawModelAssociations(const std::vector< MapRegistration::Association > &associations, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:221
armarx::viz::ScopedClient
viz::Client that will delete (clear) committed layers when destroyed.
Definition: ScopedClient.h:42
armarx::cartographer::ArVizDrawer::robotPoses
std::string robotPoses
Definition: ArVizDrawer.h:94
armarx::cartographer::ArVizDrawer::frames
std::string frames
Definition: ArVizDrawer.h:98
armarx::cartographer::ArVizDrawer::ArVizDrawer
ArVizDrawer(armarx::viz::Client &arviz)
Definition: ArVizDrawer.cpp:27
armarx::cartographer
Definition: MapRegistration.cpp:42
armarx::cartographer::ArVizDrawer::drawModels
void drawModels(const std::vector< wykobi::Model > &models)
Definition: ArVizDrawer.cpp:192
armarx::cartographer::ArVizDrawer::modelSceneAssociations
std::string modelSceneAssociations
Definition: ArVizDrawer.h:92
armarx::cartographer::ArVizDrawer::clear
void clear()
Definition: ArVizDrawer.cpp:38
armarx::cartographer::ArVizDrawer::~ArVizDrawer
virtual ~ArVizDrawer()
Definition: ArVizDrawer.cpp:32
armarx::cartographer::ArVizDrawer::drawClusters
void drawClusters(const MapRegistration::Clusters &clusters, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:116
armarx::cartographer::ArVizDrawer::drawMapBoundaries
void drawMapBoundaries(const RotatedRect &boundingRect, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:236
visionx::PointCloud
pcl::PointCloud< Point > PointCloud
Definition: RCPointCloudProvider.cpp:55
armarx::cartographer::ArVizDrawer::drawRobotPoses
void drawRobotPoses(const std::vector< Eigen::Affine3f > &robotPoses, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:162
armarx::cartographer::ArVizDrawer::drawCluster
void drawCluster(const MapRegistration::Cluster &cluster, const Eigen::Affine3f &world_T_map, viz::Layer &layer) const
Definition: ArVizDrawer.cpp:73
armarx::cartographer::ArVizDrawer::drawRobotPose
void drawRobotPose(const Eigen::Affine3f &robotPose, const Eigen::Affine3f &world_T_map, viz::Layer &layer) const
Definition: ArVizDrawer.cpp:145
armarx::cartographer::ArVizDrawer::drawModel
void drawModel(const wykobi::Model &model, viz::Layer &layer) const
Definition: ArVizDrawer.cpp:175
armarx::viz::ScopedClient::layer
Layer layer(std::string const &name) const
Definition: ScopedClient.cpp:34
armarx::cartographer::ArVizDrawer::pointCloud
std::string pointCloud
Definition: ArVizDrawer.h:97
armarx::viz::Client
Definition: Client.h:117
armarx::cartographer::ArVizDrawer::drawSelectedBoundingBoxCorner
void drawSelectedBoundingBoxCorner(const Eigen::Affine3f &boundingBoxCornerPose, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:129
armarx::navigation::human::Cluster
memory::LaserScannerFeature Cluster
Definition: HumanTracker.h:41
armarx::viz::Layer
Definition: Layer.h:12
armarx::cartographer::ArVizDrawer::drawPointCloud
void drawPointCloud(const MapRegistration::PointCloud &cloud, const Eigen::Affine3f &world_T_map)
Definition: ArVizDrawer.cpp:98
armarx::cartographer::ArVizDrawer::drawModelAssociation
void drawModelAssociation(const MapRegistration::Association &association, const Eigen::Affine3f &world_T_map, viz::Layer &layer) const
Definition: ArVizDrawer.cpp:203
armarx::cartographer::ArVizDrawer::clusters
std::string clusters
Definition: ArVizDrawer.h:96
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:418
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27