1 |
|
|
// |
2 |
|
|
// Copyright (c) 2017 CNRS |
3 |
|
|
// Authors: Fernbach Pierre |
4 |
|
|
// |
5 |
|
|
// This file is part of hpp-rbprm |
6 |
|
|
// hpp-core is free software: you can redistribute it |
7 |
|
|
// and/or modify it under the terms of the GNU Lesser General Public |
8 |
|
|
// License as published by the Free Software Foundation, either version |
9 |
|
|
// 3 of the License, or (at your option) any later version. |
10 |
|
|
// |
11 |
|
|
// hpp-core is distributed in the hope that it will be |
12 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
13 |
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
|
|
// General Lesser Public License for more details. You should have |
15 |
|
|
// received a copy of the GNU Lesser General Public License along with |
16 |
|
|
// hpp-core If not, see |
17 |
|
|
// <http://www.gnu.org/licenses/>. |
18 |
|
|
|
19 |
|
|
#ifndef HPP_RBPRM_DYNAMIC_PATH_VALIDATION_HH |
20 |
|
|
#define HPP_RBPRM_DYNAMIC_PATH_VALIDATION_HH |
21 |
|
|
#include <hpp/rbprm/dynamic/dynamic-validation.hh> |
22 |
|
|
#include <hpp/rbprm/rbprm-path-validation.hh> |
23 |
|
|
namespace hpp { |
24 |
|
|
namespace rbprm { |
25 |
|
|
|
26 |
|
|
// forward declaration |
27 |
|
|
HPP_PREDEF_CLASS(DynamicPathValidation); |
28 |
|
|
// Planner objects are manipulated only via shared pointers |
29 |
|
|
typedef shared_ptr<DynamicPathValidation> DynamicPathValidationPtr_t; |
30 |
|
|
|
31 |
|
|
class HPP_RBPRM_DLLAPI DynamicPathValidation : public RbPrmPathValidation { |
32 |
|
|
public: |
33 |
|
|
/// Create an instance and return a shared pointer to the instance |
34 |
|
|
static DynamicPathValidationPtr_t create(const core::DevicePtr_t& robot, |
35 |
|
|
const core::value_type& stepSize); |
36 |
|
|
|
37 |
|
|
/// validate with custom filter for the rom validation |
38 |
|
|
virtual bool validate(const core::PathPtr_t& path, bool reverse, |
39 |
|
|
core::PathPtr_t& validPart, |
40 |
|
|
core::PathValidationReportPtr_t& report, |
41 |
|
|
const std::vector<std::string>& filter); |
42 |
|
|
|
43 |
|
|
virtual bool validate(const core::PathPtr_t& path, bool reverse, |
44 |
|
|
core::PathPtr_t& validPart, |
45 |
|
|
core::PathValidationReportPtr_t& report); |
46 |
|
|
|
47 |
|
|
void addDynamicValidator(const DynamicValidationPtr_t& dynamicValidation) { |
48 |
|
|
core::pathValidation::Discretized::add(dynamicValidation); |
49 |
|
|
dynamicValidation_ = dynamicValidation; |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
protected: |
53 |
|
|
/// Protected constructor |
54 |
|
|
/// Users need to call RbPrmPlanner::create in order to create instances. |
55 |
|
|
DynamicPathValidation(const core::DevicePtr_t& robot, |
56 |
|
|
const core::value_type& stepSize); |
57 |
|
|
|
58 |
|
|
private: |
59 |
|
|
DynamicValidationPtr_t dynamicValidation_; |
60 |
|
|
}; // class RbPrmPlanner |
61 |
|
|
} // namespace rbprm |
62 |
|
|
} // namespace hpp |
63 |
|
|
|
64 |
|
|
#endif // HPP_RBPRM_DYNAMIC_PATH_VALIDATION_HH |