Skip to content

サーボ較正系MOD(setup_rs30x / calibration)が旧 _driver 直参照のまま動作しない #507

Description

@sskw-ugo

概要

PR #497 で Robot ファサードが StackchanContext capability に置き換わりましたが、較正系のサンプルMODが旧APIの生ドライバ直参照のまま残っており、実行時に undefined 参照でクラッシュします。

  • mods/examples/setup_rs30x/mod.js — robot._driver._pan 等を参照(8行目・16行目)。また button.a.onEvent の二重代入により先のハンドラが無効化される既存バグもあり
  • mods/examples/calibration/mod.js — context._driver を参照(36-37行目)

新しい MotionCapability(host/app/capabilities.ts)には旧 robot.ts の get driver() に相当する生ドライバへのアクセサがないため、単純な書き換え先が存在しません。

対応案

  1. MotionCapability に較正用途の監督下アクセサ(例: motion.calibration capability として offset調整・個別サーボ角の読み書きだけを公開)を追加する
  2. その上で setup_rs30x / calibration を新APIへ移行し、button 参照は optional chaining に統一する

関連

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions