hpp-rbprm  4.10.0
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>
26 # include <hpp/rbprm/rbprm-device.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 
39 namespace hpp {
40  namespace rbprm {
41  namespace interpolation {
42 
43  template<class Helper_T>
44  void SetPathValidation(Helper_T& helper)
45  {
47  helper.fullBodyDevice_, 0.05,helper.fullBodyDevice_->configSize()-1);
48  helper.rootProblem_->pathValidation(pathVal);
49  }
50 
51  template<class Helper_T>
52  core::ConfigurationPtr_t TimeConfigFromDevice(const Helper_T& helper, const State& state, const double time)
53  {
54  core::Configuration_t config(helper.fullBodyDevice_->currentConfiguration());
55  config.head(state.configuration_.rows()) = state.configuration_;
56  config[config.rows()-1] = time;
57  return core::ConfigurationPtr_t(new core::Configuration_t(config));
58  }
59 
60  inline void UpdateConstraints(core::ConfigurationOut_t configuration,
61  const T_TimeDependant& tds, const std::size_t pathDofRank)
62  {
63  const core::value_type y = configuration[pathDofRank];
64  for (CIT_TimeDependant cit = tds.begin ();
65  cit != tds.end (); ++cit)
66  {
67  (*cit)(y, configuration);
68  }
69  }
70  }
71  }
72 }
73 #endif // HPP_RBPRM_TIME_CONSTRAINT_UTILS_HH
hpp::rbprm::interpolation::SetPathValidation
void SetPathValidation(Helper_T &helper)
Definition: time-constraint-utils.hh:44
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:60
rbprm-state.hh
hpp::rbprm::interpolation::T_TimeDependant
std::vector< TimeDependant > T_TimeDependant
Definition: time-dependant.hh:75
rbprm-device.hh
time-constraint-helper.hh
hpp::rbprm::interpolation::CIT_TimeDependant
T_TimeDependant::const_iterator CIT_TimeDependant
Definition: time-dependant.hh:76
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:52
hpp::rbprm::State::configuration_
hpp::pinocchio::Configuration_t configuration_
Definition: rbprm-state.hh:109
time-constraint-path-validation.hh
config.hh