Skip to content

feat: 末端 IK 编辑、同屏叠显视口、关键帧剪贴板与时间轴曲线联动 - #4

Open
fandesfyf wants to merge 33 commits into
cyoahs:mainfrom
fandesfyf:fandes/contrib/upstream-pr
Open

feat: 末端 IK 编辑、同屏叠显视口、关键帧剪贴板与时间轴曲线联动#4
fandesfyf wants to merge 33 commits into
cyoahs:mainfrom
fandesfyf:fandes/contrib/upstream-pr

Conversation

@fandesfyf

@fandesfyf fandesfyf commented Jun 5, 2026

Copy link
Copy Markdown

Summary

在现有浏览器端关键帧编辑器基础上,扩展了末端 IK 编辑、视口叠显/分屏、拖放导入、关键帧剪贴板与时间轴/曲线联动等能力,并补充了开发文档、使用说明、设计说明与 IK 集成测试。

本 PR 由 @fandesfyf 基于 main48ee549)开发,已恢复上游仓库的部署与链接信息(motion-editor.cyoahs.devwrangler.jsonc 中的 robot-motion-editor、应用内 GitHub 链接等),不包含 fork 专属描述。

Motivation

当前编辑器以关节空间与基座编辑为主,左右分屏对比占用横向空间,且缺少末端位姿直观编辑能力。本 PR 旨在:

  • 在同一 3D 视口中叠显参考轨迹与编辑结果,降低对比成本
  • 支持通过拖拽末端执行器进行 IK 求解,并自动写入关键帧
  • 改善关键帧与时间轴/曲线编辑的工作流效率

What's New

IK 末端编辑

  • 集成 closed-chain-ik,支持末端 Link 选择与位姿拖拽
  • 双 Gizmo 模式:姿态编辑时锁定位置;位置优先的软姿态权重策略
  • IK 调参面板:位置/姿态权重、迭代参数、可选求解日志与调试可视化
  • IkSolverService 重构:同步求解、运动学环路校验、单次求解流程
  • 新增 tests/ik-fk-loop-biped-s70-test.jsnpm run test:ik-fk

视口与可视化

  • 同屏叠显(默认):Ghost 参考模型,可调透明度/颜色
  • 左右分屏保留为可选项,支持相机同步
  • 视口工具栏:Ghost 显隐、播放倍率、布局切换等

数据导入

  • 支持 URDF 目录与 CSV 轨迹拖放加载(fileDropHandler.js

关键帧工作流

  • 复制 / 粘贴 / 删除(Ctrl+C / Ctrl+V / Delete)与右键菜单
  • 拖动关键帧改帧号,保留绝对位姿语义
  • 时间轴滚轮缩放、平移;工程 FPS 可在线编辑

曲线与时间轴

  • 点击关节名即可显示整段曲线(无需先有关键帧)
  • 按需绘制曲线与图例,降低大轨迹下的渲染开销
  • 曲线面板与时间轴 X 轴双向缩放/平移同步(timelineCurveViewSync.js

Documentation

  • 更新 README.md / README.en.md(含演示 GIF:docs/assets/demo/
  • 新增 DEVELOPMENT.md:本地开发、构建与 IK 测试说明
  • 更新 USAGE.md:视口模式、IK、曲线、快捷键等
  • 新增 docs/REQUIREMENTS-viewport-ik.md:视口与 IK 需求与设计说明

Dependencies

用途
closed-chain-ik 末端 IK 求解
linkedom(dev) IK FK 环路测试中的 URDF 解析

Compatibility Notes

  • 保留原有工程保存/加载、自动保存(Cookie + IndexedDB)、unitree/seed CSV 格式与残差关键帧体系
  • 默认视口由「左右分屏」改为「同屏叠显」,用户可在工具栏切回分屏
  • 无后端 API 变更;仍为纯前端本地处理

Demo

README 中已嵌入 GIF 预览:

  • IK 末端编辑:docs/assets/demo/end-effector-ik-edit.gif
  • 关节编辑:docs/assets/demo/joint-edit.gif
  • 视口设置:docs/assets/demo/viewport-settings.gif

Author

Contributed by fandes (@fandesfyf).

fandesfyf and others added 30 commits May 30, 2026 18:34
- Remove URDF success alert; add file drag-and-drop for URDF folder and CSV
- IK controls in HTML; async IK module load; end-effector 6-DOF curves in editor
- Fix viewport black screen (zero-size init, resize, render scissor reset)
Queue notifyUrdfReady when IK loads late; call onUrdfLoaded from cookie restore and panel ctor.
…n edits

Default IK to position+orientation, split translate/rotate controls, and
harden solver reference sync; add build-time hosting env for deploy info UI.
Add draggable config panel with pin-to-toolbar mirrors for display mode
and camera controls; rename toggle to 配置. Remove footprint envelope UI
from the page. Fix timeline info clipping and toolbar alignment; soften
IK drag-end reach warnings in endEffectorControls.
- Panel title IK末端编辑 / IK End-Effector; unified solver params with sliders
- Sidebar scroll; hide foot controls; default off IK debug log
- Joint reset adds keyframe; draggable timeline keyframes; 0.1x playback
Decode keyframes to absolute joint/base values at source frame and
re-encode residuals at the target frame so edits survive frame moves.
Add copy/paste/delete with internal clipboard, Ctrl+C/V/Del shortcuts,
right-click menu with shortcut hints, and draggable keyframe markers.
Stop auto-expanding the curve panel and rendering all curves on keyframe
changes; register EE curves hidden by default until toggled on.
Map timeline zoom/scroll to curve viewTransform and vice versa, with
loop suppression and shared reset on both panels.
Plot base trajectory when a joint is selected with no keyframes yet.
Add a top-right legend for the active curve name, color, and CSV baseline.
…on-ik-editor

Update name in Wrangler configuration file to match deployed Worker
Add upstream changelog with dates, Workers demo URL, and embedded
screen recordings. Update USAGE and the help modal for IK, keyframes,
drag-drop import, curve panel, and viewport features.
Use poster images with links to MP4 so demos preview on GitHub; remove ffmpeg/recording implementation notes.
Replace thumbnail links with video controls and poster images for GitHub README playback.
fandesfyf added 3 commits June 3, 2026 13:50
Remove MP4 and poster PNG assets; embed animated GIFs for GitHub and IDE inline preview.
Acknowledge the original browser keyframe editor project at the start of README.md and README.en.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant