hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
uniform.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
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_UNIFORM_HH
20 # define HPP_CORE_CONFIGURATION_SHOOTER_UNIFORM_HH
21 
22 # include <sstream>
23 
24 # include <hpp/pinocchio/device.hh>
25 
27 
28 namespace hpp {
29  namespace core {
30  namespace configurationShooter {
33 
35  class HPP_CORE_DLLAPI Uniform : public ConfigurationShooter
36  {
37  public:
38  static UniformPtr_t create (const DevicePtr_t& robot)
39  {
40  Uniform* ptr = new Uniform (robot);
41  UniformPtr_t shPtr (ptr);
42  ptr->init (shPtr);
43  return shPtr;
44  }
45 
46  void sampleExtraDOF(bool sampleExtraDOF){
47  sampleExtraDOF_=sampleExtraDOF;
48  }
49 
50  protected:
54  Uniform (const DevicePtr_t& robot) : robot_ (robot),sampleExtraDOF_(true)
55  {
56  }
57  void init (const UniformPtr_t& self)
58  {
60  weak_ = self;
61  }
62 
63  virtual void impl_shoot (Configuration_t& q) const;
64  private:
65  DevicePtr_t robot_;
66  bool sampleExtraDOF_;
67  UniformWkPtr_t weak_;
68  }; // class Uniform
70  } // namespace configurationShooter
71  } // namespace core
72 } // namespace hpp
73 
74 #endif // HPP_CORE_CONFIGURATION_SHOOTER_UNIFORM_HH
Uniformly sample with bounds of degrees of freedom.
Definition: uniform.hh:35
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
static UniformPtr_t create(const DevicePtr_t &robot)
Definition: uniform.hh:38
void init(const UniformPtr_t &self)
Definition: uniform.hh:57
void init(const ConfigurationShooterWkPtr_t &weak)
Store weak pointer to itself.
Definition: configuration-shooter.hh:59
boost::shared_ptr< Uniform > UniformPtr_t
Definition: fwd.hh:336
void sampleExtraDOF(bool sampleExtraDOF)
Definition: uniform.hh:46
Uniform(const DevicePtr_t &robot)
Definition: uniform.hh:54
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96
Definition: configuration-shooter.hh:34