# stop ## 役割 `stop` は `simple_pure_pursuit` の終点接近時に並進目標速度を生成し、停止完了を判定する `StopController` です。独立した ROS node ではなく、`rogi_control/stop/stop.hpp` を include して使用します。 停止方式は `path.follow.stop.mode` で選択します。 | mode | 概要 | 主に使う情報 | | --- | --- | --- | | `distance_interpolation` | 終点距離による速度補間 | 終点距離 | | `velocity_ff` | 制動距離から速度を先に決める速度 FF | 終点距離、最大減速度 | | `bang_bang` | 一定速度保持から終点への P 制御へ切り替える | 終点距離、切替後の経過時間 | 既定値は `distance_interpolation` です。mode は起動時に読み込まれ、存在しない文字列を指定すると node の初期化を失敗させます。 ## 記号 以降では次の記号を使います。 | 記号 | 意味 | 対応 parameter | | --- | --- | --- | | {math}`d_g` | 現在位置から経路終点までの距離 | ― | | {math}`d_s` | 選択した mode へ切り替える終点距離 | 各 mode の `switching_distance` | | {math}`d_{goal}` | 停止完了とみなす位置許容差 | `path.follow.goal.dist_threshold` | | {math}`d` | 速度計算に使う残り制動距離 | ― | | {math}`v_{max}` | 並進速度上限 | `path.follow.velocity.max_linear` | | {math}`v_k` | odometry から得た現在並進速度 | ― | | {math}`v_{cmd,k}` | 今回出力する並進目標速度 | ― | | {math}`\Delta t` | 制御周期 | `control_period_ms / 1000` | | {math}`a_{dec}` | 速度 FF の最大減速度の大きさ | `path.follow.stop.velocity_ff.max_deceleration` | `distance_interpolation` と `velocity_ff`、および未切替の `bang_bang` では、終点距離が切替距離以上なら pure pursuit の並進速度上限をそのまま返します。 ```{math} v_{cmd}=v_{max}\qquad(d_g\ge d_s) ``` {math}`d_g/config.yaml` に記述します。 ```yaml simple_pure_pursuit: ros__parameters: path: follow: stop: mode: bang_bang bang_bang: switching_distance: 1.0 hold_duration_sec: 0.5 hold_speed: 0.5 p_gain: 2.0 goal: dist_threshold: 0.01 yaw_threshold_deg: 1.0 linear_velocity_threshold: 0.05 angular_velocity_threshold: 0.05 control_period_ms: 10 ``` これは `example/test/config/control/real/config.yaml` の停止設定です。sample の既定方式は `distance_interpolation` です。test 実機設定の `max_linear` は `2.0 m/s`、モータ上限は `1000 rad/s` で、sample の `1.0 m/s`、`200 rad/s` とは異なります。表の default はノードの宣言値であり、example ごとの調整値ではありません。