kendama_simulate — DRIVE kendama op

• Data kinds: table → table

• Call: import fullseye as fs; fs.ledger.kendama_simulate(kp: 'dict', handle, *, p0, v0, t_end: 'float', dt: 'float' = 0.001, perceive=None, catch_plan=None, g: 'float' = None, v_max: 'float' = 2.0, a_max: 'float' = 20.0, v_rel_max: 'float' = 1.0, plan_from: 'float' = 0.0, stop_on_miss: 'bool' = True, contact=None, contact_tol: 'float' = 0.0005) -> 'dict' (to call the implementation directly, import kendama; kendama.kendama_simulate(kp: 'dict', handle, *, p0, v0, t_end: 'float', dt: 'float' = 0.001, perceive=None, catch_plan=None, g: 'float' = None, v_max: 'float' = 2.0, a_max: 'float' = 20.0, v_rel_max: 'float' = 1.0, plan_from: 'float' = 0.0, stop_on_miss: 'bool' = True, contact=None, contact_tol: 'float' = 0.0005) -> 'dict'; from the registry, opsdrive.get("kendama_simulate"))

Usage

2-phase kendama simulation: while the string is taut, the ball is tied to the pivot (the string hole of the cross-piece = hand + kp["tie_offset"]) (projection method, the same as ballistics.tether_simulate: with a fixed pivot in vacuum the trajectory is identical; string length = kp["pendulum_length"]); once slack, free fall (gravity + drag, kp["bp"]; rho = 0 for vacuum). Every step, kendama_catch_check (big cup = hand + kp["cup_offset"], axis kp["cup_axis"]) judges the catch, and the simulation ends once caught.

> The detailed description below is the original text — the summary and the headings are translated.

handle = 手元(皿胴の中心)の (3,) の固定点か t → (3,) の関数(開ループの振り上げ)。catch_plan があれば、弛んだ後(かつ t ≥ plan_from: 振り上げが終わるまでは開ループを優先する)は毎 step perceive で知覚した (p̂, v̂) を catch_plan(t, p̂, v̂, cup_state) → {"target": 大皿の縁の中心の目標 (3,), …} に渡し、手元を速さ ≤ v_max・加速度 ≤ a_max の bang-bang で「目標 − cup_offset」へ運ぶ(手元が動くと支点も動くので、玉が落ちてきて |p − 支点| = L になれば再び張る)。

知覚 perceive:

• None → 真値 (p, v)。

• perceive(t, p, v) → (p̂, v̂)(noisy_perceiver など)は計画が生きている step だけ呼ぶ。

• 属性 observe_all = True の知覚(kendamaworld.camera_perceiver)は 毎 step perceive(t, p, v, scene) で呼ぶ(scene = {"t", "hand", "tie", "cup", "cup_axis", "taut"} = 手元の自己受容で分かる量 + 世界を描くための taut (玉の姿勢の描画の約束: 張っている間は糸穴が結び目を向き、弛んだら最後の姿勢のまま)。p も世界を描くためだけに渡す)。返り値が None なら計画はそのまま(最後の目標へ運び続け、目標が無ければ手元を止める)。

玉を動かすのは重力(+ 抗力、rho > 0 のとき)とひもの張力(≥ 0 の片側拘束)だけ。けんは玉を押さない: contact(hand, p) → 隙間 [m] (kendamaworld.kendama_clearance など)を渡すと、捕球の前に隙間 < −contact_tol になった step で "hit_ken" として終わる(けん先・皿の縁・皿胴に玉が触れた = 失敗)。捕球は kp["catch_window"](玉が縁に触れた高さ)で判定する。

終わり方 end_reason: "caught"(捕球)、"hit_ken"(けん玉に触れた)、"missed"(弛んだ後、下向きに落ちながら大皿の面より 2 r_b 以上下に来た。stop_on_miss=False なら止めない: snap の門に使う)、"timeout"(t_end)。返り値 {"t", "p", "v", "hand", "anchor" (= 支点 = 糸穴), "cup", "cup_v", "taut", "tension", "energy", "snap_times", "snap_loss", "slack_t", "caught", "catch_t", "end_reason", "lateral", "plan_log", "n_estimates", "stage", "min_gap"}(配列は終わった step まで。stage = 各 step の制御の段階 ("lift" 振り上げ / "wait" 弛んだが計画前 / 計画の "stage"(hold / carry / absorb)or "plan")。slack_t = ひもが張った後で初めて弛んだ時刻、初めから弛んでいれば 0.0、一度も弛まなければ None。energy = ½mv² + mgz。n_estimates = 計画に渡した知覚の数)。初期状態が |p₀ − 支点(0)| > L、t_end < 0、dt ≤ 0、上限 ≤ 0 は ValueError。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_kendama — py -3.11 examples/poc_kendama.py

Ops the type connects to (they accept table as input)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

Same category (kendama)

kendama_params · elliptic_k_agm · pendulum_period_exact · pendulum_launch_speed · pendulum_rod_simulate · tether_tension_fixed · tether_slack_angle · swing_up_plan


*Provenance: kendama.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.