hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
distance-between-bodies.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015 CNRS
3 // Authors: Florent Lamiraux
4 //
5 //
6 // This file is part of hpp-constraints.
7 // hpp-constraints is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-constraints is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-constraints. If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_CONSTRAINTS_DISTANCE_BETWEEN_BODIES_HH
21 # define HPP_CONSTRAINTS_DISTANCE_BETWEEN_BODIES_HH
22 
23 # include <pinocchio/multibody/geometry.hpp>
24 
27 
28 # include <hpp/constraints/fwd.hh>
30 
31 namespace hpp {
32  namespace constraints {
40  class HPP_CONSTRAINTS_DLLAPI DistanceBetweenBodies :
42  {
43  public:
44  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 
52  static DistanceBetweenBodiesPtr_t create (const std::string& name,
53  const DevicePtr_t& robot,
54  const JointPtr_t& joint1,
55  const JointPtr_t& joint2);
56 
63  static DistanceBetweenBodiesPtr_t create (const std::string& name,
64  const DevicePtr_t& robot,
65  const JointPtr_t& joint,
66  const std::vector<CollisionObjectPtr_t>& objects);
67 
68  virtual ~DistanceBetweenBodies () {}
69 
70  protected:
77  DistanceBetweenBodies (const std::string& name, const DevicePtr_t& robot,
78  const JointPtr_t& joint1,
79  const JointPtr_t& joint2);
80 
87  DistanceBetweenBodies (const std::string& name, const DevicePtr_t& robot,
88  const JointPtr_t& joint,
89  const std::vector<CollisionObjectPtr_t>& objects);
90 
91  virtual void impl_compute (LiegroupElementRef result,
92  ConfigurationIn_t argument) const;
93  virtual void impl_jacobian (matrixOut_t jacobian,
94  ConfigurationIn_t arg) const;
95  private:
96  typedef ::pinocchio::GeometryData GeometryData;
97 
98  DevicePtr_t robot_;
99  JointPtr_t joint1_;
100  JointPtr_t joint2_;
101  mutable GeometryData data_;
102  mutable std::size_t minIndex_;
103  mutable Configuration_t latestArgument_;
104  mutable LiegroupElement latestResult_;
105  }; // class DistanceBetweenBodies
106  } // namespace constraints
107 } // namespace hpp
108 
109 #endif //HPP_CONSTRAINTS_DISTANCE_BETWEEN_BODIES_HH
Definition: distance-between-bodies.hh:40
virtual ~DistanceBetweenBodies()
Definition: distance-between-bodies.hh:68
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:87
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:37
Definition: differentiable-function.hh:50
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
boost::shared_ptr< DistanceBetweenBodies > DistanceBetweenBodiesPtr_t
Definition: fwd.hh:103