Loading...
Searching...
No Matches
PlannerDataVertexAnnotated.h
1/*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2019, University of Stuttgart
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the University of Stuttgart nor the names
18 * of its contributors may be used to endorse or promote products
19 * derived from this software without specific prior written
20 * permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *********************************************************************/
35
36/* Author: Andreas Orthey */
37
38#ifndef OMPL_GEOMETRIC_PLANNERS_QUOTIENTSPACE_SRC_VERTEX_ANNOTATED_
39#define OMPL_GEOMETRIC_PLANNERS_QUOTIENTSPACE_SRC_VERTEX_ANNOTATED_
40
41#include <ompl/base/PlannerData.h>
42#include <boost/serialization/export.hpp>
43
44namespace ompl
45{
46 namespace base
47 {
52 {
53 // If new elements are added,
54 // you need to update the clone/getstate functions!
55 public:
56 PlannerDataVertexAnnotated(const ompl::base::State *st, int tag = 0);
58 virtual PlannerDataVertex *clone() const override;
59
60 void setLevel(unsigned int level_);
61 unsigned int getLevel() const;
62
63 void setMaxLevel(unsigned int level_);
64 unsigned int getMaxLevel() const;
65
66 void setPath(std::vector<int> path_);
67 std::vector<int> getPath() const;
68
69 void setComponent(unsigned int component_);
70 unsigned int getComponent() const;
71
72 void setState(ompl::base::State *s);
73 void setQuotientState(const ompl::base::State *s);
74 virtual const ompl::base::State *getState() const override;
75 virtual const ompl::base::State *getQuotientState() const;
76
77 friend bool operator==(const PlannerDataVertexAnnotated &lhs, const PlannerDataVertexAnnotated &rhs);
78 friend std::ostream &operator<<(std::ostream &, const PlannerDataVertexAnnotated &);
79
80 protected:
81 unsigned int level_{0};
82 unsigned int maxLevel_{1};
83
84 std::vector<int> path_;
85
86 unsigned int component_{0};
87 const ompl::base::State *stateQuotientSpace_{nullptr};
88 };
89
90 } // namespace base
91} // namespace ompl
92#endif
An annotated vertex, adding information about its level in the quotient-space hiearchy,...
virtual const ompl::base::State * getState() const override
Retrieve the state associated with this vertex.
virtual PlannerDataVertex * clone() const override
Return a clone of this object, allocated from the heap.
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
Definition PlannerData.h:59
Definition of an abstract state.
Definition State.h:50
Main namespace. Contains everything in this library.