hpp-manipulation-corba 5.2.0
Corba server for manipulation planning
Loading...
Searching...
No Matches
manipulation.constraint_graph.ConstraintGraph Class Reference

Public Member Functions

 __init__ (self, robot, graphName, makeGraph=True)
 
 createNode (self, node, waypoint=False, priority=None)
 
 createEdge (self, nodeFrom, nodeTo, name, weight=1, isInNode=None)
 
 setContainingNode (self, edge, node)
 
 getContainingNode (self, edge)
 
 setShort (self, edge, isShort)
 
 isShort (self, edge)
 
 createWaypointEdge (self, nodeFrom, nodeTo, name, nb=1, weight=1, isInNode=None, automaticBuilder=True)
 
 createLevelSetEdge (self, nodeFrom, nodeTo, name, weight=1, isInNode=None)
 
 createGrasp (self, name, gripper, handle)
 
 createPreGrasp (self, name, gripper, handle)
 
 setProblemConstraints (self, name, target)
 
 addConstraints (self, graph=False, node=None, edge=None, constraints=None)
 
 removeCollisionPairFromEdge (self, edge, joint1, joint2)
 
 addLevelSetFoliation (self, edge, condGrasps=None, condPregrasps=None, condNC=[], condLJ=[], paramGrasps=None, paramPregrasps=None, paramNC=[], paramLJ=[])
 
 getWeight (self, edge)
 
 setWeight (self, edge, weight)
 
 addTextToTeXTranslation (self, text, tex)
 
 setTextToTeXTranslation (self, textToTex)
 
 display (self, dotOut="/tmp/constraintgraph.dot", pdfOut="/tmp/constraintgraph", format="pdf", open=True)
 
 getNodesConnectedByEdge (self, edge)
 
 applyNodeConstraints (self, node, input)
 
 applyEdgeLeafConstraints (self, edge, qfrom, input)
 
 generateTargetConfig (self, edge, qfrom, input)
 
 buildAndProjectPath (self, edge, qb, qe)
 
 getConfigErrorForNode (self, nodeId, config)
 
 getNode (self, config)
 
 getConfigErrorForEdge (self, edgeId, config)
 
 getConfigErrorForEdgeLeaf (self, edgeId, leafConfig, config)
 
 getConfigErrorForEdgeTarget (self, edgeId, leafConfig, config)
 
 displayNodeConstraints (self, node)
 
 displayEdgeConstraints (self, edge)
 
 displayEdgeTargetConstraints (self, edge)
 
 initialize (self)
 
 setSecurityMarginForEdge (self, edge, joint1, joint2, margin)
 
 getSecurityMarginMatrixForEdge (self, edge)
 

Static Public Member Functions

 buildGenericGraph (robot, name, grippers, objects, handlesPerObjects, shapesPerObjects, envNames, rules=[])
 

Public Attributes

 robot
 
 client
 
 clientBasic
 
 graph
 
 name
 
 grasps
 
 pregrasps
 
 nodes
 
 edges
 
 graphId
 
 textToTex
 

Static Public Attributes

dict cmdDot
 
dict cmdViewer = {"pdf": ["evince"], "svg": ["firefox"]}
 

Protected Member Functions

 _addConstraints (self, graph=False, node=None, edge=None, grasps=None, pregrasps=None, numConstraints=[])
 
 _ (self, text)
 

Detailed Description

Definition of a constraint graph.

This class wraps the Corba client to the server implemented by
libhpp-manipulation-corba.so

Some method implemented by the server can be considered as private. The
goal of this class is to hide them and to expose those that can be
considered as public.

Constructor & Destructor Documentation

◆ __init__()

manipulation.constraint_graph.ConstraintGraph.__init__ ( self,
robot,
graphName,
makeGraph = True )

Member Function Documentation

◆ _()

manipulation.constraint_graph.ConstraintGraph._ ( self,
text )
protected
get the textToTex translation

◆ _addConstraints()

