simple_pure_pursuit
役割
simple_pure_pursuit は CSV 経路を追従し、/cmd_vel を生成します。FollowPath action の path_index で追従対象の経路を選びます。
Interface
種別 |
名前 |
型 / 内容 |
|---|---|---|
action server |
|
|
subscribe |
|
|
subscribe |
|
|
publish |
|
|
publish |
|
|
publish |
|
|
publish |
|
|
経路点
CSV の各点は、
です。現在 pose を \(x=(x_r,y_r,\theta_r)\) とします。
nearest と lookahead
nearest index は全探索です。
lookahead index は、\(i_n\) 以降で距離が lookahead_distance 以上になる最初の点です。
見つからない場合は終点 index を使います。
robot 座標への変換
map 座標の差分 \(d=(x_i-x_r,y_i-y_r)\) を robot 座標へ変換します。
lookahead 点へのベクトルを \(t_l\)、nearest 点へのベクトルを \(t_n\) とします。nearest 方向成分は、
です。制御目標方向は、
ここで \(k_y\) は lateral_gain です。
速度指令
並進速度は目標方向の正規化です。
角速度は yaw error に比例します。
ここで \(k_\theta\) は rotate_gain です。通常は nearest 点の yaw、lookahead が終点なら終点 yaw を使います。
終点に近いときは減速します。終点距離を \(d_g\)、stop_threshold を \(d_s\) とすると、
です。\(k_s\) は stop_gain です。
角速度は最大値で clamp します。
clamp が発生した場合は並進も縮小します。
goal 判定
終点 pose を \(g=(x_g,y_g,\theta_g)\) とすると、完了条件は次です。
両方を満たすと /cmd_vel を 0 にし、action を success にします。
設定ファイル
simple_pure_pursuit には専用 YAML はありません。rogi_nav.launch.py が profile と config_dir から parameter を組み立てます。
設定元 |
key / path |
対応 |
|---|---|---|
|
経路 CSV |
|
|
|
|
|
|
ノード起動の有効/無効 |
|
|
任意の ROS parameter 上書き |
経路 CSV は 1 行を次の pose として読みます。
x,y,theta
launch は固定で 12 本の trajectory を探します。
制御 parameter を profile で上書きする場合は、次のように parameters を追加します。
launch:
components:
pure_pursuit:
simple_pure_pursuit:
enabled: true
parameters:
path.follow.lookahead_distance: 0.5
path.follow.velocity.max_linear: 1.0
path.follow.velocity.max_angular: 3.0
path.follow.gain.rotate: 1.0
path.follow.gain.stop: 1.0
path.follow.gain.xy_scale_adjust: 1.0
path.follow.gain.lateral: 0.5
path.follow.threshold.stop: 0.1
path.follow.goal.dist_threshold: 0.01
path.follow.goal.yaw_threshold_deg: 57.3
現在の sample real.yaml / sim.yaml には parameters が無いため、上の値は実装 default が使われます。