Loading...
Searching...
No Matches
VampStateValidityChecker.h
1#pragma once
2
3#include <ompl/base/SpaceInformation.h>
4#include <ompl/base/State.h>
5#include <ompl/base/StateValidityChecker.h>
6#include <ompl/base/spaces/RealVectorStateSpace.h>
7
8#include <ompl/vamp/Utils.h>
9
10#include <vamp/planning/validate.hh>
11#include <vamp/collision/environment.hh>
12
13namespace ompl::vamp
14{
15 namespace ob = ompl::base;
16
17 //==========================================================================
18 // VAMP State Validity Checker for OMPL
19 //==========================================================================
20
21 template <typename Robot, std::size_t rake = ::vamp::FloatVectorWidth>
22 class VampStateValidityChecker : public ob::StateValidityChecker
23 {
24 public:
25 using Environment = ::vamp::collision::Environment<::vamp::FloatVector<rake>>;
26
27 VampStateValidityChecker(ob::SpaceInformation *si, const Environment &env)
28 : ob::StateValidityChecker(si), env_(env)
29 {
30 }
31
32 VampStateValidityChecker(const ob::SpaceInformationPtr &si, const Environment &env)
33 : ob::StateValidityChecker(si), env_(env)
34 {
35 }
36
37 auto isValid(const ob::State *state) const -> bool override
38 {
39 auto configuration = ompl_to_vamp<Robot>(state);
40 return ::vamp::planning::validate_motion<Robot, rake, 1>(configuration, configuration, env_);
41 }
42
43 private:
44 const Environment &env_;
45 };
46
47} // namespace ompl::vamp
The base class for space information. This contains all the information about the space planning is d...
Abstract definition for a class checking the validity of states. The implementation of this class mus...
Definition of an abstract state.
Definition State.h:50
auto isValid(const ob::State *state) const -> bool override
Return true if the state state is valid. Usually, this means at least collision checking....
This namespace contains sampling based planning routines shared by both planning under geometric cons...