hpp-manipulation  4.11.0
Classes for manipulation planning.
end-effector-trajectory.hh
Go to the documentation of this file.
1 // Copyright (c) 2019 CNRS
2 // Authors: Joseph Mirabel
3 //
4 // This file is part of hpp-manipulation
5 // hpp-manipulation 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-manipulation 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-manipulation If not, see
16 // <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
20 # define HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
21 
23 # include <hpp/manipulation/fwd.hh>
24 
25 # include <pinocchio/spatial/se3.hpp>
26 
27 # include <hpp/pinocchio/frame.hh>
28 # include <hpp/core/path-planner.hh>
29 
30 namespace hpp {
31  namespace manipulation {
32  namespace pathPlanner {
34  {
35  public:
36  typedef std::vector<Configuration_t> Configurations_t;
37 
38  Configurations_t solve (vectorIn_t target)
39  {
40  return impl_solve (target);
41  }
42 
43  protected:
44  virtual Configurations_t impl_solve (vectorIn_t target) = 0;
45  };
46  typedef shared_ptr<IkSolverInitialization> IkSolverInitializationPtr_t;
47 
49  typedef shared_ptr<EndEffectorTrajectory> EndEffectorTrajectoryPtr_t;
50 
51  class HPP_MANIPULATION_DLLAPI EndEffectorTrajectory : public core::PathPlanner
52  {
53  public:
56  static EndEffectorTrajectoryPtr_t create
57  (const core::ProblemConstPtr_t& problem);
61  static EndEffectorTrajectoryPtr_t createWithRoadmap
62  (const core::ProblemConstPtr_t& problem,
63  const core::RoadmapPtr_t& roadmap);
64 
68  virtual void startSolve ();
69 
71  virtual void oneStep ();
72 
75  int nRandomConfig () const
76  { return nRandomConfig_; }
77 
78  void nRandomConfig (int n)
79  {
80  assert (n >= 0);
81  nRandomConfig_ = n;
82  }
83 
85  int nDiscreteSteps () const
86  { return nDiscreteSteps_; }
87 
88  void nDiscreteSteps (int n)
89  {
90  assert (n > 0);
91  nDiscreteSteps_ = n;
92  }
93 
96  void checkFeasibilityOnly (bool enable);
97 
98  bool checkFeasibilityOnly () const
99  {
100  return feasibilityOnly_;
101  }
102 
103  void ikSolverInitialization (IkSolverInitializationPtr_t solver)
104  {
105  ikSolverInit_ = solver;
106  }
107 
108  void tryConnectInitAndGoals ();
109 
110  protected:
118  const core::RoadmapPtr_t& roadmap);
120  void init (const EndEffectorTrajectoryWkPtr_t& weak);
121 
122  private:
123  std::vector<core::Configuration_t> configurations(const core::Configuration_t& q_init);
124 
126  EndEffectorTrajectoryWkPtr_t weak_;
128  int nRandomConfig_;
130  int nDiscreteSteps_;
132  IkSolverInitializationPtr_t ikSolverInit_;
134  bool feasibilityOnly_;
135  }; // class EndEffectorTrajectory
136  } // namespace pathPlanner
137  } // namespace manipulation
138 } // namespace hpp
139 
140 #endif // HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
Definition: main.hh:1
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:58
core::vectorIn_t vectorIn_t
Definition: fwd.hh:86
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:37
Definition: end-effector-trajectory.hh:51
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:56
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
Configurations_t solve(vectorIn_t target)
Definition: end-effector-trajectory.hh:38
shared_ptr< IkSolverInitialization > IkSolverInitializationPtr_t
Definition: end-effector-trajectory.hh:46
void nDiscreteSteps(int n)
Definition: end-effector-trajectory.hh:88
int nDiscreteSteps() const
Number of steps to generate goal config (successive projections).
Definition: end-effector-trajectory.hh:85
Definition: end-effector-trajectory.hh:33
int nRandomConfig() const
Definition: end-effector-trajectory.hh:75
bool checkFeasibilityOnly() const
Definition: end-effector-trajectory.hh:98
HPP_PREDEF_CLASS(EndEffectorTrajectory)
void nRandomConfig(int n)
Definition: end-effector-trajectory.hh:78
std::vector< Configuration_t > Configurations_t
Definition: end-effector-trajectory.hh:36
void ikSolverInitialization(IkSolverInitializationPtr_t solver)
Definition: end-effector-trajectory.hh:103
shared_ptr< EndEffectorTrajectory > EndEffectorTrajectoryPtr_t
Definition: end-effector-trajectory.hh:49