Simulation を作る
既存の robot や test fixture を Fibril Simulation へ載せる作業は、MuJoCo model を作り、Manifest で virtual hardware を構成し、validate と inspect で解決結果を確認する順に進めます。
最初から full robot を組み上げるより、必要な Component を一つずつ追加すると binding と timing の問題を切り分けやすくなります。
MuJoCo model を用意する
最初に physical plant と environment を MJCF で表します。
joint、geom、actuator、sensor、camera、site には、Manifest から参照する安定した name を付けます。
fixed timestep も MJCF の <option timestep="..."> で定義します。
model の root は通常の file path か package:// URI で指定できます。
package:// を使うと、ament package の install space に置いた model と nested include を logical URI のまま解決できます。
Manifest の骨格を作る
最小の Manifest は schema と model を持ちます。
MuJoCo model の option.timestep が Device、prescribed state、actuator application など runtime schedule が載る基準 grid になります。
必要な周期を決めてから timestep を選ぶと、strict schedule の不整合を避けやすくなります。
Model attachment を使う
独立した submodel を組み合わせる場合は MuJoCo の model asset と attach を使います。
Fibril 側に別の attachment schema はありません。
composition、namespace 適用、object name validation は MuJoCo compile に委ねます。
Component を追加する
virtual hardware は components に列挙します。
各 Component は instance-local な id、registered type、type 固有の config を持ちます。
motor servo を使う場合は、先に MJCF へ actuator semantics を定義します。
Component の object reference は compile 後の MuJoCo model に対して検証されます。 type ごとの required field と semantics は Component reference にまとめています。
Sensor fidelity を段階的に追加する
最初の test では latency、noise、bias、quantization をゼロにすると、geometry と binding の確認に集中できます。 物理モデルが正しいことを確認してから virtual hardware parameter を増やすと、model error と sensor model error を混同しにくくなります。
Prescribed object を置く
simulation 内で既知の pose または trajectory に従わせたい object は prescribed Component で表せます。 対象 body は MuJoCo mocap body として model 化します。
trajectory time は非負かつ狭義単調増加である必要があります。 keyframe 間は runtime が physics boundary 上で補間し、端点の外側では端の pose を保持します。
Extension を読み込む
標準 Component 以外の Component や domain semantics は SimulationExtension から追加できます。 Manifest では pluginlib class name と extension 固有の config を指定します。
extension は Plan construction 中に capability を宣言してから configure されます。 通常の simulation 利用者が framework 内部の runtime phase を直接組み立てる必要はありません。
validate と inspect を繰り返す
Component を追加するたびに validate を通します。
validate が成功しても MuJoCo compile warning が存在する場合は Plan に warning として保持されます。
inspect で resolved binding、schedule、Component、extension、provenance を確認してから test や長時間 run へ進みます。