hpp-constraints  9.0.2
Definition of basic geometric constraints for motion planning
manipulability.hh
Go to the documentation of this file.
1 // Copyright (c) 2018 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_CONSTRAINTS_MANIPULABILITY_HH
30 #define HPP_CONSTRAINTS_MANIPULABILITY_HH
31 
34 #include <hpp/constraints/fwd.hh>
36 
37 namespace hpp {
38 namespace constraints {
40 typedef shared_ptr<Manipulability> ManipulabilityPtr_t;
41 
44 
70 
72  public:
73  virtual ~Manipulability() {}
74 
76  DevicePtr_t robot, std::string name) {
77  return ManipulabilityPtr_t(new Manipulability(function, robot, name));
78  }
79 
83  void lockJoint(const JointPtr_t& joint);
84 
86  const DevicePtr_t& robot() const { return robot_; }
87 
88  protected:
94  std::string name);
95 
96  void impl_compute(LiegroupElementRef result, vectorIn_t argument) const;
97 
98  void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg) const;
99 
100  bool isEqual(const DifferentiableFunction& other) const {
101  const Manipulability& castother =
102  dynamic_cast<const Manipulability&>(other);
103  if (!DifferentiableFunction::isEqual(other)) return false;
104 
105  if (function_ != castother.function_) return false;
106  if (robot_ != castother.robot_) return false;
107  if (cols_.cols() != castother.cols_.cols()) return false;
108  if (J_ != castother.J_) return false;
109  if (J_JT_ != castother.J_JT_) return false;
110 
111  return true;
112  }
113 
114  private:
115  DifferentiableFunctionPtr_t function_;
116  DevicePtr_t robot_;
117 
119  ArrayXb activeAndNonLockedDerivParams_;
120  mutable matrix_t J_, J_JT_;
121 }; // class Manipulability
123 } // namespace constraints
124 } // namespace hpp
125 
126 #endif // HPP_CONSTRAINTS_MANIPULABILITY_HH
const ColIndices_t & cols() const
Definition: matrix-view.hh:679
Definition: differentiable-function.hh:63
virtual bool isEqual(const DifferentiableFunction &other) const
Definition: differentiable-function.hh:223
Definition: manipulability.hh:71
void impl_compute(LiegroupElementRef result, vectorIn_t argument) const
User implementation of function evaluation.
void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg) const
bool isEqual(const DifferentiableFunction &other) const
Definition: manipulability.hh:100
const DevicePtr_t & robot() const
Get robot.
Definition: manipulability.hh:86
virtual ~Manipulability()
Definition: manipulability.hh:73
static ManipulabilityPtr_t create(DifferentiableFunctionPtr_t function, DevicePtr_t robot, std::string name)
Definition: manipulability.hh:75
void lockJoint(const JointPtr_t &joint)
Manipulability(DifferentiableFunctionPtr_t function, DevicePtr_t robot, std::string name)
Concrete class constructor should call this constructor.
#define HPP_CONSTRAINTS_DLLAPI
Definition: config.hh:88
HPP_PREDEF_CLASS(DifferentiableFunction)
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:111
shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition: fwd.hh:115
pinocchio::ArrayXb ArrayXb
Definition: fwd.hh:81
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:61
shared_ptr< Manipulability > ManipulabilityPtr_t
Definition: manipulability.hh:40
pinocchio::matrix_t matrix_t
Definition: fwd.hh:57
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:59
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:50