hpp-core: hpp::core::Problem Class Reference

hpp-core 9.0.2 Implement basic classes for canonical path planning for kinematic chains.

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
hpp::core::Problem Class Reference
Path planning algorithms

`#include <hpp/core/problem.hh>`

Collaboration diagram for hpp::core::Problem:
[legend]

## Public Member Functions
| Problem ()
virtual | ~Problem ()
virtual void | checkProblem () const
| Check that problem is well formulated.
const Parameter & | getParameter (const std::string &name) const
void | setParameter (const std::string &name, const Parameter &value)
Problem definition
const DevicePtr_t & | robot () const
| return shared pointer to robot.
const Configuration_t & | initConfig () const
| Get shared pointer to initial configuration.
void | initConfig (ConfigurationIn_t inConfig)
| Set initial configuration.
void | target (const ProblemTargetPtr_t &target)
| Set the target.
const ProblemTargetPtr_t & | target () const
| Get the target.
const Configurations_t | goalConfigs () const
void | addGoalConfig (ConfigurationIn_t config)
void | resetGoalConfigs ()
Steering method and distance function
void | steeringMethod (const SteeringMethodPtr_t &sm)
SteeringMethodPtr_t | steeringMethod () const
| Get steering method.
void | distance (const DistancePtr_t &distance)
| Set distance between configurations.
const DistancePtr_t & | distance () const
| Get distance between configuration.
Configuration validation
void | configValidation (const ConfigValidationsPtr_t &configValidations)
const ConfigValidationsPtr_t & | configValidations () const
| Get configuration validation methods.
void | clearConfigValidations ()
void | addConfigValidation (const ConfigValidationPtr_t &configValidation)
| Add a config validation method.
Path validation
Set path validation method
virtual void | pathValidation (const PathValidationPtr_t &pathValidation)
PathValidationPtr_t | pathValidation () const
| Get path validation method.
Configuration shooter
Set configuration shooter method
void | configurationShooter (const ConfigurationShooterPtr_t &configurationShooter)
ConfigurationShooterPtr_t | configurationShooter () const
| Get path validation method.
Path projector
Set path projector method
void | pathProjector (const PathProjectorPtr_t &pathProjector)
PathProjectorPtr_t | pathProjector () const
| Get path projector method.
Constraints applicable to the robot
void | constraints (const ConstraintSetPtr_t &constraints)
const ConstraintSetPtr_t & | constraints () const
| Get constraint set.
Obstacles
void | addObstacle (const CollisionObjectPtr_t &object)
void | removeObstacleFromJoint (const JointPtr_t &joint, const CollisionObjectConstPtr_t &obstacle)
void | filterCollisionPairs ()
void | setSecurityMargins (const matrix_t &securityMatrix)
const ObjectStdVector_t & | collisionObstacles () const
| Vector of objects considered for collision detection.
void | collisionObstacles (const ObjectStdVector_t &collisionObstacles)
| Set the vector of objects considered for collision detection.

## Static Public Member Functions
static ProblemPtr_t | create (DevicePtr_t robot)
static ProblemPtr_t | createCopy (const ProblemConstPtr_t &other)
static void | declareParameter (const ParameterDescription &desc)
static const Container< ParameterDescription > & | parameterDescriptions ()
| Get all the parameter descriptions.
static const ParameterDescription & | parameterDescription (const std::string &name)
| Access one parameter description.

## Public Attributes
Container< Parameter > | parameters

## Protected Member Functions
| Problem (DevicePtr_t robot)
| Problem (const Problem &other)=default
void | init (ProblemWkPtr_t wkPtr)

## Detailed Description

Defines a path planning problem for one robot. A path planning problem is defined by

- a robot: instance of class hpp::pinocchio::Device,
- a set of obstacles: a list of hpp::pinocchio::CollisionObject,
- initial and goal configurations,
- a SteeringMethod to handle the robot dynamics, Additional objects are stored in this object:
- a method to validate paths,
- a set of methods to validate configurations. Default methods are collision checking and joint bound checking.

## Constructor & Destructor Documentation

## ◆ Problem() [1/3]

hpp::core::Problem::Problem | ( |  | ) |

Constructor without argument

Warning
  do not use this constructor. It is necessary to define std::pairs <Problem, OtherType>.

## ◆ ~Problem()

virtual hpp::core::Problem::~Problem | ( |  | ) |
| virtual

## ◆ Problem() [2/3]

hpp::core::Problem::Problem | ( | DevicePtr_t | robot | ) |
| protected

Create a path planning problem.

Parameters

  robot | robot associated to the path planning problem.

## ◆ Problem() [3/3]

hpp::core::Problem::Problem | ( | const Problem & | other | ) |
| protecteddefault

Create a path planning problem.

