hpp-constraints: include/hpp/constraints/min-manipulability.hh Source File

hpp-constraints 9.0.2 Definition of basic geometric constraints for motion planning

Loading...
Searching...
No Matches
min-manipulability.hh
Go to the documentation of this file.
1// Copyright (c) 2018 - 2026 CNRS
2// Authors: Joseph Mirabel, 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_CONSTRAINTS_MIN_MANIPULABILITY_HH
30#define HPP_CONSTRAINTS_MIN_MANIPULABILITY_HH
31
32#include <hpp/constraints/config.hh>
33#include <hpp/constraints/differentiable-function.hh>
34#include <hpp/constraints/fwd.hh>
35#include <hpp/constraints/matrix-view.hh>
36
37 namespace hpp {
38 namespace constraints {
39HPP_PREDEF_CLASS(MinManipulability);
40 typedef shared_ptr<MinManipulability> MinManipulabilityPtr_t;
41
44
76 class HPP_CONSTRAINTS_DLLAPI MinManipulability : public DifferentiableFunction {
77 public:
78 virtual ~MinManipulability() {}
79
80 static MinManipulabilityPtr_t create(DifferentiableFunctionPtr_t function,
81 DevicePtr_t robot, std::string name) {
82 return MinManipulabilityPtr_t(new MinManipulability(function, robot, name));
83 }
84
88 void lockJoint(const JointPtr_t& joint);
89
91 const DevicePtr_t& robot() const { return robot_; }
92
93 protected:
98 MinManipulability(DifferentiableFunctionPtr_t function, DevicePtr_t robot,
99 std::string name);
100
101 void impl_compute(LiegroupElementRef result, vectorIn_t argument) const;
102
103 void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg) const;
104
105 bool isEqual(const DifferentiableFunction& other) const {
106 const MinManipulability& castother =
107 dynamic_cast<const MinManipulability&>(other);
108 if (!DifferentiableFunction::isEqual(other)) return false;
109
110 if (function_ != castother.function_) return false;
111 if (robot_ != castother.robot_) return false;
112 if (cols_.cols() != castother.cols_.cols()) return false;
113 if (J_ != castother.J_) return false;
114 if (J_JT_ != castother.J_JT_) return false;
115
116 return true;
117 }
118
119 private:
120 DifferentiableFunctionPtr_t function_;
121 DevicePtr_t robot_;
122
123 Eigen::ColBlockIndices cols_;
124 ArrayXb activeAndNonLockedDerivParams_;
125 mutable matrix_t J_, J_JT_;
126}; // class MinManipulability
128} // namespace constraints
129} // namespace hpp
130
131#endif // HPP_CONSTRAINTS_MIN_MANIPULABILITY_HH
Eigen::MatrixBlocks< true, false >
Eigen::MatrixBlocks::cols
const ColIndices_t & cols() const
Definition matrix-view.hh:679
hpp::constraints::DifferentiableFunction
Definition differentiable-function.hh:63
hpp::constraints::MinManipulability
Definition min-manipulability.hh:76
hpp::constraints::MinManipulability::impl_jacobian
void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg) const
hpp::constraints::MinManipulability::~MinManipulability
virtual ~MinManipulability()
Definition min-manipulability.hh:78
hpp::constraints::MinManipulability::MinManipulability
MinManipulability(DifferentiableFunctionPtr_t function, DevicePtr_t robot, std::string name)
Concrete class constructor should call this constructor.
hpp::constraints::MinManipulability::impl_compute
void impl_compute(LiegroupElementRef result, vectorIn_t argument) const
User implementation of function evaluation.
hpp::constraints::MinManipulability::create
static MinManipulabilityPtr_t create(DifferentiableFunctionPtr_t function, DevicePtr_t robot, std::string name)
Definition min-manipulability.hh:80
hpp::constraints::MinManipulability::lockJoint
void lockJoint(const JointPtr_t &joint)
hpp::constraints::MinManipulability::isEqual
bool isEqual(const DifferentiableFunction &other) const
Definition min-manipulability.hh:105
hpp::constraints::MinManipulability::robot
const DevicePtr_t & robot() const
Get robot.
Definition min-manipulability.hh:91
hpp::pinocchio::LiegroupElementBase
config.hh
HPP_CONSTRAINTS_DLLAPI
#define HPP_CONSTRAINTS_DLLAPI
Definition config.hh:88
differentiable-function.hh
fwd.hh
matrix-view.hh
hpp::constraints::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
Definition fwd.hh:111
hpp::constraints::DifferentiableFunctionPtr_t
shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition fwd.hh:115
hpp::constraints::MinManipulabilityPtr_t
shared_ptr< MinManipulability > MinManipulabilityPtr_t
Definition min-manipulability.hh:40
hpp::constraints::ArrayXb
pinocchio::ArrayXb ArrayXb
Definition fwd.hh:81
hpp::constraints::vectorIn_t
pinocchio::vectorIn_t vectorIn_t
Definition fwd.hh:61
hpp::constraints::matrix_t
pinocchio::matrix_t matrix_t
Definition fwd.hh:57
hpp::constraints::matrixOut_t
Eigen::Ref< matrix_t > matrixOut_t
Definition fwd.hh:59
hpp::constraints::JointPtr_t
pinocchio::JointPtr_t JointPtr_t
Definition fwd.hh:50
hpp