Visu.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 Navigation::ArmarXObjects::NavigationMemory
17  * @author Rainer Kartmann ( rainer dot kartmann 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 #include <map>
26 #include <memory>
27 #include <string>
28 #include <vector>
29 
30 #include <SimoxUtility/color/Color.h>
31 
34 
43 
45 
47 {
48  class GraphVisu;
49 }
50 
52 {
53 
54  class Visu
55  {
56  public:
63  ~Visu();
64 
65 
66  void drawLocations(std::vector<viz::Layer>& layers, bool enabled);
68  std::vector<viz::Layer>& layers,
69  bool enabled);
70 
71  void drawGraphs(std::vector<viz::Layer>& layers, bool enabled);
72  void drawGraphs(objpose::ObjectPoseClient& objClient,
73  std::vector<viz::Layer>& layers,
74  bool enabled);
75  void drawCostmaps(std::vector<viz::Layer>& layers, bool enabled, float zOffset);
76  void drawHumans(std::vector<viz::Layer>& layers,
77  bool enabled,
78  bool visuTransparent,
79  Duration maxAge);
80 
81  void drawRooms(std::vector<viz::Layer>& layers, bool enabled);
82 
83 
85 
91 
92  std::unique_ptr<navigation::graph::GraphVisu> visu;
93 
94  private:
95  void
96  drawRoom(viz::Layer& layer, const algorithms::Room& room, const simox::Color& color) const;
97 
98  void drawLocations(const objpose::ObjectPoseMap& objects,
99  const std::vector<ObjectInfo>& info,
100  viz::Layer& layer);
101  void drawGraphs(const objpose::ObjectPoseMap& objects,
102  const std::vector<ObjectInfo>& info,
103  std::vector<viz::Layer>& layers,
104  bool enabled);
105 
106 
107  std::map<std::string, DateTime> lastCostmapVisualization_;
108  };
109 
110 
111 } // namespace armarx::navigation::memory
Client.h
armarx::navigation::memory::Visu::drawLocations
void drawLocations(std::vector< viz::Layer > &layers, bool enabled)
Definition: Visu.cpp:170
armarx::navigation::memory
Definition: ComponentInterface.ice:37
DateTime.h
ScopedClient.h
armarx::navigation::memory::Visu::graphSegment
const armem::server::wm::CoreSegment & graphSegment
Definition: Visu.h:87
forward_declarations.h
armarx::navigation::graph
This file is part of ArmarX.
Definition: Visu.h:46
armarx::navigation::memory::Visu::drawCostmaps
void drawCostmaps(std::vector< viz::Layer > &layers, bool enabled, float zOffset)
Definition: Visu.cpp:286
Duration.h
Layer.h
armarx::viz::ScopedClient
viz::Client that will delete (clear) committed layers when destroyed.
Definition: ScopedClient.h:42
armarx::navigation::memory::Visu::arviz
viz::ScopedClient arviz
Definition: Visu.h:84
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:17
armarx::navigation::memory::Visu::humanSegment
const armem::server::wm::CoreSegment & humanSegment
Definition: Visu.h:89
armarx::navigation::memory::Visu::drawHumans
void drawHumans(std::vector< viz::Layer > &layers, bool enabled, bool visuTransparent, Duration maxAge)
Definition: Visu.cpp:401
memory_definitions.h
armarx::navigation::memory::Visu
Definition: Visu.h:54
armarx::navigation::memory::Visu::~Visu
~Visu()
Definition: Visu.cpp:90
armarx::navigation::memory::Visu::Visu
Visu(viz::Client arviz, const armem::server::wm::CoreSegment &locSegment, const armem::server::wm::CoreSegment &graphSegment, const armem::server::wm::CoreSegment &costmapSegment, const armem::server::wm::CoreSegment &humanSegment, const armem::server::wm::CoreSegment &roomsSegment)
Definition: Visu.cpp:74
Color
uint32_t Color
RGBA color.
Definition: color.h:8
armarx::navigation::memory::Visu::locSegment
const armem::server::wm::CoreSegment & locSegment
Definition: Visu.h:86
armarx::navigation::memory::Visu::roomsSegment
const armem::server::wm::CoreSegment & roomsSegment
Definition: Visu.h:90
armarx::navigation::memory::Visu::visu
std::unique_ptr< navigation::graph::GraphVisu > visu
Definition: Visu.h:92
armarx::navigation::graph::GraphVisu
Definition: Visu.h:102
armarx::navigation::algorithms::Room
Definition: Room.h:33
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
ObjectPoseClient.h
ObjectInfo.h
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:75
forward_declarations.h
armarx::navigation::memory::Visu::drawRooms
void drawRooms(std::vector< viz::Layer > &layers, bool enabled)
Definition: Visu.cpp:337
armarx::core::time::Duration
Represents a duration.
Definition: Duration.h:16
armarx::navigation::memory::Visu::drawGraphs
void drawGraphs(std::vector< viz::Layer > &layers, bool enabled)
Definition: Visu.cpp:208
armarx::navigation::memory::Visu::costmapSegment
const armem::server::wm::CoreSegment & costmapSegment
Definition: Visu.h:88
armarx::viz::Client
Definition: Client.h:117
Room.h
armarx::viz::Layer
Definition: Layer.h:12
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21