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