hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
gaussian.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 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_CONFIGURATION_SHOOTER_GAUSSIAN_HH
20 # define HPP_CORE_CONFIGURATION_SHOOTER_GAUSSIAN_HH
21 
22 # include <sstream>
23 
24 # include <hpp/pinocchio/device.hh>
25 
27 
28 namespace hpp {
29  namespace core {
30  namespace configurationShooter {
33 
36  class HPP_CORE_DLLAPI Gaussian :
38  {
39  public:
40  static GaussianPtr_t create (const DevicePtr_t& robot)
41  {
42  Gaussian* ptr = new Gaussian (robot);
43  GaussianPtr_t shPtr (ptr);
44  ptr->init (shPtr);
45  return shPtr;
46  }
47 
49  {
50  center_ = c;
51  }
52  const Configuration_t& center () const
53  {
54  return center_;
55  }
56 
65  void sigma (const value_type& factor);
66 
67  void sigmas (vectorIn_t s)
68  {
69  assert (s.size() == robot_->numberDof());
70  sigmas_ = s;
71  }
72  const vector_t& sigmas () const
73  {
74  return sigmas_;
75  }
76 
77  protected:
81  Gaussian (const DevicePtr_t& robot)
82  : robot_ (robot)
83  , center_ (robot->currentConfiguration())
84  , sigmas_ (robot->numberDof())
85  {
86  sigma(1./4.);
87  }
88  void init (const GaussianPtr_t& self)
89  {
91  weak_ = self;
92  }
93 
94  virtual void impl_shoot (Configuration_t& q) const;
95  private:
96  const DevicePtr_t& robot_;
98  Configuration_t center_;
100  vector_t sigmas_;
101 
102  GaussianWkPtr_t weak_;
103  }; // class Gaussian
105  } // namespace configurationShooter
106  } // namespace core
107 } // namespace hpp
108 
109 #endif // HPP_CORE_CONFIGURATION_SHOOTER_GAUSSIAN_HH
boost::shared_ptr< Gaussian > GaussianPtr_t
Definition: fwd.hh:338
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
void center(ConfigurationIn_t c)
Definition: gaussian.hh:48
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Gaussian(const DevicePtr_t &robot)
Definition: gaussian.hh:81
Vec3f c
const Configuration_t & center() const
Definition: gaussian.hh:52
assert(d.lhs()._blocks()==d.rhs()._blocks())
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:202
void init(const ConfigurationShooterWkPtr_t &weak)
Store weak pointer to itself.
Definition: configuration-shooter.hh:59
void init(const GaussianPtr_t &self)
Definition: gaussian.hh:88
void sigmas(vectorIn_t s)
Definition: gaussian.hh:67
static GaussianPtr_t create(const DevicePtr_t &robot)
Definition: gaussian.hh:40
pinocchio::vector_t vector_t
Definition: fwd.hh:201
pinocchio::value_type value_type
Definition: fwd.hh:157
const vector_t & sigmas() const
Definition: gaussian.hh:72
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96
Definition: configuration-shooter.hh:34