hpp-manipulation 9.3.0
Classes for manipulation planning.
Loading...
Searching...
No Matches
end-effector-trajectory.hh
Go to the documentation of this file.
1// Copyright (c) 2019 CNRS
2// Authors: Joseph Mirabel
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
30#define HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
31
33#include <hpp/manipulation/config.hh>
34#include <hpp/manipulation/deprecated.hh>
37#include <pinocchio/spatial/se3.hpp>
38
39namespace hpp {
40namespace manipulation {
41namespace pathPlanner {
42class HPP_MANIPULATION_DLLAPI IkSolverInitialization {
43 public:
44 typedef std::vector<Configuration_t> Configurations_t;
45
46 Configurations_t solve(vectorIn_t target) { return impl_solve(target); }
47
48 protected:
50};
51typedef shared_ptr<IkSolverInitialization> IkSolverInitializationPtr_t;
52
54typedef shared_ptr<EndEffectorTrajectory> EndEffectorTrajectoryPtr_t;
55
58
98class HPP_MANIPULATION_DLLAPI EndEffectorTrajectory : public core::PathPlanner {
99 public:
103 const problem) HPP_MANIPULATION_DEPRECATED;
108 const problem,
109 const roadmap) HPP_MANIPULATION_DEPRECATED;
110
116 virtual void startSolve();
117
119 virtual void oneStep();
120
123 int nRandomConfig() const { return nRandomConfig_; }
124
125 void nRandomConfig(int n) {
126 assert(n >= 0);
127 nRandomConfig_ = n;
128 }
129
131 int nDiscreteSteps() const { return nDiscreteSteps_; }
132
133 void nDiscreteSteps(int n) {
134 assert(n > 0);
135 nDiscreteSteps_ = n;
136 }
137
140 void checkFeasibilityOnly(bool enable);
141
142 bool checkFeasibilityOnly() const { return feasibilityOnly_; }
143
145 ikSolverInit_ = solver;
146 }
147
151
152 protected:
160 const roadmap);
162 void init(const EndEffectorTrajectoryWkPtr_t& weak);
163
164 private:
165 std::vector<core::Configuration_t> configurations(
166 const core::Configuration_t& q_init);
167
169 EndEffectorTrajectoryWkPtr_t weak_;
171 int nRandomConfig_;
173 int nDiscreteSteps_;
175 IkSolverInitializationPtr_t ikSolverInit_;
177 bool feasibilityOnly_;
178}; // class EndEffectorTrajectory
179// \}
180} // namespace pathPlanner
181} // namespace manipulation
182} // namespace hpp
183
184#endif // HPP_MANIPULATION_PATH_PLANNER_END_EFFECTOR_TRAJECTORY_HH
ProblemConstPtr_t problem() const
virtual const RoadmapPtr_t & roadmap() const
Definition end-effector-trajectory.hh:98
Definition end-effector-trajectory.hh:42
static EndEffectorTrajectoryPtr_t createWithRoadmap(const core::ProblemConstPtr_t &problem, const core::RoadmapPtr_t &roadmap) HPP_MANIPULATION_DEPRECATED
void nDiscreteSteps(int n)
Definition end-effector-trajectory.hh:133
void ikSolverInitialization(IkSolverInitializationPtr_t solver)
Definition end-effector-trajectory.hh:144
virtual Configurations_t impl_solve(vectorIn_t target)=0
void init(const EndEffectorTrajectoryWkPtr_t &weak)
Store weak pointer to itself.
static EndEffectorTrajectoryPtr_t create(const core::ProblemConstPtr_t &problem) HPP_MANIPULATION_DEPRECATED
Configurations_t solve(vectorIn_t target)
Definition end-effector-trajectory.hh:46
EndEffectorTrajectory(const core::ProblemConstPtr_t &problem, const core::RoadmapPtr_t &roadmap)
bool checkFeasibilityOnly() const
Definition end-effector-trajectory.hh:142
std::vector< Configuration_t > Configurations_t
Definition end-effector-trajectory.hh:44
int nRandomConfig() const
Definition end-effector-trajectory.hh:123
int nDiscreteSteps() const
Number of steps to generate goal config (successive projections).
Definition end-effector-trajectory.hh:131
EndEffectorTrajectory(const core::ProblemConstPtr_t &problem)
virtual void oneStep()
One step of the algorithm.
void nRandomConfig(int n)
Definition end-effector-trajectory.hh:125
shared_ptr< Roadmap > RoadmapPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
pinocchio::Configuration_t Configuration_t
Definition fwd.hh:97
shared_ptr< EndEffectorTrajectory > EndEffectorTrajectoryPtr_t
Definition fwd.hh:99
HPP_PREDEF_CLASS(EndEffectorTrajectory)
shared_ptr< IkSolverInitialization > IkSolverInitializationPtr_t
Definition end-effector-trajectory.hh:51
Definition connected-component.hh:39
core::vectorIn_t vectorIn_t
Definition fwd.hh:93