batching_pomp  1.0
This is an implementation of an algorithmic framework for anytime motion planning on large dense roadmaps.
BeliefPoint.hpp
1 /***********************************************************************
2 Copyright (c) 2017, Shushman Choudhury
3 All rights reserved.
4 Authors: Shushman Choudhury <shushmanchoudhury@gmail.com>
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are
8 met:
9  Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in the
13  documentation and/or other materials provided with the distribution.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *************************************************************************/
26 
27 #ifndef BATCHING_POMP_CSPACEBELIEF_BELIEFPOINT_HPP_
28 #define BATCHING_POMP_CSPACEBELIEF_BELIEFPOINT_HPP_
29 
30 #include <ompl/base/State.h>
31 #include <Eigen/Dense>
32 #include <functional>
33 
34 namespace batching_pomp {
35 namespace cspacebelief {
36 
38 
43 struct BeliefPoint {
44 
45  Eigen::VectorXd stateValues;
46  double value;
47 
48  BeliefPoint():value(0.0){}
49  BeliefPoint(const ompl::base::State* _state,
50  unsigned int _dims, double _val)
51  :value{_val}
52  {
53  double *values = _state->as<ompl::base::RealVectorStateSpace::StateType>()->values;
54  stateValues = Eigen::Map<Eigen::VectorXd>(values,_dims);
55  }
56 
57  double getValue()
58  {
59  return value;
60  }
61 
62  bool operator==(const BeliefPoint& bp) const
63  {
64  return (stateValues==bp.stateValues);
65  }
66 
67  bool operator!=(const BeliefPoint& bp) const
68  {
69  return (stateValues!=bp.stateValues);
70  }
71 };
72 
73 } //namespace cspacebelief
74 } //namespace batching_pomp
75 
76 #endif //BATCHING_POMP_CSPACEBELIEF_BELIEFPOINT_HPP_
Definition: BatchingManager.hpp:36
An example datatype of the configuration space belief model.
Definition: BeliefPoint.hpp:43