BridgeTestValidStateSampler.h
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017,
5  * National Institute of Advanced Industrial Science and
6  * Technology (AIST)
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the National Institute of Advanced Industrial
21  * Science and Technology nor the names of its contributors may be
22  * used to endorse or promote products derived from this software
23  * without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  *********************************************************************/
38 
39 /* Author: Andreas Orthey */
40 
41 #ifndef OMPL_BASE_SAMPLERS_BRIDGE_TEST_VALID_STATE_SAMPLER_
42 #define OMPL_BASE_SAMPLERS_BRIDGE_TEST_VALID_STATE_SAMPLER_
43 
44 #include "ompl/base/StateSampler.h"
45 #include "ompl/base/ValidStateSampler.h"
46 
47 namespace ompl
48 {
49  namespace base
50  {
63  class BridgeTestValidStateSampler : public ValidStateSampler
64  {
65  public:
67  BridgeTestValidStateSampler(const SpaceInformation *si);
68 
69  ~BridgeTestValidStateSampler() override = default;
70 
71  bool sample(State *state) override;
72  bool sampleNear(State *state, const State *near, double distance) override;
73 
75  double getStdDev() const
76  {
77  return stddev_;
78  }
79 
81  void setStdDev(double stddev)
82  {
83  stddev_ = stddev;
84  }
85 
86  protected:
89 
91  double stddev_;
92  };
93  }
94 }
95 #endif
StateSamplerPtr sampler_
The sampler to build upon.
bool sample(State *state) override
Sample a state. Return false in case of failure.
double getStdDev() const
Get the standard deviation used when sampling.
void setStdDev(double stddev)
Set the standard deviation to use when sampling.
double stddev_
The standard deviation to use in the sampling process.
BridgeTestValidStateSampler(const SpaceInformation *si)
Constructor.
bool sampleNear(State *state, const State *near, double distance) override
Sample a state near another, within specified distance. Return false, in case of failure.
A shared pointer wrapper for ompl::base::StateSampler.
Main namespace. Contains everything in this library.