Parameters

  robot | robot associated to the path planning problem.

## Member Function Documentation

## ◆ addConfigValidation()

void hpp::core::Problem::addConfigValidation | ( | const ConfigValidationPtr_t & | configValidation | ) |

Add a config validation method.

## ◆ addGoalConfig()

void hpp::core::Problem::addGoalConfig | ( | ConfigurationIn_t | config | ) |

Add goal configuration. if problem target is not an instance of problemTarget::GoalConfigurations, set problem target as a new instance of this class and add the given configuration as a goal.

## ◆ addObstacle()

void hpp::core::Problem::addObstacle | ( | const CollisionObjectPtr_t & | object | ) |

Add obstacle to the list.

Parameters

  object | a new object.

## ◆ checkProblem()

virtual void hpp::core::Problem::checkProblem | ( |  | ) | const
| virtual

Check that problem is well formulated.

## ◆ clearConfigValidations()

void hpp::core::Problem::clearConfigValidations | ( |  | ) |

Clear the ConfigValidations by calling ConfigValidations::clear

## ◆ collisionObstacles() [1/2]

const ObjectStdVector_t & hpp::core::Problem::collisionObstacles | ( |  | ) | const

Vector of objects considered for collision detection.

## ◆ collisionObstacles() [2/2]

void hpp::core::Problem::collisionObstacles | ( | const ObjectStdVector_t & | collisionObstacles | ) |

Set the vector of objects considered for collision detection.

## ◆ configurationShooter() [1/2]

ConfigurationShooterPtr_t hpp::core::Problem::configurationShooter | ( |  | ) | const
| inline

Get path validation method.

## ◆ configurationShooter() [2/2]

void hpp::core::Problem::configurationShooter | ( | const ConfigurationShooterPtr_t & | configurationShooter | ) |

## ◆ configValidation()

void hpp::core::Problem::configValidation | ( | const ConfigValidationsPtr_t & | configValidations | ) |
| inline

Set configuration validation methods Before starting tos solve a path planning problem, the initial and goal configurations are checked for validity.

## ◆ configValidations()

const ConfigValidationsPtr_t & hpp::core::Problem::configValidations | ( |  | ) | const
| inline

Get configuration validation methods.

## ◆ constraints() [1/2]

const ConstraintSetPtr_t & hpp::core::Problem::constraints | ( |  | ) | const
| inline

Get constraint set.

## ◆ constraints() [2/2]

void hpp::core::Problem::constraints | ( | const ConstraintSetPtr_t & | constraints | ) |
| inline

Set constraint set

Parameters

  constraints | a set of constraints If problem contains a steering method, constraints are passed to the steering method.

## ◆ create()

static ProblemPtr_t hpp::core::Problem::create | ( | DevicePtr_t | robot | ) |
| static

Create a path planning problem.

Parameters

  robot | robot associated to the path planning problem.

## ◆ createCopy()

static ProblemPtr_t hpp::core::Problem::createCopy | ( | const ProblemConstPtr_t & | other | ) |
| static

Copy a path planning problem and return a shared pointer.

Parameters

  other | problem to copy

## ◆ declareParameter()

static void hpp::core::Problem::declareParameter | ( | const ParameterDescription & | desc | ) |
| static

Declare a parameter In shared library, use the following snippet in your cc file:

HPP_START_PARAMETER_DECLARATION(name)
Problem::declareParameter (ParameterDescription (
Parameter::FLOAT,
"name",
"doc",
Parameter(value)));
HPP_END_PARAMETER_DECLARATION(name)
hpp::core::ParameterDescription
Definition parameter.hh:128
hpp::core::Parameter
Definition parameter.hh:63
hpp::core::Parameter::FLOAT
@ FLOAT
as value_type
Definition parameter.hh:71
hpp::core::Problem::declareParameter
static void declareParameter(const ParameterDescription &desc)
HPP_END_PARAMETER_DECLARATION
#define HPP_END_PARAMETER_DECLARATION(name)
Definition problem.hh:319
HPP_START_PARAMETER_DECLARATION
#define HPP_START_PARAMETER_DECLARATION(name)
Definition problem.hh:316

## ◆ distance() [1/2]

const DistancePtr_t & hpp::core::Problem::distance | ( |  | ) | const
| inline

Get distance between configuration.

## ◆ distance() [2/2]

void hpp::core::Problem::distance | ( | const DistancePtr_t & | distance | ) |
| inline

Set distance between configurations.

## ◆ filterCollisionPairs()

void hpp::core::Problem::filterCollisionPairs | ( |  | ) |

Build matrix of relative motions between joints

Loop over constraints in the current constraint set (see Problem::constraints) and for each LockedJoint and each constraints::RelativeTransformation, fill a matrix the column and rows represent joints and the values are the following

