hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
relative-motion.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016 CNRS
3 // Authors: Joseph Mirabel
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_RELATIVE_MOTION_HH
20 #define HPP_CORE_RELATIVE_MOTION_HH
21 
22 #include <Eigen/Core>
23 
24 #include <hpp/pinocchio/fwd.hh>
25 #include <hpp/core/fwd.hh>
26 #include <hpp/pinocchio/joint.hh>
27 
28 namespace hpp {
29  namespace core {
30  struct RelativeMotion {
40  };
41 
51  typedef Eigen::Matrix<RelativeMotionType, Eigen::Dynamic, Eigen::Dynamic> matrix_type;
52 
60  static matrix_type matrix (const DevicePtr_t& robot);
61 
69  static void fromConstraint (
70  matrix_type& matrix,
71  const DevicePtr_t& robot,
72  const ConstraintSetPtr_t& constraint);
73 
88  static void recurseSetRelMotion(matrix_type& matrix,
89  const size_type& i1, const size_type& i2,
90  const RelativeMotionType& type);
91 
95  static inline size_type idx(const JointConstPtr_t& joint)
96  {
97  return (joint ? joint->index() : 0);
98  }
99  };
100  } // namespace core
101 } // namespace hpp
102 
103 namespace Eigen {
105  : NumTraits<int> {};
106 } // namespace Eigen
107 
108 #endif // HPP_CORE_RELATIVE_MOTION_HH
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
static void fromConstraint(matrix_type &matrix, const DevicePtr_t &robot, const ConstraintSetPtr_t &constraint)
boost::shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition: fwd.hh:110
pinocchio::size_type size_type
Definition: fwd.hh:156
pinocchio::JointConstPtr_t JointConstPtr_t
Definition: fwd.hh:132
static matrix_type matrix(const DevicePtr_t &robot)
static size_type idx(const JointConstPtr_t &joint)
Definition: relative-motion.hh:95
The relative motion is not constrained.
Definition: relative-motion.hh:39
Definition: relative-motion.hh:37
RelativeMotionType
Definition: relative-motion.hh:31
Definition: relative-motion.hh:34
Eigen::NumTraits< value_type > NumTraits
Eigen::Matrix< RelativeMotionType, Eigen::Dynamic, Eigen::Dynamic > matrix_type
Definition: relative-motion.hh:51
static void recurseSetRelMotion(matrix_type &matrix, const size_type &i1, const size_type &i2, const RelativeMotionType &type)
Definition: relative-motion.hh:30