hpp-rbprm  4.10.0
Implementation of RB-PRM planner using hpp.
sample.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Steve Tonneau (steve.tonneau@laas.fr)
4 //
5 // This file is part of hpp-rbprm.
6 // hpp-rbprm 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-rbprm 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_RBPRM_SAMPLE_HH
20 # define HPP_RBPRM_SAMPLE_HH
21 
22 #include <Eigen/StdVector>
23 
24 #include <hpp/rbprm/config.hh>
25 #include <hpp/pinocchio/device.hh>
26 
27 #include <deque>
28 namespace hpp {
29 
30  namespace rbprm {
31  namespace sampling{
32  HPP_PREDEF_CLASS(Sample);
33 
37  class Sample;
38  typedef boost::shared_ptr <Sample> SamplePtr_t;
39 
41  {
42  public:
44  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 
53  Sample(const pinocchio::JointPtr_t limb, const pinocchio::Frame effector, const fcl::Vec3f& offset = fcl::Vec3f(0,0,0),const fcl::Vec3f& limbOffset = fcl::Vec3f(0,0,0), const std::size_t id =0);
54 
55 
56  Sample(const std::size_t id, const std::size_t length, const std::size_t startRank, const double staticValue,
57  const fcl::Vec3f& effectorPosition,const fcl::Vec3f& effectorPositionInLimbFrame, const pinocchio::ConfigurationIn_t configuration, const Eigen::MatrixXd& jacobian,
58  const Eigen::Matrix <pinocchio::value_type, 6, 6>& jacobianProduct);
59 
66  Sample(const pinocchio::JointPtr_t limb, const pinocchio::Frame effector, pinocchio::ConfigurationIn_t configuration, const fcl::Vec3f& offset = fcl::Vec3f(0,0,0),const fcl::Vec3f& limbOffset = fcl::Vec3f(0,0,0), const std::size_t id =0);
67  Sample(const Sample &clone);
68  ~Sample(){}
69 
70  public:
71  std::size_t startRank_;
72  std::size_t length_;
73  pinocchio::Configuration_t configuration_;
75  fcl::Vec3f effectorPosition_;
77  Eigen::MatrixXd jacobian_;
79  Eigen::Matrix <pinocchio::value_type, 6, 6> jacobianProduct_;
81  std::size_t id_;
82  double staticValue_;
83  //const fcl::Transform3f rotation_; TODO
84  }; // class Sample
85 
86  struct sample_greater {
87  bool operator() (const Sample& lhs, const Sample& rhs) const{
88  return lhs.staticValue_ > rhs.staticValue_;
89  }
90  };
91 
92  typedef std::vector<Sample, Eigen::aligned_allocator<Sample> > SampleVector_t;
100 SampleVector_t GenerateSamples(const pinocchio::JointPtr_t limb, const std::string& effector, const std::size_t nbSamples,const fcl::Vec3f& offset = fcl::Vec3f(0,0,0),const fcl::Vec3f& limbOffset = fcl::Vec3f(0,0,0));
101 
105 void Load(const Sample& sample, pinocchio::ConfigurationOut_t robot);
106 
107  } // namespace sampling
108 } // namespace rbprm
109 } // namespace hpp
110 #endif // HPP_RBPRM_SAMPLE_HH
hpp::rbprm::sampling::Sample::effectorPosition_
fcl::Vec3f effectorPosition_
Position relative to robot root (ie, robot base at 0 everywhere)
Definition: sample.hh:75
hpp::rbprm::sampling::SampleVector_t
std::vector< Sample, Eigen::aligned_allocator< Sample > > SampleVector_t
Definition: sample.hh:92
hpp::rbprm::sampling::Sample::length_
std::size_t length_
Definition: sample.hh:72
hpp::rbprm::sampling::Sample::staticValue_
double staticValue_
Definition: sample.hh:82
hpp::rbprm::sampling::SamplePtr_t
boost::shared_ptr< Sample > SamplePtr_t
Definition: sample.hh:37
hpp::rbprm::sampling::Sample::jacobian_
Eigen::MatrixXd jacobian_
Definition: sample.hh:77
hpp::rbprm::sampling::Sample
Definition: sample.hh:40
hpp::rbprm::sampling::GenerateSamples
SampleVector_t GenerateSamples(const pinocchio::JointPtr_t limb, const std::string &effector, const std::size_t nbSamples, const fcl::Vec3f &offset=fcl::Vec3f(0, 0, 0), const fcl::Vec3f &limbOffset=fcl::Vec3f(0, 0, 0))
hpp::rbprm::sampling::sample_greater::operator()
bool operator()(const Sample &lhs, const Sample &rhs) const
Definition: sample.hh:87
hpp
Definition: algorithm.hh:27
hpp::rbprm::sampling::Load
void Load(const Sample &sample, pinocchio::ConfigurationOut_t robot)
hpp::rbprm::sampling::Sample::~Sample
~Sample()
Definition: sample.hh:68
hpp::rbprm::sampling::Sample::effectorPositionInLimbFrame_
fcl::Vec3f effectorPositionInLimbFrame_
Definition: sample.hh:76
hpp::rbprm::sampling::Sample::configuration_
pinocchio::Configuration_t configuration_
Definition: sample.hh:73
hpp::rbprm::sampling::sample_greater
Definition: sample.hh:86
hpp::rbprm::sampling::Sample::startRank_
std::size_t startRank_
Definition: sample.hh:71
hpp::rbprm::sampling::Sample::id_
std::size_t id_
id in sample container
Definition: sample.hh:81
hpp::rbprm::sampling::Sample::jacobianProduct_
Eigen::Matrix< pinocchio::value_type, 6, 6 > jacobianProduct_
Product of the jacobian by its transpose.
Definition: sample.hh:79
hpp::rbprm::sampling::HPP_PREDEF_CLASS
HPP_PREDEF_CLASS(OctreeNode)
config.hh
HPP_RBPRM_DLLAPI
#define HPP_RBPRM_DLLAPI
Definition: config.hh:64