hpp-constraints  6.0.0
Definition of basic geometric constraints for motion planning
relative-pose.hh
Go to the documentation of this file.
1 // Copyright (c) 2018, 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_CONSTRAINTS_EXPLICIT_RELATIVE_POSE_HH
30 #define HPP_CONSTRAINTS_EXPLICIT_RELATIVE_POSE_HH
31 
33 #include <pinocchio/spatial/se3.hpp>
34 
35 namespace hpp {
36 namespace constraints {
37 namespace explicit_ {
76  public:
78  virtual ImplicitPtr_t copy() const;
96  const std::string& name, const DevicePtr_t& robot,
97  const JointConstPtr_t& joint1, const JointConstPtr_t& joint2,
98  const Transform3s& frame1, const Transform3s& frame2,
99  ComparisonTypes_t comp, std::vector<bool> mask = std::vector<bool>());
100 
102 
116  virtual void outputValue(LiegroupElementRef result, vectorIn_t qin,
117  LiegroupElementConstRef rhs) const;
118 
128  virtual void jacobianOutputValue(vectorIn_t qin,
129  LiegroupElementConstRef f_value,
131  matrixOut_t jacobian) const;
132 
133  protected:
150  RelativePose(const std::string& name, const DevicePtr_t& robot,
151  const JointConstPtr_t& joint1, const JointConstPtr_t& joint2,
152  const Transform3s& frame1, const Transform3s& frame2,
154  std::vector<bool> mask = std::vector<bool>(6, true));
155 
157  RelativePose(const RelativePose& other);
158 
160  void init(RelativePoseWkPtr_t weak);
161 
162  private:
184  void implicitToExplicitRhs(LiegroupElementConstRef implicitRhs,
185  vectorOut_t explicitRhs) const;
204  void explicitToImplicitRhs(vectorIn_t explicitRhs,
205  LiegroupElementRef implicitRhs) const;
206  // Create LiegroupSpace instances to avoid useless allocation.
207  static LiegroupSpacePtr_t SE3;
208  static LiegroupSpacePtr_t R3xSO3;
209  JointConstPtr_t joint1_, joint2_;
210  Transform3s frame1_;
211  Transform3s frame2_;
212  RelativePoseWkPtr_t weak_;
213 
214  RelativePose() {}
215  HPP_SERIALIZABLE();
216 }; // class RelativePose
217 } // namespace explicit_
218 } // namespace constraints
219 } // namespace hpp
220 
221 BOOST_CLASS_EXPORT_KEY(hpp::constraints::explicit_::RelativePose)
222 
223 #endif // HPP_CONSTRAINTS_EXPLICIT_RELATIVE_POSE_HH
Definition: explicit.hh:143
Definition: relative-pose.hh:75
virtual ImplicitPtr_t copy() const
Copy object and return shared pointer to copy.
virtual void jacobianOutputValue(vectorIn_t qin, LiegroupElementConstRef f_value, LiegroupElementConstRef rhs, matrixOut_t jacobian) const
virtual void outputValue(LiegroupElementRef result, vectorIn_t qin, LiegroupElementConstRef rhs) const
static RelativePosePtr_t createCopy(const RelativePosePtr_t &other)
RelativePose(const RelativePose &other)
Copy constructor.
static RelativePosePtr_t create(const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint1, const JointConstPtr_t &joint2, const Transform3s &frame1, const Transform3s &frame2, ComparisonTypes_t comp, std::vector< bool > mask=std::vector< bool >())
RelativePose(const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint1, const JointConstPtr_t &joint2, const Transform3s &frame1, const Transform3s &frame2, ComparisonTypes_t comp=ComparisonTypes_t(), std::vector< bool > mask=std::vector< bool >(6, true))
void init(RelativePoseWkPtr_t weak)
Store weak pointer to itself.
#define HPP_CONSTRAINTS_DLLAPI
Definition: config.hh:88
shared_ptr< RelativePose > RelativePosePtr_t
Definition: fwd.hh:195
std::vector< ComparisonType > ComparisonTypes_t
Definition: fwd.hh:180
pinocchio::Transform3s Transform3s
Definition: fwd.hh:64
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:109
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:69
shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:173
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:60
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:58
pinocchio::vectorOut_t vectorOut_t
Definition: fwd.hh:61
pinocchio::LiegroupElementConstRef LiegroupElementConstRef
Definition: fwd.hh:67
pinocchio::LiegroupElementRef LiegroupElementRef
Definition: fwd.hh:66
pinocchio::JointConstPtr_t JointConstPtr_t
Definition: fwd.hh:50
Definition: active-set-differentiable-function.hh:36