GraphBuilder.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 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <cstdint>
25 #include <optional>
26 #include <vector>
27 
31 
32 #include <SemanticObjectRelations/Shapes/Shape.h>
33 
35 {
36 
37 
39  {
40  public:
41  void initialize(const core::Pose& pose);
42 
43  // const std::vector<core::Graph::VertexDescriptor>& activeVertices() const;
44 
45  void connect(const core::Pose& pose, const client::GlobalPlanningStrategy& strategy);
46 
47 
48  // which type to choose? this is a sequence of chains
49 
50  /**
51  * @brief
52  *
53  * @param routes
54  * @param strategy strategy on how to connect the last vertex and the routes
55  */
56  void connect(const std::vector<core::Graph::VertexDescriptor>& routes,
57  const client::GlobalPlanningStrategy& strategy);
58  void connect(const std::vector<core::GraphPath>& routes,
59  const client::GlobalPlanningStrategy& strategy);
60  // void connect(const core::Pose& pose, const client::GlobalPlanningStrategy& strategy);
61 
62  const core::Graph& getGraph() const;
63 
64  std::optional<core::Graph::ConstVertex> startVertex;
65 
66  core::Graph::VertexDescriptor goalVertex() const;
67 
68  core::Pose goalPose() const;
69 
70  private:
71  // void addEdge(const std::vector<core::Graph::VertexDescriptor>& sources,
72  // const std::vector<core::Graph::VertexDescriptor>& targets);
73 
74  void validate(auto&& vertices) const;
75 
76  semrel::ShapeID addOrGetVertex(const core::Graph::VertexAttrib& attributes);
77  std::optional<semrel::ShapeID>
78  getVertexByAttributes(const core::Graph::VertexAttrib& attributes);
79 
80  std::vector<semrel::ShapeID> activeVertices_;
81 
82  core::Graph graph;
83 
84  int64_t vertexIdCnt = -1;
85  };
86 
87 } // namespace armarx::navigation::server
armarx::navigation::server::GraphBuilder::getGraph
const core::Graph & getGraph() const
Definition: GraphBuilder.cpp:239
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
types.h
basic_types.h
armarx::navigation::server::GraphBuilder::goalVertex
core::Graph::VertexDescriptor goalVertex() const
Definition: GraphBuilder.cpp:246
armarx::navigation::server::GraphBuilder::initialize
void initialize(const core::Pose &pose)
Definition: GraphBuilder.cpp:32
armarx::navigation::server
This file is part of ArmarX.
Definition: EventPublishingInterface.h:6
armarx::navigation::server::GraphBuilder
Definition: GraphBuilder.h:38
armarx::navigation::server::GraphBuilder::startVertex
std::optional< core::Graph::ConstVertex > startVertex
Definition: GraphBuilder.h:64
armarx::navigation::core::Graph
Definition: Graph.h:89
armarx::navigation::server::GraphBuilder::goalPose
core::Pose goalPose() const
Definition: GraphBuilder.cpp:253
armarx::navigation::server::GraphBuilder::connect
void connect(const core::Pose &pose, const client::GlobalPlanningStrategy &strategy)
Definition: GraphBuilder.cpp:54
Graph.h
armarx::navigation::client::GlobalPlanningStrategy
GlobalPlanningStrategy
Definition: types.h:27