- skbot.inverse_kinematics.ccd(pointA, pointB, frameA, frameB, cycle_links, *, metric=None, tol=0.001, maxiter=500, line_search_maxiter=500)¶
Cyclic Coordinate Descent.
This function will modify the passed-in frame graph as a side effect.
New in version 0.7.0.
This function adjusts the parameters of the links in
cycle_linkssuch that a point that has
pointAas its representation in
pointBas representation in
frameB. Parameters are fitted in a cyclical fashion, i.e., by repeatedly iterating over
cycle_links. Each time the respective link’s parameter is updated to minimize the distance between
pointA’s representation in
frameB. Distance is measured in frameB using euclidian distance or a custom metric if provided.
The representation of the point in frameA.
The desired representation of the point in frameB.
The frame in which pointA is represented.
The frame in which pointB is represented.
- cycle_links: List[joint]
A list of 1DoF joints which should be adjusted to make pointA and pointB valid representations of the same point.
A function that takes two points (expressed in frameB) and computs the distance between them. Its signature is
metric(transformed_point, pointB) -> distance. If None, the euclidian distance will be used.
Absolute tolerance for termination.
The maximum number of cycles to perform.
The maximum number of iterations to use when optimizing a single joint.
The final parameters of each joint.
Joint limits (min/max) are enforced as hard constraints.
The current implementation is a naive python implementation and not very optimized. PRs improving performance are welcome :)
- Return type