kmk
kmk is a utility repo for authoring and consuming keypoint-based multi-fingered hand kinematics data.
It has two main jobs:
- a staged GUI wizard that builds a hand config YAML
- runtime loaders and torch kinematics utilities that read that YAML
What This Repo Provides
gripper_config_wizard- staged authoring flow for:
- global hand config
- per-link contact anchors
- grasp templates
- final preview/confirmation
- staged authoring flow for:
HandInfo- read-only runtime wrapper around the authored YAML
PointedHandInfoHandInfoplus precomputed surface/contact point samples
HandKinematics- torch forward kinematics for batched joint vectors and link-local point sets
User Workflow
- Prepare a gripper root directory containing at least a URDF.
- Run the wizard.
- Fill the global stage.
- palm pose
- palm points delta
- global
q_open - extra collision ignore pairs
- Fill the keypoint stage.
- one contact anchor per link
- point, radius, tags
- Fill the grasp template stage.
q_open,q_closegrasp_target_point- active contact anchors
- Check the final preview and press
Confirmed. - Use the saved YAML through
HandInfo,PointedHandInfo, orHandKinematics.
Install
uv sync
Wizard
Create a new config:
uv run gripper_config_wizard --gripper-root /path/to/gripper_root
Edit an existing config:
uv run gripper_config_wizard \
--gripper-root /path/to/gripper_root \
--from-config existing.yaml
Notes:
--from-configrelative paths are resolved fromgripper_root.urdf_pathandxml_pathstored in YAML are typically relative paths.
Visualization
Inspect a saved config and sampled points:
uv run python visualize/pointed_hand_info.py --config-path /path/to/hand.yaml
Inspect batched torch kinematics:
uv run python visualize/hand_kinematics_batch.py --config-path /path/to/hand.yaml
Runtime API
HandInfo
from kmk import HandInfo
hand = HandInfo.from_config("hand.yaml")
q_open = hand.get_q_open()
q_close = hand.get_q_close("finger4_shallow")
palm_pose = hand.get_palm_pose()
anchor = hand.get_contact_anchor_by_link("right_1thumb_distal")
anchors = hand.get_contact_anchor_by_template("finger4_shallow")
target = hand.get_grasp_target_point("finger4_shallow")
Main API:
HandInfo.from_config(config_path)joint_ordertemplate_namescontact_anchor_linksget_q_open(template="global")get_q_close(template_name)get_palm_pose()get_contact_anchor_by_link(link_name)get_contact_anchor_by_tag(includes=(), excludes=())get_contact_anchor_by_template(template_name)get_grasp_target_point(template_name)
PointedHandInfo
from kmk import PointedHandInfo
hand = PointedHandInfo.from_config("hand.yaml", seed=0)
surface_points = hand.surface_points
contact_points = hand.get_contact_points("finger4_shallow")
keypoints = hand.get_keypoints("finger4_shallow", palm_aligned_points=True)
Main additions:
surface_pointscontact_pointsget_contact_points(template_name=None)get_keypoints(template_name=None, palm_aligned_points=True, palm_points_delta=...)
HandKinematics
import torch
from kmk import HandInfo, HandKinematics
hand = HandInfo.from_config("hand.yaml")
kin = HandKinematics(hand).to(device="cpu")
q = torch.zeros(16, len(hand.joint_order))
fk = kin.forward_kinematics(q)
world_points = kin.transform_link_points(
q,
{"right_1thumb_distal": torch.tensor([[0.0, 0.0, 0.02]])},
)
Main API:
HandKinematics(hand_info_or_config_path)joint_orderlink_namesdofforward_kinematics(q)transform_link_points(q, points_by_link)get_palm_pose(batch_shape=None)
Config Schema
The detailed spec lives in SPEC.md.
Metadata
Release files for kmk 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kmk-0.1.2.tar.gz | 33.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kmk-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.2 kB
Release files / kmk-0.1.2.tar.gz
| Download URL | kmk-0.1.2.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71b364bccddb655d322bd7d7749994a9c8adcd4c3fe1755e883b853f7f223b91
|
|
BLAKE2b-256 checksum How to use checksums |
04a294b31ac7c3c754788894afe74deb96cc62ebc37c2fc897d433c2941f18f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kmk-0.1.2-py3-none-any.whl
| Download URL | kmk-0.1.2-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d177d07e763667ab7d0481b97ed37716f57f5907ed72b3162da52c9b44388eb1
|
|
BLAKE2b-256 checksum How to use checksums |
91668608efcc0b7fc6e449862f6f22001121fd99312c41a70a444fb8995821ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|