hpp-python  6.1.0
python bindings for HPP, based on boost python
problem.hh
Go to the documentation of this file.
1 // problem.hh
2 //
3 // Copyright (c) 2025, CNRS
4 // Authors: Paul Sardin
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions
8 // are met:
9 
10 // 1. Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 
13 // 2. Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following
15 // disclaimer in the documentation and/or other materials provided
16 // with the distribution.
17 
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 // OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #ifndef PYHPP_CORE_PROBLEM_HH
32 #define PYHPP_CORE_PROBLEM_HH
33 
34 #include <hpp/manipulation/problem.hh>
35 #include <hpp/pinocchio/device.hh>
36 #include <hpp/util/pointer.hh>
37 #include <pyhpp/core/fwd.hh>
38 
39 namespace pyhpp {
40 namespace core {
41 
42 struct SteeringMethod;
43 typedef std::shared_ptr<SteeringMethod> PyWSteeringMethodPtr_t;
44 
59 
60 // Wrapper class for hpp::core::Problem
61 struct Problem {
63 
64  Problem(const DevicePtr_t& robot);
65  Problem(hpp::core::ProblemPtr_t problemPtr) : obj(problemPtr) {}
66 
67  // wrapped methods
68  const DevicePtr_t& robot() const;
69  void setParameter(const std::string& name, const Parameter& value);
70  void setParameterFloat(const std::string& name, value_type value);
71  void setParameterInt(const std::string& name, size_type value);
72  const Parameter& getParameter(const std::string& name) const;
78  const ProblemTargetPtr_t& target() const;
85  void distance(const DistancePtr_t& d);
86  void target(const ProblemTargetPtr_t& t);
89  void initConfig(ConfigurationIn_t inConfig);
91  void addConfigValidation(const std::string& type);
93 
95  auto manipProb = HPP_DYNAMIC_PTR_CAST(hpp::manipulation::Problem, obj);
96  if (!manipProb) {
97  throw std::runtime_error("Not a manipulation problem");
98  }
99  return manipProb;
100  }
101 
102  bool isManipulationProblem() const {
104  }
105 };
106 
107 } // namespace core
108 } // namespace pyhpp
109 
110 #endif // PYHPP_CORE_PROBLEM_HH
void configValidation(const ConfigValidationsPtr_t &configValidations)
Definition: problem.cc:117
SteeringMethodPtr_t steeringMethod() const
Definition: problem.cc:88
void addConfigValidation(const ConfigValidationPtr_t &configValidation)
const DevicePtr_t & robot() const
Definition: problem.cc:53
ConfigurationShooterPtr_t configurationShooter() const
Definition: problem.cc:84
pinocchio::value_type value_type
shared_ptr< PathValidation > PathValidationPtr_t
shared_ptr< Distance > DistancePtr_t
shared_ptr< ConfigurationShooter > ConfigurationShooterPtr_t
shared_ptr< PathProjector > PathProjectorPtr_t
shared_ptr< ProblemTarget > ProblemTargetPtr_t
shared_ptr< ConfigValidations > ConfigValidationsPtr_t
shared_ptr< Problem > ProblemPtr_t
shared_ptr< SteeringMethod > SteeringMethodPtr_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
pinocchio::size_type size_type
shared_ptr< const Problem > ProblemConstPtr_t
pinocchio::DevicePtr_t DevicePtr_t
shared_ptr< Problem > ProblemPtr_t
hpp::core::ProblemConstPtr_t ProblemConstPtr_t
Definition: path-planner.hh:41
hpp::core::ConfigurationIn_t ConfigurationIn_t
Definition: problem.hh:49
hpp::core::DevicePtr_t DevicePtr_t
Definition: problem.hh:47
hpp::core::ProblemPtr_t ProblemPtr_t
Definition: problem.hh:45
hpp::core::DistancePtr_t DistancePtr_t
Definition: problem.hh:56
hpp::core::PathProjectorPtr_t PathProjectorPtr_t
Definition: problem.hh:54
hpp::core::Parameter Parameter
Definition: problem.hh:48
hpp::core::size_type size_type
Definition: problem.hh:58
hpp::core::SteeringMethodPtr_t SteeringMethodPtr_t
Definition: problem.hh:51
std::shared_ptr< SteeringMethod > PyWSteeringMethodPtr_t
Definition: problem.hh:42
hpp::core::value_type value_type
Definition: problem.hh:57
hpp::core::PathValidationPtr_t PathValidationPtr_t
Definition: problem.hh:53
hpp::core::ConfigurationShooterPtr_t ConfigurationShooterPtr_t
Definition: problem.hh:50
hpp::core::ProblemTargetPtr_t ProblemTargetPtr_t
Definition: problem.hh:55
hpp::core::ConfigValidationsPtr_t ConfigValidationsPtr_t
Definition: problem.hh:52
Definition: fwd.hh:35
#define HPP_DYNAMIC_PTR_CAST(t, x)
void pathProjector(const PathProjectorPtr_t &pp)
void setParameter(const std::string &name, const Parameter &value)
void target(const ProblemTargetPtr_t &t)
hpp::manipulation::ProblemPtr_t asManipulationProblem() const
Definition: problem.hh:94
bool isManipulationProblem() const
Definition: problem.hh:102
PathProjectorPtr_t pathProjector() const
void distance(const DistancePtr_t &d)
ConfigurationShooterPtr_t configurationShooter() const
const Parameter & getParameter(const std::string &name) const
void setParameterInt(const std::string &name, size_type value)
Definition: problem.cc:64
Problem(hpp::core::ProblemPtr_t problemPtr)
Definition: problem.hh:65
PyWSteeringMethodPtr_t steeringMethod() const
void setParameterFloat(const std::string &name, value_type value)
Definition: problem.cc:59
void configurationShooter(const ConfigurationShooterPtr_t &configurationShooter)
hpp::core::ProblemPtr_t obj
Definition: problem.hh:62
PathValidationPtr_t pathValidation() const
const ProblemTargetPtr_t & target() const
void configValidation(const ConfigValidationsPtr_t &cv)
DistancePtr_t distance() const
const DevicePtr_t & robot() const
void pathValidation(const PathValidationPtr_t &pv)
void addGoalConfig(ConfigurationIn_t config)
void initConfig(ConfigurationIn_t inConfig)