manipulation.constraint_graph.ConstraintGraph._addConstraints ( self,
graph = False,
node = None,
edge = None,
grasps = None,
pregrasps = None,
numConstraints = [] )
protected

◆ addConstraints()

manipulation.constraint_graph.ConstraintGraph.addConstraints ( self,
graph = False,
node = None,
edge = None,
constraints = None )
Add the constraints to an edge, a node or the whole graph

  This method adds the constraints to an element of the graph and
  handles the special cases of grasp and pregrasp constraints.

  input
    graph: set to true if you are defining constraints for every nodes,
    node, edge: name of a component of the graph,
    constraints: set of constraints containing grasps, pregrasps,
                 numerical constraints and locked joints.
                 It must be of type hpp.corbaserver.manipulation.Constraints.
  note: Exaclty one of the parameter graph, node and edge must be set.

◆ addLevelSetFoliation()

manipulation.constraint_graph.ConstraintGraph.addLevelSetFoliation ( self,
edge,
condGrasps = None,
condPregrasps = None,
condNC = [],
condLJ = [],
paramGrasps = None,
paramPregrasps = None,
paramNC = [],
paramLJ = [] )
Add the numerical constraints to a LevelSetEdge that create the foliation.
\\param edge name of a LevelSetEdge of the graph.
\\param condGrasps, condPregrasps name, or list of names, of grasp or pregrasp
        that define the foliated manifold
\\param condNC, condLJ numerical constraints and locked joints that define the
        foliated manifold
\\param paramGrasps, paramPregrasps name, or list of names, of grasp or
        pregrasp that parametrize the foliation
\\param paramNC, paramLJ numerical constraints and locked joints
        that parametrize the foliation

◆ addTextToTeXTranslation()

manipulation.constraint_graph.ConstraintGraph.addTextToTeXTranslation ( self,
text,
tex )
Add entry to the local dictionnary
\\param text plain text
\\param tex its latex translation
\\sa ConstraintGraph.setTextToTeXTranslation

◆ applyEdgeLeafConstraints()

manipulation.constraint_graph.ConstraintGraph.applyEdgeLeafConstraints ( self,
edge,
qfrom,
input )
Apply edge constaints to a configuration

\\param edge name of the edge
\\param qfrom configuration defining the right hand side of the edge
       constraint,
\\param input input configuration,
\\retval output output configuration,
\\retval error norm of the residual error.

If success, the output configuration is reachable from qfrom along
the transition.

◆ applyNodeConstraints()

manipulation.constraint_graph.ConstraintGraph.applyNodeConstraints ( self,
node,
input )
Apply constaints to a configuration

\\param node name of the node the constraints of which to apply
\\param input input configuration,
\\retval output output configuration,
\\retval error norm of the residual error.

◆ buildAndProjectPath()

manipulation.constraint_graph.ConstraintGraph.buildAndProjectPath ( self,
edge,
qb,
qe )
Build a path from qb to qe using the Edge::build.
\\param edge name of the edge to use.
\\param qb configuration at the beginning of the path
\\param qe configuration at the end of the path
\\retval return true if the path is built and fully projected.
\\retval indexNotProj -1 is the path could not be built. The index
                     of the built path (before projection) in the
                     in the ProblemSolver path vector.
\\retval indexProj -1 is the path could not be fully projected. The
                  index of the built path (before projection) in the
                  in the ProblemSolver path vector.
No path validation is made. The paths can be retrieved using
corbaserver::Problem::configAtParam

◆ buildGenericGraph()

manipulation.constraint_graph.ConstraintGraph.buildGenericGraph ( robot,
name,
grippers,
objects,
handlesPerObjects,
shapesPerObjects,
envNames,
rules = [] )
static
# Build a graph
\\return a Initialized ConstraintGraph object
\\sa hpp::corbaserver::manipulation::Graph::autoBuild for complete
    documentation.

◆ createEdge()

manipulation.constraint_graph.ConstraintGraph.createEdge ( self,
nodeFrom,
nodeTo,
name,
weight = 1,
isInNode = None )
Create an edge
\\param nodeFrom, nodeTo the extremities of the edge,
\\param name name of the edge,
\\param weight see note,
\\param isInNode name of the node in which paths of the edge are included.
       if None, it consists of the node coming the latest in the list of
       nodes.
