19 #ifndef HPP_CORE_PROBLEM_SOLVER_HH 20 # define HPP_CORE_PROBLEM_SOLVER_HH 23 # include <boost/function.hpp> 25 # include <hpp/pinocchio/fwd.hh> 28 # include <hpp/core/config.hh> 29 # include <hpp/core/deprecated.hh> 41 typedef boost::function < PathOptimizerPtr_t (const Problem&) >
49 typedef boost::function < ConfigValidationPtr_t (const DevicePtr_t&) >
54 typedef boost::function <ConfigurationShooterPtr_t (const Problem&) >
56 typedef boost::function <DistancePtr_t (const Problem&) >
58 typedef boost::function <SteeringMethodPtr_t (const Problem&) >
84 void robotType (
const std::string& type);
87 const std::string& robotType ()
const;
119 void resetGoalConfigs ();
132 virtual void pathPlannerType (
const std::string& type);
134 return pathPlannerType_;
137 void distanceType (
const std::string& type);
139 return distanceType_;
142 void steeringMethodType (
const std::string& type);
144 return steeringMethodType_;
147 void configurationShooterType (
const std::string& type);
149 return configurationShooterType_;
160 void addPathOptimizer (
const std::string& type);
162 return pathOptimizerTypes_;
165 void clearPathOptimizers ();
169 return pathOptimizers_ [rank];
184 virtual void pathValidationType (
const std::string& type,
187 tolerance = pathValidationTolerance_;
188 return pathValidationType_;
194 void pathProjectorType (
const std::string& type,
199 tolerance = pathProjectorTolerance_;
200 return pathProjectorType_;
207 virtual void addConfigValidation (
const std::string& type);
211 return configValidationTypes_;
215 void clearConfigValidations ();
218 void addConfigValidationBuilder (
const std::string& type,
239 virtual void resetConstraints ();
246 virtual void addNumericalConstraintToConfigProjector
247 (
const std::string& configProjName,
const std::string& constraintName,
248 const std::size_t priority = 0);
259 virtual void addLockedJointToConfigProjector
260 (
const std::string& configProjName,
const std::string& lockedJointName)
273 numericalConstraints.add (name, constraint);
278 void comparisonType (
const std::string& name,
281 void comparisonType (
const std::string& name,
306 void maxIterProjection (
size_type iterations);
310 return maxIterProjection_;
314 void maxIterPathPlanning (
size_type iterations);
318 return maxIterPathPlanning_;
323 timeOutPathPlanning_ = timeOut;
328 return timeOutPathPlanning_;
333 void errorThreshold (
const value_type& threshold);
337 return errorThreshold_;
342 virtual void resetProblem ();
347 virtual void resetRoadmap ();
356 void createPathOptimizers ();
361 virtual bool prepareSolveStepByStep ();
367 virtual bool executeOneStep ();
371 virtual void finishSolveStepByStep ();
374 virtual void solve ();
388 bool validate, std::size_t& pathId, std::string& report);
410 std::size_t s = paths_.size();
411 paths_.push_back (path);
418 PathVectors_t::iterator it = paths_.begin();
419 std::advance(it, pathId);
440 virtual void addObstacle (
const DevicePtr_t& device,
bool collision,
454 virtual void removeObstacle (
const std::string& name);
462 virtual void addObstacle (
const std::string& name,
470 void removeObstacleFromJoint (
const std::string& jointName,
471 const std::string& obstacleName);
475 void cutObstacle (
const std::string& name,
const fcl::AABB&
aabb);
480 void filterCollisionPairs ();
488 const Transform3f& obstacleFramePosition (
const std::string& name)
const;
495 std::list <std::string> obstacleNames (
bool collision,
bool distance)
501 return distanceBetweenObjects_;
505 {
return obstacleModel_; }
507 {
return obstacleData_; }
524 void initDistance ();
529 void initSteeringMethod ();
534 void initPathProjector ();
537 void initPathValidation ();
540 void initConfigValidation ();
543 void initValidations ();
546 virtual void initProblemTarget ();
638 std::string robotType_;
640 std::string configurationShooterType_;
642 std::string distanceType_;
644 std::string steeringMethodType_;
646 PathOptimizerTypes_t pathOptimizerTypes_;
647 PathOptimizers_t pathOptimizers_;
649 std::string pathValidationType_;
653 ConfigValidationTypes_t configValidationTypes_;
666 unsigned long int maxIterPathPlanning_;
668 double timeOutPathPlanning_;
681 #endif // HPP_CORE_PROBLEM_SOLVER_HH const std::string & steeringMethodType() const
Definition: problem-solver.hh:143
boost::function< ConfigValidationPtr_t(const DevicePtr_t &) > ConfigValidationBuilder_t
Definition: problem-solver.hh:50
Container< ConfigValidationBuilder_t > configValidations
Definition: problem-solver.hh:565
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
const PathOptimizerPtr_t & pathOptimizer(std::size_t rank) const
Get path optimizer at given rank.
Definition: problem-solver.hh:167
boost::shared_ptr< Data > DataPtr_t
Definition: problem-solver.hh:37
boost::function< PathProjectorPtr_t(const Problem &, const value_type &) > PathProjectorBuilder_t
Definition: problem-solver.hh:53
std::size_t addPath(const PathVectorPtr_t &path)
Add a path.
Definition: problem-solver.hh:408
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: problem-solver.hh:68
Definition: problem.hh:48
const ConfigurationPtr_t & initConfig() const
Get shared pointer to initial configuration.
Definition: problem-solver.hh:108
constraints::ComparisonTypes_t ComparisonTypes_t
Definition: fwd.hh:76
const PathOptimizerTypes_t & pathOptimizerTypes() const
Definition: problem-solver.hh:161
boost::shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition: fwd.hh:110
const PathPlannerPtr_t & pathPlanner() const
Get path planner.
Definition: problem-solver.hh:152
std::map< std::string, segments_t > segmentsMap_t
Definition: fwd.hh:212
boost::function< DevicePtr_t(const std::string &) > RobotBuilder_t
Definition: problem-solver.hh:40
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
pinocchio::size_type size_type
Definition: fwd.hh:156
const ConfigValidationTypes_t configValidationTypes()
Get config validation current types.
Definition: problem-solver.hh:210
PathPlannerPtr_t pathPlanner_
Definition: problem-solver.hh:617
pinocchio::CollisionObjectPtr_t CollisionObjectPtr_t
Definition: fwd.hh:89
const std::string & distanceType() const
Definition: problem-solver.hh:138
boost::function< ConfigurationShooterPtr_t(const Problem &) > ConfigurationShooterBuilder_t
Definition: problem-solver.hh:55
boost::shared_ptr< GeomData > GeomDataPtr_t
Container< PathPlannerBuilder_t > pathPlanners
Definition: problem-solver.hh:571
Container< PathProjectorBuilder_t > pathProjectors
Definition: problem-solver.hh:568
size_type maxIterPathPlanning() const
Get maximal number of iterations in config projector.
Definition: problem-solver.hh:316
void addNumericalConstraint(const std::string &name, const constraints::ImplicitPtr_t &constraint)
Definition: problem-solver.hh:269
Container< RobotBuilder_t > robots
Definition: problem-solver.hh:550
std::vector< PathVectorPtr_t > PathVectors_t
Definition: fwd.hh:196
boost::function< SteeringMethodPtr_t(const Problem &) > SteeringMethodBuilder_t
Definition: problem-solver.hh:59
boost::function< PathValidationPtr_t(const DevicePtr_t &, const value_type &) > PathValidationBuilder_t
Definition: problem-solver.hh:48
std::vector< std::pair< std::string, CollisionObjectPtr_t > > AffordanceObjects_t
Definition: problem-solver.hh:60
Container< DistanceBuilder_t > distances
Definition: problem-solver.hh:559
std::string pathProjectorType_
Path projector method.
Definition: problem-solver.hh:623
boost::shared_ptr< Model > ModelPtr_t
pinocchio::GeomDataPtr_t obstacleGeomData() const
Definition: problem-solver.hh:506
const std::string & configurationShooterType() const
Definition: problem-solver.hh:148
Container< JointAndShapes_t > jointAndShapes
Container of JointAndShapes_t.
Definition: problem-solver.hh:587
const std::string & pathProjectorType(value_type &tolerance) const
Get path projector current type and get tolerance.
Definition: problem-solver.hh:198
boost::shared_ptr< PathValidation > PathValidationPtr_t
Definition: fwd.hh:290
void erasePath(std::size_t pathId)
Erase a path.
Definition: problem-solver.hh:416
pinocchio::matrix_t matrix_t
Definition: fwd.hh:145
boost::shared_ptr< Constraint > ConstraintPtr_t
Definition: fwd.hh:109
boost::shared_ptr< PathPlanner > PathPlannerPtr_t
Definition: fwd.hh:174
pinocchio::GeomModelPtr_t obstacleGeomModel() const
Definition: problem-solver.hh:504
RoadmapPtr_t roadmap_
Store roadmap.
Definition: problem-solver.hh:619
pinocchio::vector_t vector_t
Definition: fwd.hh:201
Member_lockedJoints_in_class_ProblemSolver_has_been_removed_use_member_numericalConstraints_instead lockedJoints
Definition: problem-solver.hh:581
Container< AffordanceConfig_t > affordanceConfigs
Container of AffordanceConfig_t.
Definition: problem-solver.hh:591
Container< ConfigurationShooterBuilder_t > configurationShooters
Definition: problem-solver.hh:553
pinocchio::value_type value_type
Definition: fwd.hh:157
Container< AffordanceObjects_t > affordanceObjects
Container of AffordanceObjects_t.
Definition: problem-solver.hh:589
DevicePtr_t robot_
Robot.
Definition: problem-solver.hh:613
boost::shared_ptr< PathOptimizer > PathOptimizerPtr_t
Definition: fwd.hh:173
boost::function< PathOptimizerPtr_t(const Problem &) > PathOptimizerBuilder_t
Definition: problem-solver.hh:42
Container< CenterOfMassComputationPtr_t > centerOfMassComputations
Container of CenterOfMassComputation.
Definition: problem-solver.hh:583
pinocchio::Transform3f Transform3f
Definition: fwd.hh:198
boost::shared_ptr< PathProjector > PathProjectorPtr_t
Definition: fwd.hh:306
const std::string & pathPlannerType() const
Definition: problem-solver.hh:133
ProblemPtr_t problem()
Get pointer to problem.
Definition: problem-solver.hh:103
Container< PathValidationBuilder_t > pathValidations
Definition: problem-solver.hh:562
double getTimeOutPathPlanning()
set time out for the path planning ( in seconds)
Definition: problem-solver.hh:327
std::vector< std::string > PathOptimizerTypes_t
Definition: problem-solver.hh:73
std::vector< ConfigurationPtr_t > Configurations_t
Definition: fwd.hh:100
pinocchio::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:99
PathVectors_t paths_
Paths.
Definition: problem-solver.hh:621
std::map< std::string, CenterOfMassComputationPtr_t > CenterOfMassComputationMap_t
Definition: fwd.hh:215
boost::shared_ptr< PathVector > PathVectorPtr_t
Definition: fwd.hh:176
boost::shared_ptr< DistanceBetweenObjects > DistanceBetweenObjectsPtr_t
Definition: fwd.hh:124
boost::shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:181
constraints::Implicit NumericalConstraint HPP_CORE_DEPRECATED
Definition: fwd.hh:347
Container< SteeringMethodBuilder_t > steeringMethods
Definition: problem-solver.hh:556
boost::function< DistancePtr_t(const Problem &) > DistanceBuilder_t
Definition: problem-solver.hh:57
value_type pathProjectorTolerance_
Tolerance of path projector.
Definition: problem-solver.hh:625
const std::string & pathValidationType(value_type &tolerance) const
Definition: problem-solver.hh:186
boost::function< PathPlannerPtr_t(const Problem &, const RoadmapPtr_t &) > PathPlannerBuilder_t
Definition: problem-solver.hh:45
pinocchio::vector3_t vector3_t
Definition: fwd.hh:148
const RoadmapPtr_t & roadmap() const
Definition: problem-solver.hh:221
constraints::ImplicitPtr_t numericalConstraint(const std::string &name)
Get constraint with given name.
Definition: problem-solver.hh:287
std::vector< std::string > ConfigValidationTypes_t
Definition: problem-solver.hh:74
std::string pathPlannerType_
Path planner.
Definition: problem-solver.hh:628
boost::shared_ptr< ProblemTarget > ProblemTargetPtr_t
Definition: fwd.hh:175
Container< PathOptimizerBuilder_t > pathOptimizers
Definition: problem-solver.hh:574
value_type errorThreshold() const
Get errorimal number of threshold in config projector.
Definition: problem-solver.hh:335
ProblemPtr_t problem_
Problem.
Definition: problem-solver.hh:615
void roadmap(const RoadmapPtr_t &roadmap)
Set the roadmap.
Definition: problem-solver.hh:516
ConstraintSetPtr_t constraints_
Store constraints until call to solve.
Definition: problem-solver.hh:600
boost::shared_ptr< Implicit > ImplicitPtr_t
boost::shared_ptr< GeomModel > GeomModelPtr_t
const PathVectors_t & paths() const
Return vector of paths.
Definition: problem-solver.hh:425
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96
size_type maxIterProjection() const
Get maximal number of iterations in config projector.
Definition: problem-solver.hh:308
std::vector< PathOptimizerPtr_t > PathOptimizers_t
Definition: problem-solver.hh:72
ProblemTargetPtr_t target_
Shared pointer to the problem target.
Definition: problem-solver.hh:631
vector3_t AffordanceConfig_t
Definition: problem-solver.hh:61
boost::shared_ptr< Problem > ProblemPtr_t
Definition: fwd.hh:179
Container< segments_t > passiveDofs
Container of passive DoFs (as segments_t)
Definition: problem-solver.hh:585
const DistanceBetweenObjectsPtr_t & distanceBetweenObjects() const
Return list of pair of distance computations.
Definition: problem-solver.hh:499
Container< constraints::ImplicitPtr_t > numericalConstraints
Container of constraints::Implicit.
Definition: problem-solver.hh:577
std::vector< CollisionObjectPtr_t > ObjectStdVector_t
Definition: fwd.hh:167
FCL_REAL distance(const KDOP< N > &other, Vec3f *P=NULL, Vec3f *Q=NULL) const
const ConstraintSetPtr_t & constraints() const
Get constraint set.
Definition: problem-solver.hh:233
void setTimeOutPathPlanning(double timeOut)
set time out for the path planning ( in seconds)
Definition: problem-solver.hh:322