Sort Poses
SUMMARY
sort_poses sorts a list of poses by one or more positional axes (x, y, z), each ascending or descending.
UNITS
Sorting compares the raw x/y/z values of each pose, which are in meters. The rotation component is ignored.
The Skill
python
sorted_poses = tfutils.sort_poses(poses, by=["x", "y"], ascending=[True, False])Parameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
poses | list[list[float]] | required | Poses to sort, each [x, y, z, ...] in any rotation format. |
by | str | list[str] | "x" | Sort key(s), each one of "x", "y", "z". A list sorts by multiple keys, first element has the highest priority. |
ascending | bool | list[bool] | True | Sort direction. A single bool applies to every key in by, or a list gives one direction per key. |
Returns
| Type | Description |
|---|---|
list[list[float]] | A new list of poses, sorted. |
Raises
| Exception | Condition |
|---|---|
ValueError | ascending is a list whose length does not match by's. |
ValueError | A key in by is not one of "x", "y", "z". |