\\note The weights define the probability of selecting an edge among all the
outgoing edges of a node. The probability of an edge is
\\f$ \\frac{w_i}{\\sum_j{w_j}} \\f$,
where each \\f$ w_j \\f$ corresponds to an outgoing edge from a given node.
To have an edge that cannot be selected by the M-RRT algorithm but is still
acceptable, set its weight to zero.

◆ createGrasp()

manipulation.constraint_graph.ConstraintGraph.createGrasp ( self,
name,
gripper,
handle )
Create grasp constraints between robot gripper and object handle

Creates two contraints between a handle and a gripper.
\\li The first constraint named "${name}" is defined by
the type of handle. For instance, an axial handle defines
a five degree of freedom constraint with free rotation
around the x-axis.
\\li the second constraint named "${name}/complement" is
the complement to the full transformation constraint. For the axial
handle, it corresponds to the rotation around x.

\\param name prefix of the constraint names for storing in
       ProblemSolver map,
\\param gripper name of the gripper used when it has been created
\\param handle name of the handle in the form "object/handle"
where object is the name of the object owning the handle and handle
is the name of the handle in this object.

\\sa method hpp::corbaserver::manipulation::Problem::createGrasp.

◆ createLevelSetEdge()

manipulation.constraint_graph.ConstraintGraph.createLevelSetEdge ( self,
nodeFrom,
nodeTo,
name,
weight = 1,
isInNode = None )
Create a LevelSetEdge.
\\param nodeFrom, nodeTo, name, weight, isInNode see createEdge note.
\\note See documentation of class hpp::manipulation::graph::LevelSetEdge
        for more information.

◆ createNode()

manipulation.constraint_graph.ConstraintGraph.createNode ( self,
node,
waypoint = False,
priority = None )
Create one or several node
\\param node name (resp. list of names) of the node(s) to be created.
\\param waypoint set to True when creating waypoint nodes.
\\param priority integer (resp. list of) used to order the states.
        If two states have the same priority,
        then the order is the order of creation.
\\note The order is important.
       The first should be the most restrictive one as a configuration
will be in the first node for which the constraint are satisfied.

◆ createPreGrasp()

manipulation.constraint_graph.ConstraintGraph.createPreGrasp ( self,
name,
gripper,
handle )
Create pre-grasp constraints between robot gripper and object handle

Creates two contraints between a handle and a gripper.
\\li The first constraint named "${name}" is the same as the grasp
defined in createGrasp, except that the translation along x is not
constrained. For instance, an axial handle defines
a four degree of freedom constraint with free rotation and translation
around/along the x-axis,
\\li the second constraint named "${name}/double_ineq" is a double
inequality on the relative x-position of the handle and of the gripper.
the bounds of the inequality are for now [-.001 c, 2.001 c].

\\param name prefix of the constraint names for storing in
       ProblemSolver map,
\\param gripper name of the gripper used when it has been created
\\param handle name of the handle in the form "object/handle"
where object is the name of the object owning the handle and handle
is the name of the handle in this object,

\\sa hpp::corbaserver::manipulation::Problem::createPreGrasp

◆ createWaypointEdge()

manipulation.constraint_graph.ConstraintGraph.createWaypointEdge ( self,
nodeFrom,
nodeTo,
name,
nb = 1,
weight = 1,
isInNode = None,
automaticBuilder = True )
Create a WaypointEdge.
\\param nodeFrom, nodeTo, name, weight, isInNode see createEdge note,
\\param nb number of waypoints,
\\note See documentation of class hpp::manipulation::graph::WaypointEdge
        for more information.

\\warning Waypoint are now specified by hand to allow finer handling
of edge types between waypoints. This function has been updated to be
backward compatible but except for the return value.
For a finer control of what you are doing, set automaticBuilder to
False.

◆ display()

