hpp-manipulation  9.0.2
Classes for manipulation planning.
cartesian.hh
Go to the documentation of this file.
1 // Copyright (c) 2026, LAAS-CNRS
2 // Authors: Florent Lamiraux
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_STEERING_METHOD_CARTESIAN_HH
30 #define HPP_MANIPULATION_STEERING_METHOD_CARTESIAN_HH
31 
32 #include <hpp/manipulation/fwd.hh>
33 
34 namespace hpp {
35 namespace manipulation {
36 namespace steeringMethod {
37 
39 typedef shared_ptr<Cartesian> CartesianPtr_t;
40 
64 class Cartesian {
65  public:
70 
72 
103  vectorIn_t weights);
104 
106  void maxIterations(size_type iterations);
109 
111  void errorThreshold(const value_type& threshold);
117  const ImplicitPtr_t& trajectoryConstraint() { return trajConstraint_; }
122  void rightHandSide(const PathPtr_t& rhs, bool se3Output);
123 
128  const interval_t& timeRange);
129 
131  const DifferentiableFunctionPtr_t& rightHandSide() const { return rhs_; }
132 
134  const interval_t& timeRange() const { return timeRange_; }
135 
137  size_type nDiscreteSteps() const { return nDiscreteSteps_; }
138 
140  assert(n > 0);
141  nDiscreteSteps_ = n;
142  }
143 
166  bool planPath(ConfigurationIn_t q_init, PathPtr_t& result);
167 
168  protected:
172  void checkProblem(const std::string& method);
173 
174  private:
176  pinocchio::DevicePtr_t robot_;
178  core::ConstraintSetPtr_t constraints_;
180  ImplicitPtr_t trajConstraint_;
182  interval_t timeRange_;
185  size_type nDiscreteSteps_;
186 
187 }; // class Cartesian
188 
191 
193 
194 } // namespace steeringMethod
195 } // namespace manipulation
196 } // namespace hpp
197 
198 #endif // HPP_MANIPULATION_STEERING_METHOD_CARTESIAN_HH
Cartesian(const core::ProblemConstPtr_t &problem)
Store the constraints of the problem.
void nDiscreteSteps(size_type n)
Definition: cartesian.hh:139
const ImplicitPtr_t & trajectoryConstraint()
Get the trajectory constraint.
Definition: cartesian.hh:117
bool planPath(ConfigurationIn_t q_init, PathPtr_t &result)
Plan a path starting from an initial configuration.
value_type errorThreshold() const
Get error threshold of numerical solver.
core::ConfigurationIn_t ConfigurationIn_t
Definition: cartesian.hh:67
void rightHandSide(const PathPtr_t &rhs, bool se3Output)
size_type nDiscreteSteps() const
Number of steps to generate goal config (successive projections).
Definition: cartesian.hh:137
const DifferentiableFunctionPtr_t & rightHandSide() const
Get time-varying right hand side of trajectory constraint.
Definition: cartesian.hh:131
void checkProblem(const std::string &method)
constraints::ImplicitPtr_t ImplicitPtr_t
Definition: cartesian.hh:66
void maxIterations(size_type iterations)
Set maximal number of iterations of numerical solver.
void trajectoryConstraint(const ImplicitPtr_t &ic)
Set the trajectory constraint.
static CartesianPtr_t create(const core::ProblemConstPtr_t &problem)
void errorThreshold(const value_type &threshold)
Set error threshold of numerical solver.
core::interval_t interval_t
Definition: cartesian.hh:68
core::PathPtr_t PathPtr_t
Definition: cartesian.hh:69
const interval_t & timeRange() const
Get interval of definition of right hand side of trajectory constraint.
Definition: cartesian.hh:134
void rightHandSide(const DifferentiableFunctionPtr_t &rhs, const interval_t &timeRange)
size_type maxIterations() const
Get maximal number of iterations of numerical solver.
static PathPtr_t makePiecewiseLinearTrajectory(matrixIn_t points, vectorIn_t weights)
PathPtr_t projectedPath(vectorIn_t times, matrixIn_t configs) const
ProblemConstPtr_t problem() const
assert(d.lhs()._blocks()==d.rhs()._blocks())
shared_ptr< Implicit > ImplicitPtr_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
std::pair< value_type, value_type > interval_t
shared_ptr< const Problem > ProblemConstPtr_t
shared_ptr< ConstraintSet > ConstraintSetPtr_t
shared_ptr< Path > PathPtr_t
shared_ptr< Cartesian > CartesianPtr_t
Definition: cartesian.hh:39
HPP_PREDEF_CLASS(EndEffectorTrajectory)
core::DifferentiableFunctionPtr_t DifferentiableFunctionPtr_t
Definition: fwd.hh:139
core::matrixIn_t matrixIn_t
Definition: fwd.hh:147
core::size_type size_type
Definition: fwd.hh:90
core::value_type value_type
Definition: fwd.hh:89
core::vectorIn_t vectorIn_t
Definition: fwd.hh:93
shared_ptr< Device > DevicePtr_t