Loading...
Searching...
No Matches
CForestStateSpaceWrapper.cpp
1/*********************************************************************
2* Software License Agreement (BSD License)
3*
4* Copyright (c) 2014, Rice University
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 Rice University nor the names of its
18* contributors may be used to endorse or promote products derived
19* from this software without specific prior written permission.
20*
21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32* POSSIBILITY OF SUCH DAMAGE.
33*********************************************************************/
34
35/* Authors: Mark Moll */
36
37#include "ompl/geometric/planners/cforest/CForestStateSpaceWrapper.h"
38#include "ompl/geometric/planners/cforest/CForest.h"
39
41{
42 auto sampler(std::make_shared<CForestStateSampler>(this, space_->allocDefaultStateSampler()));
43 cforest_->addSampler(sampler);
44 return sampler;
45}
46
48{
49 auto sampler(std::make_shared<CForestStateSampler>(this, space_->allocStateSampler()));
50 cforest_->addSampler(sampler);
51 return sampler;
52}
53
55{
56 space_->setup();
57 maxExtent_ = space_->getMaximumExtent();
58 longestValidSegmentFraction_ = space_->getLongestValidSegmentFraction();
59 longestValidSegmentCountFactor_ = space_->getValidSegmentCountFactor();
60 longestValidSegment_ = space_->getLongestValidSegmentLength();
61 projections_ = space_->getRegisteredProjections();
62 params_ = space_->params();
63
64 valueLocationsInOrder_ = space_->getValueLocations();
65 valueLocationsByName_ = space_->getValueLocationsByName();
66 substateLocationsByName_ = space_->getSubstateLocationsByName();
67}
StateSamplerPtr allocStateSampler() const override
Allocate an instance of the state sampler for this space. This sampler will be allocated with the sam...
StateSamplerPtr allocDefaultStateSampler() const override
Allocate an instance of the default uniform state sampler for this space.
void setup() override
Perform final setup steps. This function is automatically called by the SpaceInformation....
ParamSet params_
The set of parameters for this space.
Definition StateSpace.h:553
std::map< std::string, SubstateLocation > substateLocationsByName_
All the known substat locations, by name.
Definition StateSpace.h:565
double longestValidSegment_
The longest valid segment at the time setup() was called.
Definition StateSpace.h:543
unsigned int longestValidSegmentCountFactor_
The factor to multiply the value returned by validSegmentCount(). Rarely used but useful for things l...
Definition StateSpace.h:547
std::map< std::string, ProjectionEvaluatorPtr > projections_
List of available projections.
Definition StateSpace.h:550
std::vector< ValueLocation > valueLocationsInOrder_
The value locations for all varliables of type double contained in a state; The locations point to va...
Definition StateSpace.h:557
std::map< std::string, ValueLocation > valueLocationsByName_
All the known value locations, by name. The names of state spaces access the first element of a state...
Definition StateSpace.h:562
double longestValidSegmentFraction_
The fraction of the longest valid segment.
Definition StateSpace.h:540
double maxExtent_
The extent of this space at the time setup() was called.
Definition StateSpace.h:537