manipulation.constraint_graph.ConstraintGraph.display ( self,
dotOut = "/tmp/constraintgraph.dot",
pdfOut = "/tmp/constraintgraph",
format = "pdf",
open = True )
Display the current graph.
The graph is printed in DOT format. Command dot must be
available.
\\param dotOut full path of the generated DOT file.
\\param pdfOut fill path of the generated PDF document.
\\param openPDF set to False if you just want to generate the PDF.
\\note DOT and PDF files will be overwritten and are not automatically
deleted so you can keep them.

◆ displayEdgeConstraints()

manipulation.constraint_graph.ConstraintGraph.displayEdgeConstraints ( self,
edge )
Print set of constraints relative to an edge in a string

\\param config Configuration,
\\param edgeId id of the edge.
\\return string displaying path constraints of the edge

◆ displayEdgeTargetConstraints()

manipulation.constraint_graph.ConstraintGraph.displayEdgeTargetConstraints ( self,
edge )
Print set of constraints relative to an edge in a string

\\param config Configuration,
\\param edgeId id of the edge.
\\return string displaying constraints of the edge and of the target
        node

◆ displayNodeConstraints()

manipulation.constraint_graph.ConstraintGraph.displayNodeConstraints ( self,
node )
Print set of constraints relative to a node in a string

\\param config Configuration,
\\param nodeId id of the node.
\\return string displaying constraints

◆ generateTargetConfig()

manipulation.constraint_graph.ConstraintGraph.generateTargetConfig ( self,
edge,
qfrom,
input )
Generate configuration in destination state on a given leaf

\\param edge name of the edge
\\param qfrom configuration defining the right hand side of the edge
       constraint,
\\param input input configuration,
\\retval output output configuration,
\\retval error norm of the residual error.

Compute a configuration in the destination node of the edge,
reachable from qFrom.

◆ getConfigErrorForEdge()

manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdge ( self,
edgeId,
config )
Get error of a config with respect to a edge constraint

\\param edge name of the edge.
\\param config Configuration,
\\retval error the error of the edge constraint for the
       configuration
\\return whether the configuration belongs to the edge.
Call methods core::ConfigProjector::rightHandSideFromConfig with
the input configuration and then core::ConstraintSet::isSatisfied
on the edge constraints.

◆ getConfigErrorForEdgeLeaf()

manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdgeLeaf ( self,
edgeId,
leafConfig,
config )
Get error of a config with respect to an edge foliation leaf

\\param edgeId id of the edge.
\\param leafConfig Configuration that determines the foliation leaf,
\\param config Configuration the error of which is computed
\\retval error the error
\\return 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()

manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdgeTarget ( self,
edgeId,
leafConfig,
config )
Get error of a config with respect to the target of an edge foliation leaf

\\param edgeId id of the edge.
\\param leafConfig Configuration that determines the foliation leaf,
\\param config Configuration the error of which is computed
\\retval error the error
\\return 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.

◆ getConfigErrorForNode()

manipulation.constraint_graph.ConstraintGraph.getConfigErrorForNode ( self,
nodeId,
config )
Get error of a config with respect to a node constraint

\\param node name of the node.
\\param config Configuration,
\\retval error the error of the node constraint for the
       configuration
\\return whether the configuration belongs to the node.
Call method core::ConstraintSet::isSatisfied for the node
constraints.

◆ getContainingNode()

manipulation.constraint_graph.ConstraintGraph.getContainingNode ( self,
edge )
Get in which node an edge is.
\\param edge the edge,
Paths satisfying the edge constraints satisfy the node constraints.

◆ getNode()

manipulation.constraint_graph.ConstraintGraph.getNode ( self,
config )
 Get the node corresponding to the state of the configuration.
\\param dofArray the configuration.
\\return the name of the node

◆ getNodesConnectedByEdge()

manipulation.constraint_graph.ConstraintGraph.getNodesConnectedByEdge ( self,
edge )
Get nodes connected by an edge

\\param edge name of the edge
\\param from name of the node the edge starts from,
\\param to name of the node the edge finishes in.

