hpp-manipulation  4.9.0
Classes for manipulation planning.
hpp::manipulation::graph::Graph Class Reference

#include <hpp/manipulation/graph/graph.hh>

Inheritance diagram for hpp::manipulation::graph::Graph:
Collaboration diagram for hpp::manipulation::graph::Graph:

Public Member Functions

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 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_tconstraintsAndComplements () const
 
ConstraintSetPtr_t configConstraint (const StatePtr_t &state) const
 
ConstraintSetPtr_t configConstraint (const EdgePtr_t &edge) const HPP_MANIPULATION_DEPRECATED
 
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_trobot () const
 Get the robot. More...
 
const ProblemPtr_tproblem () 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_thistograms () 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 ()
 
- Public Member Functions inherited from hpp::manipulation::graph::GraphComponent
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, const segments_t &passiveDofs=segments_t())
 
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...
 
virtual void addLockedJointConstraint (const LockedJointPtr_t &constraint) HPP_MANIPULATION_DEPRECATED
 
virtual void resetLockedJoints () HPP_MANIPULATION_DEPRECATED
 Reset the locked joint in the component. More...
 
bool insertNumericalConstraints (ConfigProjectorPtr_t &proj) const
 
bool insertLockedJoints (ConfigProjectorPtr_t &cs) const HPP_MANIPULATION_DEPRECATED
 
const NumericalConstraints_tnumericalConstraints () const
 Get a reference to the NumericalConstraints_t. More...
 
const NumericalConstraints_tnumericalCosts () const
 Get a reference to the NumericalConstraints_t. More...
 
const IntervalsContainer_tpassiveDofs () const
 Get a reference to the NumericalConstraints_t. More...
 
const LockedJoints_tlockedJoints () const HPP_MANIPULATION_DEPRECATED
 
void parentGraph (const GraphWkPtr_t &parent)
 Set the parent graph. More...
 
GraphPtr_t parentGraph () const
 Set the parent graph. More...
 
void setDirty ()
 Declare a component as dirty. More...
 

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...
 
- Protected Member Functions inherited from hpp::manipulation::graph::GraphComponent
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

- Protected Attributes inherited from hpp::manipulation::graph::GraphComponent
NumericalConstraints_t numericalConstraints_
 Stores the numerical constraints. More...
 
IntervalsContainer_t passiveDofs_
 Stores the passive dofs for each numerical constraints. More...
 
NumericalConstraints_t numericalCosts_
 Stores the numerical costs. More...
 
const LockedJoints_t lockedJoints_
 List of LockedJoint constraints: More...
 
GraphWkPtr_t graph_
 A weak pointer to the parent graph. More...
 
bool isInit_
 

Detailed Description

Description of the constraint graph.

This class contains a graph representing a robot with several end-effectors.

One must make sure not to create loop with shared pointers. To ensure that, the classes are defined as follow:

Constructor & Destructor Documentation

◆ Graph()

hpp::manipulation::graph::Graph::Graph ( const std::string &  name,
const ProblemPtr_t problem 
)
protected

Constructor

Parameters
sma steering method to create paths from edges

Member Function Documentation

◆ chooseEdge()

EdgePtr_t hpp::manipulation::graph::Graph::chooseEdge ( RoadmapNodePtr_t  node) const

Select randomly outgoing edge of the given node.

◆ configConstraint() [1/2]

ConstraintSetPtr_t hpp::manipulation::graph::Graph::configConstraint ( const StatePtr_t state) const

Constraint to project onto the Node.

Parameters
statethe state on which to project.
Returns
The initialized projector.

◆ configConstraint() [2/2]

ConstraintSetPtr_t hpp::manipulation::graph::Graph::configConstraint ( const EdgePtr_t edge) const

Constraints of path and target state of an edge

Deprecated:
Use tagetConstraint instead.

◆ constraintsAndComplements()

const ConstraintsAndComplements_t& hpp::manipulation::graph::Graph::constraintsAndComplements ( ) const

Return the vector of tuples as registered in registerConstraints

Returns
a vector of tuples (c, c/complement, c/both) each of them corresponding to a constraint, the complement constraint and the combination of boths.

◆ create()

static GraphPtr_t hpp::manipulation::graph::Graph::create ( const std::string &  name,
DevicePtr_t  robot,
const ProblemPtr_t problem 
)
static

Create a new Graph.

Parameters
robota manipulation robot
problema pointer to the problem

◆ createStateSelector()

StateSelectorPtr_t hpp::manipulation::graph::Graph::createStateSelector ( const std::string &  name)

Create and insert a state selector inside the graph.

◆ dotPrint()

virtual std::ostream& hpp::manipulation::graph::Graph::dotPrint ( std::ostream &  os,
dot::DrawingAttributes  da = dot::DrawingAttributes() 
) const
virtual

Print the component in DOT language.

Reimplemented from hpp::manipulation::graph::GraphComponent.

◆ errorThreshold() [1/2]

void hpp::manipulation::graph::Graph::errorThreshold ( const value_type threshold)

Set error threshold.

◆ errorThreshold() [2/2]

value_type hpp::manipulation::graph::Graph::errorThreshold ( ) const

Get error threshold in config projector.

◆ get()

GraphComponentWkPtr_t hpp::manipulation::graph::Graph::get ( std::size_t  id) const

