klampt.plan.kinetrajopt.trajopt_task_space module¶
Defines task space constraints for use in
KineTrajOpt
.
Classes:
|
Constraints to keep one direction up |
|
Keeps a link at some orientation |
|
Yet another way to impose pose constraint from the moment perspective |
|
To constrain the position of a link local position |
Functions:
|
Compute the derivative of rotation vector given the value, rotation, and angular velocity |
|
|
|
|
|
-
class
klampt.plan.kinetrajopt.trajopt_task_space.
DirectionConstraint
(wrobot: klampt.plan.kinetrajopt.utils.MaskedRobot, linkid: int, lcl_dir=[0, 0, 1], world_dir=[0, 0, 1])[source]¶ Bases:
klampt.plan.kinetrajopt.utils.ConstrInterface
Constraints to keep one direction up
Methods:
compute
(x[, grad_level])Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
-
compute
(x, grad_level=0)[source]¶ Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
- Parameters
x (ndarray) – the point to be evaluated
grad_level (int, optional) – which level of gradient is computed. Defaults to 0.
- Returns
The constraint value and optional derivatives, structured as follows:
If grad_level == 0, it returns a 1-D ndarray of g(x)
If grad_level == 1, it also returns a 2-D ndarray giving the constraint Jacobian d/dx g(x).
- Return type
tuple
-
-
klampt.plan.kinetrajopt.trajopt_task_space.
MomentDerivative
(m, R, z)[source]¶ Compute the derivative of rotation vector given the value, rotation, and angular velocity
- Parameters
m (arr) – the rotation vector
R (arr) – the rotation matrix
z (arr) – the angular velocity
- Returns
the dereivative
- Return type
dm ([arr])
-
class
klampt.plan.kinetrajopt.trajopt_task_space.
OrientationConstraint
(robot: klampt.plan.kinetrajopt.utils.MaskedRobot, linkid: int, R)[source]¶ Bases:
klampt.plan.kinetrajopt.utils.ConstrInterface
Keeps a link at some orientation
Methods:
compute
(x[, grad_level])Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
-
compute
(x, grad_level=0)[source]¶ Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
- Parameters
x (ndarray) – the point to be evaluated
grad_level (int, optional) – which level of gradient is computed. Defaults to 0.
- Returns
The constraint value and optional derivatives, structured as follows:
If grad_level == 0, it returns a 1-D ndarray of g(x)
If grad_level == 1, it also returns a 2-D ndarray giving the constraint Jacobian d/dx g(x).
- Return type
tuple
-
-
class
klampt.plan.kinetrajopt.trajopt_task_space.
PoseConstraint
(wrobot: klampt.plan.kinetrajopt.utils.MaskedRobot, linkid: int, target_pose)[source]¶ Bases:
klampt.plan.kinetrajopt.utils.ConstrInterface
Yet another way to impose pose constraint from the moment perspective
Methods:
compute
(x[, grad_level])Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
-
compute
(x, grad_level=0)[source]¶ Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
- Parameters
x (ndarray) – the point to be evaluated
grad_level (int, optional) – which level of gradient is computed. Defaults to 0.
- Returns
The constraint value and optional derivatives, structured as follows:
If grad_level == 0, it returns a 1-D ndarray of g(x)
If grad_level == 1, it also returns a 2-D ndarray giving the constraint Jacobian d/dx g(x).
- Return type
tuple
-
-
class
klampt.plan.kinetrajopt.trajopt_task_space.
PositionConstraint
(wrobot: klampt.plan.kinetrajopt.utils.MaskedRobot, linkid: int, lcl_pos: list, world_pos: list)[source]¶ Bases:
klampt.plan.kinetrajopt.utils.ConstrInterface
To constrain the position of a link local position
Methods:
compute
(x[, grad_level])Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
-
compute
(x, grad_level=0)[source]¶ Evaluates the constraint function and possibly (determining on grad_level) the Jacobian.
- Parameters
x (ndarray) – the point to be evaluated
grad_level (int, optional) – which level of gradient is computed. Defaults to 0.
- Returns
The constraint value and optional derivatives, structured as follows:
If grad_level == 0, it returns a 1-D ndarray of g(x)
If grad_level == 1, it also returns a 2-D ndarray giving the constraint Jacobian d/dx g(x).
- Return type
tuple
-