hpp-rbprm  4.10.1
Implementation of RB-PRM planner using hpp.
time-constraint-utils.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Steve Tonneau (steve.tonneau@laas.fr)
4 //
5 // This file is part of hpp-rbprm.
6 // hpp-rbprm 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-rbprm 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_TIME_CONSTRAINT_UTILS_HH
20 #define HPP_RBPRM_TIME_CONSTRAINT_UTILS_HH
21 
22 #include <hpp/rbprm/config.hh>
23 #include <hpp/rbprm/tools.hh>
25 #include <hpp/rbprm/rbprm-state.hh>
31 #include <hpp/core/problem.hh>
32 #include <hpp/core/config-projector.hh>
33 
34 #include <vector>
35 #include <string>
36 #include <map>
37 
38 namespace hpp {
39 namespace rbprm {
40 namespace interpolation {
41 
42 template <class Helper_T>
43 void SetPathValidation(Helper_T& helper) {
45  TimeConstraintPathValidation::create(helper.fullBodyDevice_, 0.05, helper.fullBodyDevice_->configSize() - 1);
46  helper.rootProblem_->pathValidation(pathVal);
47 }
48 
49 template <class Helper_T>
50 core::ConfigurationPtr_t TimeConfigFromDevice(const Helper_T& helper, const State& state, const double time) {
51  core::Configuration_t config(helper.fullBodyDevice_->currentConfiguration());
52  config.head(state.configuration_.rows()) = state.configuration_;
53  config[config.rows() - 1] = time;
54  return core::ConfigurationPtr_t(new core::Configuration_t(config));
55 }
56 
57 inline void UpdateConstraints(core::ConfigurationOut_t configuration, const T_TimeDependant& tds,
58  const std::size_t pathDofRank) {
59  const core::value_type y = configuration[pathDofRank];
60  for (CIT_TimeDependant cit = tds.begin(); cit != tds.end(); ++cit) {
61  (*cit)(y, configuration);
62  }
63 }
64 } // namespace interpolation
65 } // namespace rbprm
66 } // namespace hpp
67 #endif // HPP_RBPRM_TIME_CONSTRAINT_UTILS_HH
hpp::rbprm::interpolation::SetPathValidation
void SetPathValidation(Helper_T &helper)
Definition: time-constraint-utils.hh:43
time-constraint-steering.hh
rbprm-fullbody.hh
tools.hh
hpp::rbprm::interpolation::TimeConstraintPathValidation::create
static TimeConstraintPathValidationPtr_t create(const pinocchio::DevicePtr_t &robot, const pinocchio::value_type &stepSize, const std::size_t pathDofRank)
hpp::rbprm::interpolation::UpdateConstraints
void UpdateConstraints(core::ConfigurationOut_t configuration, const T_TimeDependant &tds, const std::size_t pathDofRank)
Definition: time-constraint-utils.hh:57
rbprm-state.hh
hpp::rbprm::interpolation::T_TimeDependant
std::vector< TimeDependant > T_TimeDependant
Definition: time-dependant.hh:68
rbprm-device.hh
time-constraint-helper.hh
hpp::rbprm::interpolation::CIT_TimeDependant
T_TimeDependant::const_iterator CIT_TimeDependant
Definition: time-dependant.hh:69
hpp::rbprm::interpolation::TimeConstraintPathValidationPtr_t
boost::shared_ptr< TimeConstraintPathValidation > TimeConstraintPathValidationPtr_t
Definition: time-constraint-path-validation.hh:29
time-dependant.hh
hpp
Definition: algorithm.hh:27
hpp::rbprm::State
Definition: rbprm-state.hh:40
hpp::rbprm::interpolation::TimeConfigFromDevice
core::ConfigurationPtr_t TimeConfigFromDevice(const Helper_T &helper, const State &state, const double time)
Definition: time-constraint-utils.hh:50
hpp::rbprm::State::configuration_
hpp::pinocchio::Configuration_t configuration_
Definition: rbprm-state.hh:108
time-constraint-path-validation.hh
config.hh