◆ getSecurityMarginMatrixForEdge()

manipulation.constraint_graph.ConstraintGraph.getSecurityMarginMatrixForEdge ( self,
edge )

◆ getWeight()

manipulation.constraint_graph.ConstraintGraph.getWeight ( self,
edge )
Get weight of an edge

◆ initialize()

manipulation.constraint_graph.ConstraintGraph.initialize ( self)

◆ isShort()

manipulation.constraint_graph.ConstraintGraph.isShort ( self,
edge )

◆ removeCollisionPairFromEdge()

manipulation.constraint_graph.ConstraintGraph.removeCollisionPairFromEdge ( self,
edge,
joint1,
joint2 )
Remove collision pairs from an edge

\\param edge name of the edge,
\\param joint1, joint2, names of the joints defining the pair.

◆ setContainingNode()

manipulation.constraint_graph.ConstraintGraph.setContainingNode ( self,
edge,
node )
Set in which node an edge is.
\\param edge the edge,
\\param node the node.
Paths satisfying the edge constraints satisfy the node constraints.

◆ setProblemConstraints()

manipulation.constraint_graph.ConstraintGraph.setProblemConstraints ( self,
name,
target )
Set the problem constraints to the specified constraint.

\\param idComp ID of a node or a configuration
\\param target: ignored for states. For edges:
       \\li true: uses the edge target constraint
       \\li false: uses the edge path constraint

◆ setSecurityMarginForEdge()

manipulation.constraint_graph.ConstraintGraph.setSecurityMarginForEdge ( self,
edge,
joint1,
joint2,
margin )
Set collision security margin for a pair of joints along an edge

\\param edge name of the edge,
\\param joint1, joint2 names of the joints or "universe" for the
       environment,
\\param margin security margin.

◆ setShort()

manipulation.constraint_graph.ConstraintGraph.setShort ( self,
edge,
isShort )
Set that an edge is short
\\param edge name of the edge
\\param True or False

When an edge is tagged as short, extension along this edge is
done differently in RRT-like algorithms. Instead of projecting
a random configuration in the destination node, the
configuration to extend itself is projected in the destination
node. This makes the rate of success higher.

◆ setTextToTeXTranslation()

manipulation.constraint_graph.ConstraintGraph.setTextToTeXTranslation ( self,
textToTex )
Set the local dictionnary
\\param textToTex a dictionnary of (plain text, TeX replacment)
If the name of a node or an edges is a key of the dictionnary,
it is replaced by the corresponding value.

◆ setWeight()

manipulation.constraint_graph.ConstraintGraph.setWeight ( self,
edge,
weight )
Set weight of an edge

Member Data Documentation

◆ client

manipulation.constraint_graph.ConstraintGraph.client

◆ clientBasic

manipulation.constraint_graph.ConstraintGraph.clientBasic

◆ cmdDot

dict manipulation.constraint_graph.ConstraintGraph.cmdDot
static
Initial value:
= {
"pdf": ["dot", "-Gsize=7.5,10", "-Tpdf"],
"svg": ["dot", "-Gsize=7.5,10", "-Tsvg"],
}

◆ cmdViewer

dict manipulation.constraint_graph.ConstraintGraph.cmdViewer = {"pdf": ["evince"], "svg": ["firefox"]}
static

◆ edges

manipulation.constraint_graph.ConstraintGraph.edges

◆ graph

manipulation.constraint_graph.ConstraintGraph.graph

◆ graphId

manipulation.constraint_graph.ConstraintGraph.graphId

◆ grasps

manipulation.constraint_graph.ConstraintGraph.grasps

◆ name

manipulation.constraint_graph.ConstraintGraph.name

◆ nodes

manipulation.constraint_graph.ConstraintGraph.nodes

◆ pregrasps

manipulation.constraint_graph.ConstraintGraph.pregrasps

◆ robot

manipulation.constraint_graph.ConstraintGraph.robot

◆ textToTex

manipulation.constraint_graph.ConstraintGraph.textToTex

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