pyhpp.manipulation
Functions
Device
Inherits: pyhpp.pinocchio.bindings.Device
Device with handles.
As a deriving class of hpp::pinocchio::HumanoidRobot, it is compatible with hpp::pinocchio::urdf::loadHumanoidRobot
This class also contains pinocchio::Gripper, Handle and JointAndShapes_t
| def | Description |
|---|---|
def init(self, arg2: str) -> None | |
def addGripper(self, arg2: str, arg3: str, arg4: pinocchio.pinocchio_pywrap_default.SE3, arg5: float) -> None | Add a gripper to the kinematic chain |
def addHandle(self, arg2: str, arg3: str, arg4: pinocchio.pinocchio_pywrap_default.SE3, arg5: float, arg6: pinocchio.pinocchio_pywrap_default.StdVec_Bool) -> None | Add a handle to the kinematic chain |
| |
def contactSurfaceNames(self) -> list | Return list of contact surface names registered on device |
def contactSurfaces(self) -> dict | Return dict mapping surface names to list of {joint, points} |
def getJointConfig(self, arg2: str) -> list | Return current configuration values of the named joint. |
def getJointNames(self) -> list | Return list of all joint names in the Pinocchio model. |
def grippers(self) -> pyhpp.pinocchio.bindings.GripperMap | Return a map from gripper name to Gripper object. |
def handles(self) -> HandleMap | Return a map from handle name to Handle object. |
def modelsInfo(self) -> modelsInfoVec | Return list of modelsInfo stored in the device, each element contains the urdf path, srdf path, prefix and initial pose of a model loaded in the device |
def setJointBounds(self, arg2: str, arg3: list) -> None | Set joint bounds from a flat list [min0, max0, min1, max1, …]. |
def setRobotRootPosition(self, arg2: str, arg3: pinocchio.pinocchio_pywrap_default.SE3) -> None | Set the root position of a sub-robot (identified by name) relative to its parent joint. |
EndEffectorTrajectory
Inherits: pyhpp.core.bindings.PathPlanner
Plan a path for a robot with constrained trajectory of an end effector
This path planner only works with a steering method of type steeringMethod::EndEffectorTrajectory. The steering method defines the desired end-effector trajectory using a time-varying constraint.
To plan a path between two configurations q_init and q_goal, the configurations must satisfy the constraint at the beginning and at the end of the definition interval respectively.
The interval of definition of the output path is defined by the time-varying constraint of the steering method. This interval is uniformly discretized in a number of samples that can be accessed using method nDiscreteSteps .
The path is planned by successively calling method oneStep that performs the following actions.
A vector of configurations is produced by appending random configurations to q_init. The number of random configurations can be accessed by methods nRandomConfig .
for each configuration in the vector,
the initial configuration of the path is computed by projecting the configuration on the constraint,
the configuration at following samples is computed by projecting the configuration at the previous sample using the time-varying constraint.
In case of failure
in projecting a configuration or
in validating the path for collision, the loop restart with the next random configuration.
Note that continuity is not tested but enforced by projecting the configuration of the previous sample to compute the configuration at a given sample. DeprecatedThis class has been reimplemented and simplified as steeringMethod::Cartesian.
| def | Description |
|---|---|
| |
| If enabled, only add one solution to the roadmap. Otherwise add all solutions. |
| Number of steps to generate goal config (successive projections). |
| Get the number of random configurations used to generate the initial config of the final path. |
EndEffectorTrajectorySteeringMethod
Inherits: pyhpp.core.bindings.SteeringMethod
| def | Description |
|---|---|
def init(self, arg2: object) -> None | |
def setTrajectory(self, arg2: pyhpp.core.bindings.Path, arg3: bool) -> None | Set the right hand side of the trajectory constraint from a path. param se3Output: set to True if the output of path must be understood as SE3. |
def setTrajectoryConstraint(self, arg2: pyhpp.constraints.bindings.Implicit) -> None | Set the constraint whose right hand side will vary along the trajectory. |
EnforceTransitionSemantic
Inherits: pyhpp.core.bindings.PathOptimizer
Recompute the transition relative to each element of the path vector
When executing a sequence of direct paths on a real robot, it is useful to know which
transition of the graph each direct path corresponds to. For example, in a manipulation
motion, before grasping an object, the robot needs to open the gripper. This information
is contained in the transition that leads to a pregrasp waypoint state. The direct path
should therefore have access to the transition.
The information is stored in the hpp::manipulation::ConstraintSet.
of the path and is accessible via method hpp::manipulation::ConstraintSet::edge
If the path vector is produced by a manipulation planner, each direct path has been created
by a transition. However, the path may later be cut by random shortcut or due to collision and
the associated transition become irrelevant. For example if a path is created by a transition
that leads to a pre-grasp, and cut due to a collision, the path does not reach the target
state and the relevant transition is not the one that built the path.
This class takes a hpp::core::PathVector as input an relabel
each direct path with the correct transition.
Precondition — The path should have been created by a manipulation planning algorithm: in other
words, the constraint set of each direct path should be of type
hpp::manipulation::ConstraintSet.
| def | Description |
|---|---|
def init(self, arg2: object) -> object |
Graph
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:
A Graph owns (i.e. has a shared pointer to) the StateSelector s
A StateSelector owns the Node s related to one gripper.
A State owns its outgoing Edge s.
An Edge does not own anything.
The graph and all its components have a unique index starting at 0 for the graph itself. The index of a component can be retrieved using method GraphComponent::id.
| def | Description |
|---|---|
def init(self, arg2: str, arg3: Device, arg4: Problem) -> None | |
def _get_native_graph(self) -> object | Return a capsule wrapping the native C++ Graph object (for external interop). |
def addLevelSetFoliation(self, arg2: Transition, arg3: list, arg4: list) -> None | Add the numerical constraints to a LevelSetTransition that create the foliation. |
def addNumericalConstraint(self, arg2: State, arg3: pyhpp.constraints.bindings.Implicit) -> None | Add a numerical constraint to a state. |
def addNumericalConstraintsForPath(self, arg2: State, arg3: list) -> None | Add numerical constraints for path to a state. |
def addNumericalConstraintsToGraph(self, arg2: list) -> None | Add a list of numerical constraints to all transitions in the graph. |
def addNumericalConstraintsToState(self, arg2: State, arg3: list) -> None | Add numerical constraints to a state. |
def addNumericalConstraintsToTransition(self, arg2: Transition, arg3: list) -> None | Add numerical constraints to a TRANSITION. |
def applyLeafConstraints(self, arg2: Transition, arg3: numpy.ndarray, arg4: numpy.ndarray) -> tuple | Apply transition constraints to a configuration. Returns tuple with success flag, output configuration, and error norm. If success, the output configuration is reachable from q_rhs along the transition. |
def applyStateConstraints(self, arg2: State, arg3: numpy.ndarray) -> tuple | Apply constraints to a configuration. Returns tuple with success flag, output configuration, and error norm. |
def createGraspConstraint(self, arg2: str, arg3: str, arg4: str) -> list | Create grasp, complement and hold constraints for a gripper-handle pair. Returns a list [grasp, complement, hold]. |
def createLevelSetTransition(self, arg2: State, arg3: State, arg4: str, arg5: pyhpp.core.path.bindings.SplineB3, arg6: State) -> Transition | Create a LevelSetTransition. See documentation of class hpp::manipulation::graph::LevelSetEdge for more information. |
| Create placement constraint between object surfaces and environment surfaces. Creates constraints that ensure proper contact between object and environment. |
def createPreGraspConstraint(self, arg2: str, arg3: str, arg4: str) -> pyhpp.constraints.bindings.Implicit | Create a pre-grasp constraint for a gripper-handle pair. |
| Create pre-placement constraint with specified width margin. Used for approaching placement configurations before final placement. |
def createState(self, arg2: str, arg3: bool, arg4: pyhpp.core.path.bindings.SplineB3) -> State | Create one or several states. The order is important - the first should be the most restrictive one as a configuration will be in the first state for which the constraints are satisfied. |
def createSubGraph(self, arg2: str, arg3: pyhpp.core.bindings.Roadmap) -> None | Create a subgraph with guided state selection. |
def createTransition(self, arg2: State, arg3: State, arg4: str, arg5: pyhpp.core.path.bindings.SplineB3, arg6: State) -> Transition | Create a transition. The weights define the probability of selecting a transition among all the outgoing transitions of a state. The probability of a transition is w_i / sum(w_j), where each w_j corresponds to an outgoing transition from a given state. To have a transition that cannot be selected by the M-RRT algorithm but is still acceptable, set its weight to zero. |
def createWaypointTransition(self, arg2: State, arg3: State, arg4: str, arg5: pyhpp.core.path.bindings.SplineB3, arg6: pyhpp.core.path.bindings.SplineB3, arg7: State, arg8: bool) -> Transition | Create a WaypointTransition. See documentation of class hpp::manipulation::graph::WaypointEdge for more information. |
def display(self, arg2: str) -> None | Display the current graph. The graph is printed in DOT format. |
def displayStateConstraints(self, arg2: State) -> str | Print set of constraints relative to a state in a string. |
def displayTransitionConstraints(self, arg2: Transition) -> str | Print set of constraints relative to a transition in a string. |
def displayTransitionTargetConstraints(self, arg2: Transition) -> str | Print set of constraints relative to a transition in a string. |
| Get error threshold in config projector. |
def generateTargetConfig(self, arg2: Transition, arg3: numpy.ndarray, arg4: numpy.ndarray) -> tuple | Generate configuration in destination state on a given leaf. Returns tuple with success flag, output configuration, and error norm. Computes a configuration in the destination state of the transition, reachable from q_rhs. |
def getConfigErrorForState(self, arg2: State, arg3: numpy.ndarray) -> tuple | Get error of a config with respect to a state constraint. Returns whether the configuration belongs to the state. Calls core::ConstraintSet::isSatisfied for the state constraints. |
def getConfigErrorForTransition(self, arg2: Transition, arg3: numpy.ndarray) -> tuple | Get error of a config with respect to a transition constraint. Returns whether the configuration belongs to the transition. Calls core::ConfigProjector::rightHandSideFromConfig with the input configuration and then core::ConstraintSet::isSatisfied on the transition constraints. |
def getConfigErrorForTransitionLeaf(self, arg2: Transition, arg3: numpy.ndarray, arg4: numpy.ndarray) -> tuple | Get error of a config with respect to a transition foliation leaf. Returns whether config can be the end point of a path of the transition starting at leafConfig. |
def getConfigErrorForTransitionTarget(self, arg2: Transition, arg3: numpy.ndarray, arg4: numpy.ndarray) -> tuple | Get error of a config with respect to the target of a transition foliation leaf. Returns whether config can be the end point of a path of the transition starting at leafConfig. |
def getContainingNode(self, arg2: Transition) -> str | Get the name of the state in which a transition is. Paths satisfying the transition constraints satisfy the state constraints. |
def getNodesConnectedByTransition(self, arg2: Transition) -> tuple | Get the names of the states connected by a transition. |
def getNumericalConstraintsForEdge(self, arg2: Transition) -> list | Get numerical constraints of an edge. |
def getNumericalConstraintsForGraph(self) -> list | Get numerical constraints of the graph. |
def getNumericalConstraintsForState(self, arg2: State) -> list | Get numerical constraints of a state. |
def getRelativeMotionMatrix(self, arg2: Transition) -> list | Get relative motion matrix for a transition as list of lists. |
def getSecurityMarginMatrixForTransition(self, arg2: Transition) -> list | Get security margin matrix for a transition as list of lists. |
def getState(self, arg2: str) -> State | Return the state with the given name. |
def getStateFromConfiguration(self, arg2: numpy.ndarray) -> str | Get the name of the state corresponding to the configuration. |
def getStateNames(self) -> list | Return a list of state names. |
def getStates(self) -> list | Return a list of all states in the constraint graph. |
def getTransition(self, arg2: str) -> Transition | Return the transition with the given name. |
def getTransitionNames(self) -> list | Return a list of transition names. |
def getTransitions(self) -> list | Return a list of all transitions in the constraint graph. |
def getWeight(self, arg2: Transition) -> int | Get weight of a transition. |
def initialize(self) -> None | Initialize the graph. Performs final initialization of the constraint graph. |
def isShort(self, arg2: Transition) -> bool | Check if a transition is short. |
| Get maximal number of iterations in config projector. |
def registerConstraints(self, arg2: pyhpp.constraints.bindings.Implicit, arg3: pyhpp.constraints.bindings.Implicit, arg4: pyhpp.constraints.bindings.Implicit) -> None | Register constraints in the graph. |
def removeCollisionPairFromTransition(self, arg2: Transition, arg3: str, arg4: str) -> None | Remove collision pairs from a transition. |
def resetConstraints(self, arg2: State) -> None | Reset constraints of a state. |
def setContainingNode(self, arg2: Transition, arg3: State) -> None | Set in which state a transition is. Paths satisfying the transition constraints satisfy the state constraints. |
def setSecurityMarginForTransition(self, arg2: Transition, arg3: str, arg4: str, arg5: float) -> None | Set collision security margin for a pair of joints along a transition. |
def setShort(self, arg2: Transition, arg3: bool) -> None | Set that a transition is short. When a transition is tagged as short, extension along this transition is done differently in RRT-like algorithms. Instead of projecting a random configuration in the destination state, the configuration to extend itself is projected in the destination state. This makes the rate of success higher. |
def setTargetNodeList(self, arg2: list) -> None | Set the target state list for guided state selection. |
def setWaypoint(self, arg2: Transition, arg3: pyhpp.core.path.bindings.SplineB3, arg4: Transition, arg5: State) -> None | Set waypoint configuration for a waypoint transition. Configures which edge and state to use at the specified waypoint index. |
def setWeight(self, arg2: Transition, arg3: pyhpp.core.path.bindings.SplineB3) -> None | Set weight of a transition. You cannot set weight for waypoint transitions. |
| Return the transition used at a given parameter on a path (static method). |
| The robot device of the constraint graph. |
GraphSteeringMethod
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.SteeringMethod) -> None |
Handle
Frame attached to an object that is aimed at being grasped
Together with a hpp::pinocchio::Gripper, a handle defines a grasp. A vector of 6 Boolean values called a mask can be passed to the constructor to define the symmetries of the handle. For example, {True,True,True,False,True,True} means that the handle can be grasped with free orientation around x-axis. See https://hal.laas.fr/hal-02995125v2 for details. The setter method mask allows users to define the mask.
Along motions where the handle is grasped by a gripper, an additional constraint is enforced, called the complement constraint. This latter constraint ensures that the object is rigidly fixed to the gripper.
However, for some applications, the complement constraint can be customized using setter maskComp. Note that calling setter method mask reinitializes the mask complement.
| def | Description |
|---|---|
def createGrasp(self, gripper: pyhpp.pinocchio.bindings.Gripper, name: str) -> pyhpp.constraints.bindings.Implicit | gripper — object containing the gripper information |
def createGraspAndComplement(self, gripper: pyhpp.pinocchio.bindings.Gripper, name: str) -> pyhpp.constraints.bindings.Implicit | gripper — object containing the gripper information |
def createGraspComplement(self, gripper: pyhpp.pinocchio.bindings.Gripper, name: str) -> pyhpp.constraints.bindings.Implicit | gripper — object containing the gripper information |
def createPreGrasp(self, gripper: pyhpp.pinocchio.bindings.Gripper, shift: float, name: str) -> pyhpp.constraints.bindings.Implicit | gripper — object containing the gripper information |
def getParentJointId(self) -> int | Get index of the joint the handle is attached to in pinocchio Model |
| Approaching direction for pregrasp (unit vector in handle frame, default is x-axis). |
| Distance from the center of the gripper along x-axis that ensures no collision. Also gives an order of magnitude of the gripper size. |
| Local position of the handle in the joint frame. |
| Constraint mask: vector<bool> of size 6 defining the symmetries of the handle. See Handle class documentation for details. |
| Mask of the complement constraint. |
| Name of the handle. |
HandleMap
| def | Description |
|---|---|
def contains(self, arg2: object) -> bool | |
def delitem(self, key: str) -> None | |
def getitem(self, key: str) -> Handle | |
def init(self) -> None | |
def iter(self) -> typing.Iterator[str] | |
def len(self) -> int | |
def setitem(self, key: str, value: Handle) -> None |
ManipulationPlanner
Inherits: pyhpp.core.bindings.PathPlanner
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.Problem) -> None |
Problem
Inherits: pyhpp.core.bindings.Problem
| def | Description |
|---|---|
def init(self, arg2: Device) -> None | |
def checkProblem(self) -> None | Check whether the problem is well formulated. |
| Get the graph of constraints. |
def fullSteeringMethod(self, arg2: pyhpp.core.bindings.SteeringMethod) -> None | Set the problem steering method directly. Unlike steeringMethod, this does not wrap the given steering method in a manipulation graph steering method. |
| Get the inner steering method (unwrapped from the graph steering method if applicable). |
RandomShortcut
Inherits: pyhpp.core.bindings.PathOptimizer
| def | Description |
|---|---|
def init(self, arg2: object) -> object |
SplineGradientBased_bezier1
Inherits: pyhpp.core.bindings.PathOptimizer
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.Problem) -> object | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
SplineGradientBased_bezier3
Inherits: pyhpp.core.bindings.PathOptimizer
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.Problem) -> object | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
State
State of an end-effector.
States of the graph of constraints. There is one graph for each end-effector.
| def | Description |
|---|---|
def configConstraint(self) -> pyhpp.core.bindings.ConstraintSet | |
def id(self) -> int | Return the component id. |
def name(self) -> str | Get the component name. |
def neighborEdges(self) -> list | Get the list of edges connected to this state. |
StatesPathFinder
Inherits: pyhpp.core.bindings.PathPlanner
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.Problem) -> None |
Transition
Transition between two states of a constraint graph
An edge stores two types of constraints.
Path constraints should be safisfied by paths belonging to the edge. Along any path, the right hand side of the constraint is constant, but can differ between paths. For instance if an edge represents a transit path of a robot that can grasp an object, the right hand side of the constraint represents the position of the object. Along any transit path, the object does not move, but for different paths the object can be at different positions. method pathConstraint.
Configuration constraints are constraints that configurations in the destination state should satisfy and the constraints that paths should satisfy. For instance, if the edge links a state where the robot does not hold the object to a state where the robot holds the object, the configuration constraints represent a fixed relative position of the object with respect to the gripper and a stable position of the object. Configuration constraints are necessary to generate a configuration in the destination state of the edge that is reachable from a given configuration in the start state by an admissible path.
| def | Description |
|---|---|
def id(self) -> int | Return the component id. |
def isWaypointTransition(self) -> bool | Error — Could not find member (.*) isWaypointEdge of class hpp::manipulation::graph::Edge |
def name(self) -> str | Get the component name. |
| Error — Could not find member (.*) nbWaypoints of class hpp::manipulation::graph::Edge |
def pathValidation(self) -> pyhpp.core.bindings.PathValidation | Get path validation associated to the edge. |
def waypoint(self, arg2: pyhpp.core.path.bindings.SplineB3) -> Transition | Error — Could not find member (.*) waypoint of class hpp::manipulation::graph::Edge |
TransitionPlanner
Inherits: pyhpp.core.bindings.PathPlanner
Plan paths in a leaf of a transition
In many manipulation applications, the sequence of actions is knwown in advance or computed by a task planner. There is a need then to connect configurations that lie on the same leaf of a transition. This class performs this computation.
The constraint graph is stored in the Problem instance of the planner. To select the transition, call method setEdge with the index of the transition.
At construction, a core::Problem instance is created, as well as a core::PathPlanner instance. They are respectively called the inner problem and the inner planner.
In order to take into account security margins, when selecting a transition, the list of configuration validations passed to the inner problem are
the PathValidation instance of the transition, cast into core::ConfigValidation type
a core::JointBoundValidation instance.
The leaf of the transition is defined by the initial configuration passed to method planPath . The right hand side of the inner problem constraints is initialized with this configuration.
The class stores path optimizers that are called when invoking method optimizePath .
Method timeParameterization computes a time parameterization of a given path.
| def | Description |
|---|---|
def init(self, arg2: pyhpp.core.bindings.Problem) -> None | |
def addPathOptimizer(self, pathOptimizer: pyhpp.core.bindings.PathOptimizer) -> None | |
def clearPathOptimizers(self) -> None | Clear path optimizers. |
def computePath(self, arg2: numpy.ndarray, arg3: numpy.ndarray, self_: bool) -> pyhpp.core.path.bindings.Vector | |
def directPath(self, arg2: numpy.ndarray, arg3: numpy.ndarray, arg4: bool) -> tuple | Compute a direct path on a transition. Returns (success, path, status). |
| Get the inner planner. |
def innerProblem(self) -> pyhpp.core.bindings.Problem | Get the inner problem. |
def optimizePath(self, path: pyhpp.core.bindings.Path) -> pyhpp.core.path.bindings.Vector | :param :input path |
def pathProjector(self, pathProjector: pyhpp.core.bindings.PathProjector) -> None | Set the path projector. |
def planPath(self, qInit: numpy.ndarray, qGoals: numpy.ndarray, resetRoadmap: bool) -> pyhpp.core.path.bindings.Vector | qInit — initial configuration, :param qGoals goal:configurations, resetRoadmap — whether to reset the roadmap |
def setEdge(self, id: Transition) -> None | id — index of the transition in the constraint graph |
def setReedsAndSheppSteeringMethod(self, turningRadius: float) -> None | Create a Reeds and Shepp steering method and path it to the problem. |
def setTransition(self, id: Transition) -> None | id — index of the transition in the constraint graph |
def timeParameterization(self, path: pyhpp.core.path.bindings.Vector) -> pyhpp.core.path.bindings.Vector | :param :input path |
def validateConfiguration(self, arg2: numpy.ndarray, arg3: int) -> tuple | Validate configuration against the graph state identified by id. Returns (valid, report). |
map_indexing_suite_HandleMap_entry
| def | Description |
|---|---|
def init(self) -> None | |
def repr(self) -> object | |
def data(self) -> Handle | |
def key(self) -> str |
modelsInfo
| def | Description |
|---|---|
def init(self) -> None | |
| |
| |
| |
|
modelsInfoVec
| def | Description |
|---|---|
def contains(self, arg2: object) -> bool | |
def delitem(self, arg2: object) -> None | |
def getitem(self, arg2: object) -> object | |
def init(self) -> None | |
def iter(self) -> object | |
def len(self) -> int | |
def setitem(self, arg2: object, arg3: object) -> None | |
def append(self, arg2: object) -> None | |
def extend(self, arg2: object) -> None |