SceneProvider.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  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2022
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <VirtualRobot/VirtualRobot.h>
25 
27 
31 
37 
39 {
40  namespace graph
41  {
42  class Reader;
43  }
44 
45  namespace costmap
46  {
47  class Reader;
48  }
49 
50  namespace human
51  {
52  class Reader;
53  }
54 
55  namespace laser_scanner_features
56  {
57  class Reader;
58  }
59 
60 } // namespace armarx::navigation::memory::client
61 
63 {
64 
65  class SceneProvider : virtual public SceneProviderInterface
66  {
67  public:
69  {
70 
72 
74  // armem::vision::occupancy_grid::client::Reader occupancyGridReader;
75 
76  // `robot_state` memory reader and writer
78 
80 
82 
84  };
85 
86  struct Config
87  {
88  std::string robotName;
89 
90  std::string staticCostmapProviderName = "distance_to_obstacle_costmap_provider";
91  std::string staticCostmapName = "distance_to_obstacles";
92 
93  std::string humanProviderName = "dynamic_scene_provider";
94  std::string laserScannerFeaturesProviderName = "dynamic_scene_provider";
95 
96  std::vector<std::string> primitiveApproximationModels = {"navigation"};
97  };
98 
99  SceneProvider(const InjectedServices& srv, const Config& config);
100 
101  const core::Scene& scene() const override;
102 
103  bool initialize(const DateTime& timestamp) override;
104  bool synchronize(const DateTime& timestamp, bool fullUpdate) override;
105 
106 
107  private:
108  VirtualRobot::RobotPtr getRobot(const DateTime& timestamp) const;
109  core::StaticScene getStaticScene(const DateTime& timestamp) const;
110  core::DynamicScene getDynamicScene(const DateTime& timestamp) const;
111  core::SceneGraph getSceneGraph(const DateTime& timestamp) const;
112 
113  InjectedServices srv;
114  Config config;
115 
116  core::Scene scn;
117  };
118 } // namespace armarx::navigation::server::scene_provider
armarx::navigation::server::scene_provider::SceneProvider::Config::staticCostmapProviderName
std::string staticCostmapProviderName
Definition: SceneProvider.h:90
armarx::navigation::server::scene_provider::SceneProviderInterface
Definition: SceneProviderInterface.h:34
armarx::armem::robot_state::VirtualRobotReader
The VirtualRobotReader class.
Definition: VirtualRobotReader.h:40
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::objectPoseClient
objpose::ObjectPoseClient objectPoseClient
Definition: SceneProvider.h:83
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::graphReader
memory::client::graph::Reader * graphReader
Definition: SceneProvider.h:71
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::virtualRobotReader
armem::robot_state::VirtualRobotReader * virtualRobotReader
Definition: SceneProvider.h:77
armarx::navigation::memory::client::human::Reader
Definition: Reader.h:36
DateTime.h
armarx::navigation::server::scene_provider::SceneProvider::Config::primitiveApproximationModels
std::vector< std::string > primitiveApproximationModels
Definition: SceneProvider.h:96
DynamicScene.h
armarx::navigation::memory::client::laser_scanner_features::Reader
Definition: Reader.h:49
StaticScene.h
armarx::navigation::server::scene_provider::SceneProvider
Definition: SceneProvider.h:65
armarx::navigation::server::scene_provider::SceneProvider::Config::robotName
std::string robotName
Definition: SceneProvider.h:88
armarx::navigation::core::DynamicScene
Definition: DynamicScene.h:32
armarx::navigation::server::scene_provider::SceneProvider::SceneProvider
SceneProvider(const InjectedServices &srv, const Config &config)
Definition: SceneProvider.cpp:24
armarx::navigation::server::scene_provider
Definition: Navigator.h:57
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::laserScannerFeaturesReader
memory::client::laser_scanner_features::Reader * laserScannerFeaturesReader
Definition: SceneProvider.h:81
armarx::navigation::server::scene_provider::SceneProvider::Config::staticCostmapName
std::string staticCostmapName
Definition: SceneProvider.h:91
armarx::navigation::memory::client
This file is part of ArmarX.
Definition: Reader.cpp:23
armarx::navigation::server::scene_provider::SceneProvider::Config
Definition: SceneProvider.h:86
armarx::navigation::memory::client::costmap::Reader
Definition: Reader.h:34
ObjectPoseClient.h
VirtualRobotReader.h
types.h
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::humanReader
memory::client::human::Reader * humanReader
Definition: SceneProvider.h:79
armarx::navigation::core::Scene
Definition: types.h:71
Reader.h
armarx::navigation::server::scene_provider::SceneProvider::synchronize
bool synchronize(const DateTime &timestamp, bool fullUpdate) override
Definition: SceneProvider.cpp:55
armarx::navigation::server::scene_provider::SceneProvider::scene
const core::Scene & scene() const override
Definition: SceneProvider.cpp:30
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
SceneProviderInterface.h
armarx::navigation::server::scene_provider::SceneProvider::Config::laserScannerFeaturesProviderName
std::string laserScannerFeaturesProviderName
Definition: SceneProvider.h:94
armarx::navigation::server::scene_provider::SceneProvider::Config::humanProviderName
std::string humanProviderName
Definition: SceneProvider.h:93
armarx::navigation::server::scene_provider::SceneProvider::initialize
bool initialize(const DateTime &timestamp) override
Definition: SceneProvider.cpp:36
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices::costmapReader
memory::client::costmap::Reader * costmapReader
Definition: SceneProvider.h:73
armarx::navigation::core::StaticScene
Definition: StaticScene.h:40
armarx::navigation::core::SceneGraph
Definition: types.h:66
types.h
armarx::navigation::memory::client::graph::Reader
Definition: Reader.h:46
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::navigation::server::scene_provider::SceneProvider::InjectedServices
Definition: SceneProvider.h:68