hpp-manipulation-corba
4.9.0
Corba server for manipulation planning
|
This class wraps the Corba client to the server implemented by libhpp-manipulation-corba.so. More...
Public Member Functions | |
def | __init__ (self, robot, graphName, makeGraph=True) |
def | addTextToTeXTranslation (self, text, tex) |
Add entry to the local dictionnary. More... | |
def | setTextToTeXTranslation (self, textToTex) |
Set the local dictionnary. More... | |
def | setSecurityMarginForEdge (self, edge, joint1, joint2, margin) |
Set collision security margin for a pair of joints along an edge. More... | |
Working with the constraint graph | |
def | display (self, dotOut='/tmp/constraintgraph.dot', pdfOut='/tmp/constraintgraph', format='pdf', open=True) |
Display the current graph. More... | |
def | getNodesConnectedByEdge (self, edge) |
Get nodes connected by an edge. More... | |
def | applyNodeConstraints (self, node, input) |
Apply constaints to a configuration. More... | |
def | applyEdgeLeafConstraints (self, edge, qfrom, input) |
Apply edge constaints to a configuration. More... | |
def | generateTargetConfig (self, edge, qfrom, input) |
Generate configuration in destination state on a given leaf. More... | |
def | buildAndProjectPath (self, edge, qb, qe) |
Build a path from qb to qe using the Edge::build. More... | |
def | getConfigErrorForNode (self, nodeId, config) |
Get error of a config with respect to a node constraint. More... | |
def | getNode (self, config) |
Get the node corresponding to the state of the configuration. More... | |
def | getConfigErrorForEdge (self, edgeId, config) |
Get error of a config with respect to a edge constraint. More... | |
def | getConfigErrorForEdgeLeaf (self, edgeId, leafConfig, config) |
Get error of a config with respect to an edge foliation leaf. More... | |
def | getConfigErrorForEdgeTarget (self, edgeId, leafConfig, config) |
Get error of a config with respect to the target of an edge foliation leaf. More... | |
def | displayNodeConstraints (self, node) |
Print set of constraints relative to a node in a string. More... | |
def | displayEdgeConstraints (self, edge) |
Print set of constraints relative to an edge in a string. More... | |
def | displayEdgeTargetConstraints (self, edge) |
Print set of constraints relative to an edge in a string. More... | |
Public Attributes | |
robot | |
client | |
clientBasic | |
graph | |
name | |
grasps | |
pregrasps | |
nodes | |
A dictionnary mapping the node names to their ID. More... | |
edges | |
A dictionnary mapping the edge names to their ID. More... | |
graphId | |
textToTex | |
Static Public Attributes | |
dictionary | cmdDot |
dictionary | cmdViewer |
Building the constraint graph | |
def | createNode (self, node, waypoint=False, priority=None) |
Create one or several node. More... | |
def | createEdge (self, nodeFrom, nodeTo, name, weight=1, isInNode=None) |
Create an edge. More... | |
def | setContainingNode (self, edge, node) |
Set in which node an edge is. More... | |
def | getContainingNode (self, edge) |
Get in which node an edge is. More... | |
def | setShort (self, edge, isShort) |
Set that an edge is short. More... | |
def | isShort (self, edge) |
def | createWaypointEdge (self, nodeFrom, nodeTo, name, nb=1, weight=1, isInNode=None, automaticBuilder=True) |
Create a WaypointEdge. More... | |
def | createLevelSetEdge (self, nodeFrom, nodeTo, name, weight=1, isInNode=None) |
Create a LevelSetEdge. More... | |
def | createGrasp (self, name, gripper, handle, passiveJoints="") |
Create grasp constraints between robot gripper and object handle. More... | |
def | createPreGrasp (self, name, gripper, handle, passiveJoints="") |
Create pre-grasp constraints between robot gripper and object handle. More... | |
def | setProblemConstraints (self, name, target) |
Set the problem constraints to the specified constraint. More... | |
def | addConstraints (self, graph=False, node=None, edge=None, constraints=None, passiveJoints=[]) |
Add the constraints to an edge, a node or the whole graph. More... | |
def | removeCollisionPairFromEdge (self, edge, joint1, joint2) |
Remove collision pairs from an edge. More... | |
def | addLevelSetFoliation (self, edge, condGrasps=None, condPregrasps=None, condNC=[], condLJ=[], paramGrasps=None, paramPregrasps=None, paramNC=[], paramPassiveJoints=[], paramLJ=[]) |
Add the numerical constraints to a LevelSetEdge that create the foliation. More... | |
def | getWeight (self, edge) |
Get weight of an edge. More... | |
def | setWeight (self, edge, weight) |
Set weight of an edge. More... | |
Automatic building | |
def | initialize (self) |
def | buildGenericGraph (robot, name, grippers, objects, handlesPerObjects, shapesPerObjects, envNames, rules=[]) |
Build a graph. More... | |
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.
def manipulation.constraint_graph.ConstraintGraph.__init__ | ( | self, | |
robot, | |||
graphName, | |||
makeGraph = True |
|||
) |
def manipulation.constraint_graph.ConstraintGraph.addConstraints | ( | self, | |
graph = False , |
|||
node = None , |
|||
edge = None , |
|||
constraints = None , |
|||
passiveJoints = [] |
|||
) |
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.
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. |
passiveJoints | passive joints (not modified by constraint resolution) |
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. passiveJoints: passive joints (not modified by constraint resolution) note: Exaclty one of the parameter graph, node and edge must be set.
def manipulation.constraint_graph.ConstraintGraph.addLevelSetFoliation | ( | self, | |
edge, | |||
condGrasps = None , |
|||
condPregrasps = None , |
|||
condNC = [] , |
|||
condLJ = [] , |
|||
paramGrasps = None , |
|||
paramPregrasps = None , |
|||
paramNC = [] , |
|||
paramPassiveJoints = [] , |
|||
paramLJ = [] |
|||
) |
Add the numerical constraints to a LevelSetEdge that create the foliation.
edge | name of a LevelSetEdge of the graph. |
condGrasps,condPregrasps | name, or list of names, of grasp or pregrasp that define the foliated manifold |
condNC,condLJ | numerical constraints and locked joints that define the foliated manifold |
paramGrasps,paramPregrasps | name, or list of names, of grasp or pregrasp that parametrize the foliation |
paramNC,paramPassiveJoints,paramLJ | numerical constraints and locked joints that parametrize the foliation |
def manipulation.constraint_graph.ConstraintGraph.addTextToTeXTranslation | ( | self, | |
text, | |||
tex | |||
) |
Add entry to the local dictionnary.
text | plain text |
tex | its latex translation |
def manipulation.constraint_graph.ConstraintGraph.applyEdgeLeafConstraints | ( | self, | |
edge, | |||
qfrom, | |||
input | |||
) |
Apply edge constaints to a configuration.
edge | name of the edge |
qfrom | configuration defining the right hand side of the edge constraint, |
input | input configuration, |
output | output configuration, |
error | norm of the residual error. |
If success, the output configuration is reachable from qfrom along the transition.
def manipulation.constraint_graph.ConstraintGraph.applyNodeConstraints | ( | self, | |
node, | |||
input | |||
) |
Apply constaints to a configuration.
node | name of the node the constraints of which to apply |
input | input configuration, |
output | output configuration, |
error | norm of the residual error. |
def manipulation.constraint_graph.ConstraintGraph.buildAndProjectPath | ( | self, | |
edge, | |||
qb, | |||
qe | |||
) |
Build a path from qb to qe using the Edge::build.
edge | name of the edge to use. |
qb | configuration at the beginning of the path |
qe | configuration at the end of the path |
return | true if the path is built and fully projected. |
indexNotProj | -1 is the path could not be built. The index of the built path (before projection) in the in the ProblemSolver path vector. |
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 |
|
static |
Build a graph.
def manipulation.constraint_graph.ConstraintGraph.createEdge | ( | self, | |
nodeFrom, | |||
nodeTo, | |||
name, | |||
weight = 1 , |
|||
isInNode = None |
|||
) |
Create an edge.
nodeFrom,nodeTo | the extremities of the edge, |
name | name of the edge, |
weight | see note, |
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. |
def manipulation.constraint_graph.ConstraintGraph.createGrasp | ( | self, | |
name, | |||
gripper, | |||
handle, | |||
passiveJoints = "" |
|||
) |
Create grasp constraints between robot gripper and object handle.
Creates two contraints between a handle and a gripper.
name | prefix of the constraint names for storing in ProblemSolver map, |
gripper | name of the gripper used when it has been created |
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. |
passiveJoints | name of the set of passive joints associated to the grasp constraints as register in ProblemSolver |
def manipulation.constraint_graph.ConstraintGraph.createLevelSetEdge | ( | self, | |
nodeFrom, | |||
nodeTo, | |||
name, | |||
weight = 1 , |
|||
isInNode = None |
|||
) |
Create a LevelSetEdge.
nodeFrom,nodeTo,name,weight,isInNode | see createEdge note. |
def manipulation.constraint_graph.ConstraintGraph.createNode | ( | self, | |
node, | |||
waypoint = False , |
|||
priority = None |
|||
) |
Create one or several node.
node | name (resp. list of names) of the node(s) to be created. |
waypoint | set to True when creating waypoint nodes. |
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. |
def manipulation.constraint_graph.ConstraintGraph.createPreGrasp | ( | self, | |
name, | |||
gripper, | |||
handle, | |||
passiveJoints = "" |
|||
) |
Create pre-grasp constraints between robot gripper and object handle.
Creates two contraints between a handle and a gripper.
name | prefix of the constraint names for storing in ProblemSolver map, |
gripper | name of the gripper used when it has been created |
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, |
passiveJoints | name of the set of passive joints associated to the pre-grasp constraints as register in ProblemSolver. |
def manipulation.constraint_graph.ConstraintGraph.createWaypointEdge | ( | self, | |
nodeFrom, | |||
nodeTo, | |||
name, | |||
nb = 1 , |
|||
weight = 1 , |
|||
isInNode = None , |
|||
automaticBuilder = True |
|||
) |
Create a WaypointEdge.
nodeFrom,nodeTo,name,weight,isInNode | see createEdge note, |
nb | number of waypoints, |
def 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.
dotOut | full path of the generated DOT file. |
pdfOut | fill path of the generated PDF document. |
openPDF | set to False if you just want to generate the PDF. |
def manipulation.constraint_graph.ConstraintGraph.displayEdgeConstraints | ( | self, | |
edge | |||
) |
Print set of constraints relative to an edge in a string.
config | Configuration, |
edgeId | id of the edge. |
def manipulation.constraint_graph.ConstraintGraph.displayEdgeTargetConstraints | ( | self, | |
edge | |||
) |
Print set of constraints relative to an edge in a string.
config | Configuration, |
edgeId | id of the edge. |
def manipulation.constraint_graph.ConstraintGraph.displayNodeConstraints | ( | self, | |
node | |||
) |
Print set of constraints relative to a node in a string.
config | Configuration, |
nodeId | id of the node. |
def manipulation.constraint_graph.ConstraintGraph.generateTargetConfig | ( | self, | |
edge, | |||
qfrom, | |||
input | |||
) |
Generate configuration in destination state on a given leaf.
edge | name of the edge |
qfrom | configuration defining the right hand side of the edge constraint, |
input | input configuration, |
output | output configuration, |
error | norm of the residual error. |
Compute a configuration in the destination node of the edge, reachable from qFrom.
def manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdge | ( | self, | |
edgeId, | |||
config | |||
) |
Get error of a config with respect to a edge constraint.
edge | name of the edge. |
config | Configuration, |
error | the error of the edge constraint for the configuration |
def manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdgeLeaf | ( | self, | |
edgeId, | |||
leafConfig, | |||
config | |||
) |
Get error of a config with respect to an edge foliation leaf.
edgeId | id of the edge. |
leafConfig | Configuration that determines the foliation leaf, |
config | Configuration the error of which is computed |
error | the error |
def manipulation.constraint_graph.ConstraintGraph.getConfigErrorForEdgeTarget | ( | self, | |
edgeId, | |||
leafConfig, | |||
config | |||
) |
Get error of a config with respect to the target of an edge foliation leaf.
edgeId | id of the edge. |
leafConfig | Configuration that determines the foliation leaf, |
config | Configuration the error of which is computed |
error | the error |
def manipulation.constraint_graph.ConstraintGraph.getConfigErrorForNode | ( | self, | |
nodeId, | |||
config | |||
) |
Get error of a config with respect to a node constraint.
node | name of the node. |
config | Configuration, |
error | the error of the node constraint for the configuration |
def manipulation.constraint_graph.ConstraintGraph.getContainingNode | ( | self, | |
edge | |||
) |
Get in which node an edge is.
edge | the edge, Paths satisfying the edge constraints satisfy the node constraints. |
def manipulation.constraint_graph.ConstraintGraph.getNode | ( | self, | |
config | |||
) |
Get the node corresponding to the state of the configuration.
dofArray | the configuration. |
def manipulation.constraint_graph.ConstraintGraph.getNodesConnectedByEdge | ( | self, | |
edge | |||
) |
Get nodes connected by an edge.
edge | name of the edge |
from | name of the node the edge starts from, |
to | name of the node the edge finishes in. |
def manipulation.constraint_graph.ConstraintGraph.getWeight | ( | self, | |
edge | |||
) |
Get weight of an edge.
def manipulation.constraint_graph.ConstraintGraph.initialize | ( | self | ) |
def manipulation.constraint_graph.ConstraintGraph.isShort | ( | self, | |
edge | |||
) |
def manipulation.constraint_graph.ConstraintGraph.removeCollisionPairFromEdge | ( | self, | |
edge, | |||
joint1, | |||
joint2 | |||
) |
Remove collision pairs from an edge.
edge | name of the edge, |
joint1,joint2,names | of the joints defining the pair. |
def manipulation.constraint_graph.ConstraintGraph.setContainingNode | ( | self, | |
edge, | |||
node | |||
) |
Set in which node an edge is.
edge | the edge, |
node | the node. Paths satisfying the edge constraints satisfy the node constraints. |
def manipulation.constraint_graph.ConstraintGraph.setProblemConstraints | ( | self, | |
name, | |||
target | |||
) |
Set the problem constraints to the specified constraint.
idComp | ID of a node or a configuration |
target | ignored for states. For edges:
|
def manipulation.constraint_graph.ConstraintGraph.setSecurityMarginForEdge | ( | self, | |
edge, | |||
joint1, | |||
joint2, | |||
margin | |||
) |
Set collision security margin for a pair of joints along an edge.
edge | name of the edge, |
joint1,joint2 | names of the joints or "universe" for the environment, |
margin | security margin. |
def manipulation.constraint_graph.ConstraintGraph.setShort | ( | self, | |
edge, | |||
isShort | |||
) |
Set that an edge is short.
edge | name of the edge |
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.
def manipulation.constraint_graph.ConstraintGraph.setTextToTeXTranslation | ( | self, | |
textToTex | |||
) |
Set the local dictionnary.
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. |
def manipulation.constraint_graph.ConstraintGraph.setWeight | ( | self, | |
edge, | |||
weight | |||
) |
Set weight of an edge.
manipulation.constraint_graph.ConstraintGraph.client |
manipulation.constraint_graph.ConstraintGraph.clientBasic |
|
static |
|
static |
manipulation.constraint_graph.ConstraintGraph.edges |
A dictionnary mapping the edge names to their ID.
manipulation.constraint_graph.ConstraintGraph.graph |
manipulation.constraint_graph.ConstraintGraph.graphId |
manipulation.constraint_graph.ConstraintGraph.grasps |
manipulation.constraint_graph.ConstraintGraph.name |
manipulation.constraint_graph.ConstraintGraph.nodes |
A dictionnary mapping the node names to their ID.
manipulation.constraint_graph.ConstraintGraph.pregrasps |
manipulation.constraint_graph.ConstraintGraph.robot |
manipulation.constraint_graph.ConstraintGraph.textToTex |