Get the component by its ID.

◆ getConfigErrorForEdge()

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

Parameters
configConfiguration,
edgeedge containing the constraint to check config against
Return values
errorthe error of the edge constraint for the configuration
Returns
whether the configuration can be a start point of a path Call core::ConfigProjector::rightHandSideFromConfig with input configuration and method core::ConstraintSet::isSatisfied for the edge constraint.

◆ getConfigErrorForEdgeLeaf()

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

Parameters
leafConfigConfiguration that determines the foliation leaf
configConfiguration the error of which is computed
Return values
errorthe error
Returns
whether config can be the end point of a path of the edge starting at leafConfig Call methods core::ConfigProjector::rightHandSideFromConfig with leafConfig and then core::ConstraintSet::isSatisfied with config. on the edge constraints.

◆ getConfigErrorForEdgeTarget()

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

Parameters
leafConfigConfiguration that determines the foliation leaf
configConfiguration the error of which is computed
Return values
errorthe error
Returns
whether config can be the end point of a path of the edge starting at leafConfig Call methods core::ConfigProjector::rightHandSideFromConfig with leafConfig and then core::ConstraintSet::isSatisfied with config. on the edge constraints.

◆ getConfigErrorForState()

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

Parameters
configConfiguration,
statestate containing the constraint to check config against
Return values
errorthe error of the state constraint for the configuration
Returns
whether the configuration belongs to the state. Call method core::ConstraintSet::isSatisfied for the state constraints.

◆ getEdges()

Edges_t hpp::manipulation::graph::Graph::getEdges ( const StatePtr_t from,
const StatePtr_t to 
) const

Get possible edges between two nodes.

◆ getState() [1/2]

StatePtr_t hpp::manipulation::graph::Graph::getState ( ConfigurationIn_t  config) const

Returns the state of a configuration.

◆ getState() [2/2]

StatePtr_t hpp::manipulation::graph::Graph::getState ( RoadmapNodePtr_t  node) const

Returns the state of a roadmap node.

◆ histograms()

const Histograms_t& hpp::manipulation::graph::Graph::histograms ( ) const
inline

Get the histograms.

◆ init()

void hpp::manipulation::graph::Graph::init ( const GraphWkPtr_t &  weak,
DevicePtr_t  robot 
)
protected

Initialization of the object.

◆ initialize()

virtual void hpp::manipulation::graph::Graph::initialize ( )
virtual

◆ insertHistogram()

void hpp::manipulation::graph::Graph::insertHistogram ( const graph::HistogramPtr_t hist)
inline

Register an histogram representing a foliation.

◆ isComplement()

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

Parameters
constraint,complementtwo constraints to test
Return values
combinationOfBothconstraint corresponding to combining constraint and complement if result is true, unchanged otherwise.
Returns
whether complement is the complement of constraint. Two constraints are complement of one another if and only if combined they constitute a complement relative transformation constraint.
See also
Graph::registerConstraints
Warning
argument order matters.

◆ maxIterations() [1/2]

void hpp::manipulation::graph::Graph::maxIterations ( size_type  iterations)

Set maximal number of iterations.

◆ maxIterations() [2/2]

size_type hpp::manipulation::graph::Graph::maxIterations ( ) const

Get maximal number of iterations in config projector.

◆ nbComponents()

std::size_t hpp::manipulation::graph::Graph::nbComponents ( ) const
inline

◆ pathConstraint()

ConstraintSetPtr_t hpp::manipulation::graph::Graph::pathConstraint ( const EdgePtr_t edge) const

Constraint to project a path.

Parameters
edgea list of edges defining the foliation.
Returns
The constraint.

◆ print()

std::ostream& hpp::manipulation::graph::Graph::print ( std::ostream &  os) const
protectedvirtual

Print the object in a stream.

Reimplemented from hpp::manipulation::graph::GraphComponent.

◆ problem() [1/2]

const ProblemPtr_t& hpp::manipulation::graph::Graph::problem ( ) const

Get the problem.

◆ problem() [2/2]

void hpp::manipulation::graph::Graph::problem ( const ProblemPtr_t problem)

Set the problem.

◆ registerConstraints()

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

Parameters
constrainta constraint (grasp of placement)
complementthe complement constraint
bothcombination 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.

◆ robot()

const DevicePtr_t& hpp::manipulation::graph::Graph::robot ( ) const

Get the robot.

◆ stateSelector() [1/2]

void hpp::manipulation::graph::Graph::stateSelector ( StateSelectorPtr_t  ns)

Set the state selector

Warning
This should be done before adding nodes to the node selector otherwise the pointer to the parent graph will NOT be valid.

◆ stateSelector() [2/2]

StateSelectorPtr_t hpp::manipulation::graph::Graph::stateSelector ( ) const
inline

Get the state selector.

◆ targetConstraint()

ConstraintSetPtr_t hpp::manipulation::graph::Graph::targetConstraint ( const EdgePtr_t edge) const

Constraints a configuration in target state should satisfy

Parameters
edgea transition
Returns
The set of constraints a configuration lying in the target state of the edge should satisfy. This set includes the paths constraints of the edge.
See also
Edge::targetConstraint.

Friends And Related Function Documentation

◆ GraphComponent

friend class GraphComponent
friend

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