hpp-manipulation
6.0.0
Classes for manipulation planning.
|
#include <hpp/manipulation/graph/graph.hh>
Public Member Functions | |
GraphPtr_t | self () const |
StateSelectorPtr_t | createStateSelector (const std::string &name) |
Create and insert a state selector inside the graph. More... | |
void | stateSelector (StateSelectorPtr_t ns) |
StateSelectorPtr_t | stateSelector () const |
Get the state selector. More... | |
StatePtr_t | getState (ConfigurationIn_t config) const |
Returns the state of a configuration. More... | |
StatePtr_t | getState (RoadmapNodePtr_t node) const |
Returns the state of a roadmap node. More... | |
Edges_t | getEdges (const StatePtr_t &from, const StatePtr_t &to) const |
Get possible edges between two nodes. More... | |
EdgePtr_t | chooseEdge (RoadmapNodePtr_t node) const |
Select randomly outgoing edge of the given node. More... | |
void | clearConstraintsAndComplement () |
void | registerConstraints (const ImplicitPtr_t &constraint, const ImplicitPtr_t &complement, const ImplicitPtr_t &both) |
bool | isComplement (const ImplicitPtr_t &constraint, const ImplicitPtr_t &complement, ImplicitPtr_t &combinationOfBoth) const |
const ConstraintsAndComplements_t & | constraintsAndComplements () const |
ConstraintSetPtr_t | configConstraint (const StatePtr_t &state) const |
ConstraintSetPtr_t | targetConstraint (const EdgePtr_t &edge) const |
bool | getConfigErrorForState (ConfigurationIn_t config, const StatePtr_t &state, vector_t &error) const |
bool | getConfigErrorForEdge (ConfigurationIn_t config, const EdgePtr_t &edge, vector_t &error) const |
bool | getConfigErrorForEdgeLeaf (ConfigurationIn_t leafConfig, ConfigurationIn_t config, const EdgePtr_t &edge, vector_t &error) const |
bool | getConfigErrorForEdgeTarget (ConfigurationIn_t leafConfig, ConfigurationIn_t config, const EdgePtr_t &edge, vector_t &error) const |
ConstraintSetPtr_t | pathConstraint (const EdgePtr_t &edge) const |
void | maxIterations (size_type iterations) |
Set maximal number of iterations. More... | |
size_type | maxIterations () const |
Get maximal number of iterations in config projector. More... | |
void | errorThreshold (const value_type &threshold) |
Set error threshold. More... | |
value_type | errorThreshold () const |
Get error threshold in config projector. More... | |
const DevicePtr_t & | robot () const |
Get the robot. More... | |
const ProblemPtr_t & | problem () const |
Get the problem. More... | |
void | problem (const ProblemPtr_t &problem) |
Set the problem. More... | |
void | insertHistogram (const graph::HistogramPtr_t &hist) |
Register an histogram representing a foliation. More... | |
const Histograms_t & | histograms () const |
Get the histograms. More... | |
GraphComponentWkPtr_t | get (std::size_t id) const |
Get the component by its ID. More... | |
std::size_t | nbComponents () const |
virtual std::ostream & | dotPrint (std::ostream &os, dot::DrawingAttributes da=dot::DrawingAttributes()) const |
Print the component in DOT language. More... | |
virtual void | initialize () |
Initialize all components of the graph (edges and states) More... | |
virtual void | invalidate () |
Invalidate all states and edges of the graph. More... | |
![]() | |
virtual | ~GraphComponent () |
const std::string & | name () const |
Get the component name. More... | |
const std::size_t & | id () const |
Return the component id. More... | |
virtual void | addNumericalConstraint (const ImplicitPtr_t &numConstraint) |
Add constraint to the component. More... | |
virtual void | addNumericalCost (const ImplicitPtr_t &numCost) |
Add a cost function Implicit to the component. More... | |
virtual void | resetNumericalConstraints () |
Reset the numerical constraints stored in the component. More... | |
bool | insertNumericalConstraints (ConfigProjectorPtr_t &proj) const |
const NumericalConstraints_t & | numericalConstraints () const |
Get a reference to the NumericalConstraints_t. More... | |
const NumericalConstraints_t & | numericalCosts () const |
Get a reference to the NumericalConstraints_t. More... | |
void | parentGraph (const GraphWkPtr_t &parent) |
Set the parent graph. More... | |
GraphPtr_t | parentGraph () const |
Set the parent graph. More... | |
void | solveLevelByLevel (bool solveLevelByLevel) |
bool | solveLevelByLevel () const |
Static Public Member Functions | |
static GraphPtr_t | create (const std::string &name, DevicePtr_t robot, const ProblemPtr_t &problem) |
Protected Member Functions | |
void | init (const GraphWkPtr_t &weak, DevicePtr_t robot) |
Initialization of the object. More... | |
Graph (const std::string &name, const ProblemPtr_t &problem) | |
std::ostream & | print (std::ostream &os) const |
Print the object in a stream. More... | |
![]() | |
void | init (const GraphComponentWkPtr_t &weak) |
Initialize the component. More... | |
GraphComponent (const std::string &name) | |
void | throwIfNotInitialized () const |
virtual void | populateTooltip (dot::Tooltip &tp) const |
Populate DrawingAttributes tooltip. More... | |
Friends | |
class | GraphComponent |
Additional Inherited Members | |
![]() | |
NumericalConstraints_t | numericalConstraints_ |
Stores the numerical constraints. More... | |
NumericalConstraints_t | numericalCosts_ |
Stores the numerical costs. More... | |
GraphWkPtr_t | graph_ |
A weak pointer to the parent graph. More... | |
bool | isInit_ |
Description of the constraint graph.
This class contains a graph representing a a manipulation problem
One must make sure not to create loop with shared pointers. To ensure that, the classes are defined as follow:
|
protected |
Constructor
problem | a pointer to the problem |
EdgePtr_t hpp::manipulation::graph::Graph::chooseEdge | ( | RoadmapNodePtr_t | node | ) | const |
Select randomly outgoing edge of the given node.
void hpp::manipulation::graph::Graph::clearConstraintsAndComplement | ( | ) |
Clear the vector of constraints and complements
ConstraintSetPtr_t hpp::manipulation::graph::Graph::configConstraint | ( | const StatePtr_t & | state | ) | const |
Constraint to project onto the Node.
state | the state on which to project. |
const ConstraintsAndComplements_t& hpp::manipulation::graph::Graph::constraintsAndComplements | ( | ) | const |
Return the vector of tuples as registered in registerConstraints
|
static |
Create a new Graph.
robot | a manipulation robot |
problem | a pointer to the problem |
StateSelectorPtr_t hpp::manipulation::graph::Graph::createStateSelector | ( | const std::string & | name | ) |
Create and insert a state selector inside the graph.
|
virtual |
Print the component in DOT language.
Reimplemented from hpp::manipulation::graph::GraphComponent.
value_type hpp::manipulation::graph::Graph::errorThreshold | ( | ) | const |
Get error threshold in config projector.
void hpp::manipulation::graph::Graph::errorThreshold | ( | const value_type & | threshold | ) |
Set error threshold.
GraphComponentWkPtr_t hpp::manipulation::graph::Graph::get | ( | std::size_t | id | ) | const |
Get the component by its ID.
bool hpp::manipulation::graph::Graph::getConfigErrorForEdge | ( | ConfigurationIn_t | config, |
const EdgePtr_t & | edge, | ||
vector_t & | error | ||
) | const |
Get error of a config with respect to an edge constraint
config | Configuration, |
edge | edge containing the constraint to check config against |
error | the error of the edge constraint for the configuration |
bool hpp::manipulation::graph::Graph::getConfigErrorForEdgeLeaf | ( | ConfigurationIn_t | leafConfig, |
ConfigurationIn_t | config, | ||
const EdgePtr_t & | edge, | ||
vector_t & | error | ||
) | const |
Get error of a config with respect to an edge foliation leaf
leafConfig | Configuration that determines the foliation leaf |
config | Configuration the error of which is computed |
error | the error |
bool hpp::manipulation::graph::Graph::getConfigErrorForEdgeTarget | ( | ConfigurationIn_t | leafConfig, |
ConfigurationIn_t | config, | ||
const EdgePtr_t & | edge, | ||
vector_t & | error | ||
) | const |
Get error of a config with respect to the target of an edge foliation leaf
leafConfig | Configuration that determines the foliation leaf |
config | Configuration the error of which is computed |
error | the error |
bool hpp::manipulation::graph::Graph::getConfigErrorForState | ( | ConfigurationIn_t | config, |
const StatePtr_t & | state, | ||
vector_t & | error | ||
) | const |
Get error of a config with respect to a state constraint
config | Configuration, |
state | state containing the constraint to check config against |
error | the error of the state constraint for the configuration |
Edges_t hpp::manipulation::graph::Graph::getEdges | ( | const StatePtr_t & | from, |
const StatePtr_t & | to | ||
) | const |
Get possible edges between two nodes.
StatePtr_t hpp::manipulation::graph::Graph::getState | ( | ConfigurationIn_t | config | ) | const |
Returns the state of a configuration.
StatePtr_t hpp::manipulation::graph::Graph::getState | ( | RoadmapNodePtr_t | node | ) | const |
Returns the state of a roadmap node.
|
inline |
Get the histograms.
|
protected |
Initialization of the object.
|
virtual |
Initialize all components of the graph (edges and states)
Implements hpp::manipulation::graph::GraphComponent.
|
inline |
Register an histogram representing a foliation.
|
virtual |
Invalidate all states and edges of the graph.
Reimplemented from hpp::manipulation::graph::GraphComponent.
bool hpp::manipulation::graph::Graph::isComplement | ( | const ImplicitPtr_t & | constraint, |
const ImplicitPtr_t & | complement, | ||
ImplicitPtr_t & | combinationOfBoth | ||
) | const |
Test whether two constraints are complement of one another
constraint,complement | two constraints to test |
combinationOfBoth | constraint corresponding to combining constraint and complement if result is true, unchanged otherwise. |
size_type hpp::manipulation::graph::Graph::maxIterations | ( | ) | const |
Get maximal number of iterations in config projector.
void hpp::manipulation::graph::Graph::maxIterations | ( | size_type | iterations | ) |
Set maximal number of iterations.
|
inline |
ConstraintSetPtr_t hpp::manipulation::graph::Graph::pathConstraint | ( | const EdgePtr_t & | edge | ) | const |
Constraint to project a path.
edge | a list of edges defining the foliation. |
|
protectedvirtual |
Print the object in a stream.
Reimplemented from hpp::manipulation::graph::GraphComponent.
const ProblemPtr_t& hpp::manipulation::graph::Graph::problem | ( | ) | const |
Get the problem.
void hpp::manipulation::graph::Graph::problem | ( | const ProblemPtr_t & | problem | ) |
Set the problem.
void hpp::manipulation::graph::Graph::registerConstraints | ( | const ImplicitPtr_t & | constraint, |
const ImplicitPtr_t & | complement, | ||
const ImplicitPtr_t & | both | ||
) |
Register a triple of constraints to be inserted in nodes and edges
constraint | a constraint (grasp of placement) |
complement | the complement constraint |
both | combination of the constraint and its complement. Both constraints together corresponds to a full relative transformation constraint When inserting constraints in transitions of the graph, in many cases, a constraint is associated to a state and the complement constraint is associated to the transition itself. Registering those constraints priorly to graph construction makes possible to replace the constraint and its complement by the combination of both that is an explicit constraint. |
const DevicePtr_t& hpp::manipulation::graph::Graph::robot | ( | ) | const |
Get the robot.
|
inline |
|
inline |
Get the state selector.
void hpp::manipulation::graph::Graph::stateSelector | ( | StateSelectorPtr_t | ns | ) |
Set the state selector
ConstraintSetPtr_t hpp::manipulation::graph::Graph::targetConstraint | ( | const EdgePtr_t & | edge | ) | const |
Constraints a configuration in target state should satisfy
edge | a transition |
|
friend |