- RelativeMotionType::Constrained when the two joints are rigidly fixed by the constraint,
- RelativeMotionType::Parameterized when the two joints are rigidly fixed by the constraint, the relative position is a parameter constant along path, but that can change for different paths,
- RelativeMotionType::Unconstrained when the two joints are not rigidly fixed by the constraint.

Note
  the matrix is passed to the current configuration validation instance (Problem::configValidation) and to the current path validation instance (Problem::pathValidation).

## ◆ getParameter()

const Parameter & hpp::core::Problem::getParameter | ( | const std::string & | name | ) | const
| inline

Get a parameter named name.

Parameters

  name | of the parameter.

## ◆ goalConfigs()

const Configurations_t hpp::core::Problem::goalConfigs | ( |  | ) | const

Get goal configurations. if problem target is an instance of problemTarget::GoalConfigurations, return the vector of goal configurations. Otherwise return an empty vector.

## ◆ init()

void hpp::core::Problem::init | ( | ProblemWkPtr_t | wkPtr | ) |
| protected

## ◆ initConfig() [1/2]

const Configuration_t & hpp::core::Problem::initConfig | ( |  | ) | const
| inline

Get shared pointer to initial configuration.

## ◆ initConfig() [2/2]

void hpp::core::Problem::initConfig | ( | ConfigurationIn_t | inConfig | ) |

Set initial configuration.

## ◆ parameterDescription()

static const ParameterDescription & hpp::core::Problem::parameterDescription | ( | const std::string & | name | ) |
| static

Access one parameter description.

## ◆ parameterDescriptions()

static const Container< ParameterDescription > & hpp::core::Problem::parameterDescriptions | ( |  | ) |
| static

Get all the parameter descriptions.

## ◆ pathProjector() [1/2]

PathProjectorPtr_t hpp::core::Problem::pathProjector | ( |  | ) | const
| inline

Get path projector method.

## ◆ pathProjector() [2/2]

void hpp::core::Problem::pathProjector | ( | const PathProjectorPtr_t & | pathProjector | ) |
| inline

## ◆ pathValidation() [1/2]

PathValidationPtr_t hpp::core::Problem::pathValidation | ( |  | ) | const
| inline

Get path validation method.

## ◆ pathValidation() [2/2]

virtual void hpp::core::Problem::pathValidation | ( | const PathValidationPtr_t & | pathValidation | ) |
| virtual

## ◆ removeObstacleFromJoint()

void hpp::core::Problem::removeObstacleFromJoint | ( | const JointPtr_t & | joint,
|  | const CollisionObjectConstPtr_t & | obstacle
| ) |  |

Remove a collision pair between a joint and an obstacle

Parameters

  joint | that holds the inner objects,
  obstacle | to remove.

## ◆ resetGoalConfigs()

void hpp::core::Problem::resetGoalConfigs | ( |  | ) |

Reset the set of goal configurations if problem target is not an instance of problemTarget::GoalConfigurations, set problem target as a new empty instance of this class.

## ◆ robot()

const DevicePtr_t & hpp::core::Problem::robot | ( |  | ) | const
| inline

return shared pointer to robot.

## ◆ setParameter()

void hpp::core::Problem::setParameter | ( | const std::string & | name,
|  | const Parameter & | value
| ) |  |

Set a parameter named name.

Parameters

  name | of the parameter.
  value | value of the parameter

Exceptions

  std::invalid_argument | if a parameter exists but has a different type.

## ◆ setSecurityMargins()

void hpp::core::Problem::setSecurityMargins | ( | const matrix_t & | securityMatrix | ) |

Set different security margins for collision pairs

This function works joint-wise. If you need a finer control, use setSecurityMarginBetweenBodies

This method enables users to choose different security margins for each pair of robot joint or each pair robot joint - obstacle.

See also
  coal::CollisionRequest::security_margin.

## ◆ steeringMethod() [1/2]

SteeringMethodPtr_t hpp::core::Problem::steeringMethod | ( |  | ) | const
| inline

Get steering method.

## ◆ steeringMethod() [2/2]

void hpp::core::Problem::steeringMethod | ( | const SteeringMethodPtr_t & | sm | ) |
| inline

Set steering method

Parameters

  sm | steering method. If problem contains constraints they are passed to the steering method.

## ◆ target() [1/2]

const ProblemTargetPtr_t & hpp::core::Problem::target | ( |  | ) | const
| inline

Get the target.

## ◆ target() [2/2]

void hpp::core::Problem::target | ( | const ProblemTargetPtr_t & | target | ) |
| inline

Set the target.

## Member Data Documentation

## ◆ parameters

Container<Parameter> hpp::core::Problem::parameters

The documentation for this class was generated from the following file:

- include/hpp/core/problem.hh