【自动驾驶】Frenet坐标系与Cartesian坐标系(一)
阅读本篇博客之前,请先阅读之前的博客。(由于正文字数的限制,拆成了几篇博客来写。)
在Frenet坐标系下,经规划得到横向、纵向运动轨迹后,需要将其重新映射到全局笛卡尔坐标系,以供控制模块调用。
如图 所示, 受车辆运动学、动力学特性及道路环境 (避障) 限制, 车辆的实际行驶轨迹与参考线难以重合。
图中主要参数说明
首先, t ⃗ , n ⃗ \mathrm{\vec{t}}, \mathrm{\vec{n}} t,n 都是单位向量且有:
{ t ⃗ r = [ cos θ r , sin θ r ] T n ⃗ r = [ − sin θ r , cos θ r ] T t ⃗ x = [ cos θ x , sin θ x ] T n ⃗ x = [ − sin θ x , cos θ x ] T (1.4) \tag{1.4} \left\{ \begin{aligned} \vec{t}_{r} &=\left[\cos \theta_{r}, \sin \theta_{r}\right]^T \\ \vec{n}_{r} &=\left[-\sin \theta_{r}, \cos \theta_{r}\right]^T \\ \vec{t}_{x} &=\left[\cos \theta_{x}, \sin \theta_{x}\right]^T \\ \vec{n}_{x} &=\left[-\sin \theta_{x}, \cos \theta_{x}\right]^T \end{aligned} \right. ⎩⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎧trnrtxnx=[cosθr,sinθr]T=[−sinθr,cosθr]T=[cosθx,sinθx]T=[−sinθx,cosθx]T(1.4)
全局坐标系下
在全局坐标系下, 任意时刻 t t t 的车辆运动状态可以描述为 [ x ⃗ , θ x , κ x , v x , a x ] \left[\vec{x}, \theta_{x}, \kappa_{x}, v_{x}, a_{x}\right] [x,θx,κx,vx,ax]。
其中:
Frenet坐标系下
在 Frenet坐标系下, 车辆的运动状态可以描述为 [ s , s ˙ , s ¨ , d , d ˙ , d ¨ , d ′ , d ′ ′ ] \left[s, \dot{s}, \ddot{s}, d, \dot{d}, \ddot{d} , d^{\prime}, d^{\prime \prime}\right] [s,s˙,s¨,d,d˙,d¨,d′,d′′].
其中:
tips: x ˙ = d x d t \dot{x}=\frac{dx}{dt} x˙=dtdx, x ′ = d x d s x'=\frac{dx}{ds} x′=dsdx
已知 ( x , y , θ x , v x , a x , k x ) , ( s r , x r , y r , θ r , k r , k r ′ ) (x, y, \theta_x, v_x, a_x, k_x), (s_r, x_r, y_r, \theta_r, k_r, k_r') (x,y,θx,vx,ax,kx),(sr,xr,yr,θr,kr,kr′),求 [ s , s ˙ , s ¨ , d , d ˙ , d ¨ , d ′ , d ′ ′ ] \left[s, \dot{s}, \ddot{s}, d, \dot{d}, \ddot{d} , d^{\prime}, d^{\prime \prime}\right] [s,s˙,s¨,d,d˙,d¨,d′,d′′].
首先,找到曲线上离位置 ( x , y ) (x,y) (x,y)最近的参考点 r ⃗ = ( x r , y r ) \vec{r}=(x_{r}, y_{r}) r=(xr,yr)(即将位置 Q Q Q投影到参考线上的投影点 P P P),该参考点处的 s r s_r sr即为 ( x , y ) (x, y) (x,y)在Frenet坐标系下的 s s s。
x ⃗ \vec{x} x和 r ⃗ \vec{r} r分别为位置 Q Q Q与投影点 P P P在Cartesian坐标系下的向量,他们满足
x ⃗ = r ⃗ + d n r ⃗ (2.1) \tag{2.1} \vec{x}=\vec{r}+d \vec{n_{r}} x=r+dnr(2.1)
变换可得
d = ( x ⃗ − r ⃗ ) T ⋅ n r ⃗ = ∣ ∣ x ⃗ − r ⃗ ∣ ∣ 2 cos ( Δ θ − ( θ r + π 2 ) ) = ∣ ∣ x ⃗ − r ⃗ ∣ ∣ 2 sin ( Δ θ − θ r ) = ∣ ∣ x ⃗ − r ⃗ ∣ ∣ 2 ( sin Δ θ cos θ r − cos Δ θ sin θ r ) (2.2) \tag{2.2} \begin{aligned} d&=(\vec{x}-\vec{r})^{T}\cdot\vec{n_{r}}\\ &=||\vec{x}-\vec{r}||_{2}\cos(\Delta \theta-(\theta_{r}+\frac{\pi}{2}))\\ &=||\vec{x}-\vec{r}||_{2}\sin(\Delta \theta-\theta_{r})\\ &=||\vec{x}-\vec{r}||_{2}(\sin{\Delta \theta \cos{\theta_{r}}}-\cos{\Delta \theta}\sin{\theta_{r}}) \end{aligned} d=(x−r)T⋅nr=∣∣x−r∣∣2cos(Δθ−(θr+2π))=∣∣x−r∣∣2sin(Δθ−θr)=∣∣x−r∣∣2(sinΔθcosθr−cosΔθsinθr)(2.2)
上式中, Δ θ = θ x − θ r \Delta \theta=\theta_x-\theta_r Δθ=θx−θr为向量 x ⃗ − r ⃗ \vec{x}-\vec{r} x−r 的方向角度(即上图中的 Δ θ \Delta{\theta} Δθ), n ⃗ r \vec{n}_{r} nr为参考点 P P P的单位法向量, θ r + π 2 \theta_{r}+\frac{\pi}{2} θr+2π为单位向量 n ⃗ r \vec{n}_{r} nr的方向角度。
设 ∣ ∣ d ∣ ∣ ||d|| ∣∣d∣∣为车辆当前 位置 Q Q Q 与投影点 P P P 之间的距离
∣ ∣ d ∣ ∣ = ( x − x r ) 2 + ( y − y r ) 2 . (2.3) \tag{2.3} ||d||= \sqrt{\left(x-x_{r}\right)^{2}+\left(y-y_{r}\right)^{2}} . ∣∣d∣∣=(x−xr)2+(y−yr)2.(2.3)
在Frenet坐标系下,每个点到参考线上参考点的向量都与该参考点的法向量 n r ⃗ \vec{n_r} nr 同向或反向(即 d d d与 n r ⃗ \vec{n_{r}} nr在同一条线上),因此,
sin ( Δ θ ) cos ( θ r ) − cos ( Δ θ ) sin ( θ r ) = ± 1 (2.4) \tag{2.4} \sin \left(\Delta \theta\right) \cos \left(\theta_{r}\right)-\cos \left(\Delta \theta\right) \sin \left(\theta_{r}\right)=\pm1 sin(Δθ)cos(θr)−cos(Δθ)sin(θr)=±1(2.4)
因为 Δ θ \Delta \theta Δθ 为向量 x ⃗ − r ⃗ \vec{x}-\vec{r} x−r 的角度,因此,
sin ( Δ θ ) cos ( Δ θ ) = y − y r x − x r \frac{\sin \left(\Delta \theta\right)}{\cos \left(\Delta \theta\right)}=\frac{y-y_{r}}{x-x_{r}} cos(Δθ)sin(Δθ)=x−xry−yr
可以根据 ∣ ∣ d ∣ ∣ ||d|| ∣∣d∣∣ 来确定 d d d 的大小, ( y − \left(y-\right. (y− y r ) cos ( θ r ) − ( x − x r ) sin ( θ r ) \left.y_{r}\right) \cos \left(\theta_{r}\right)-\left(x-x_{r}\right) \sin \left(\theta_{r}\right) yr)cos(θr)−(x−xr)sin(θr) 的正负来确定 d d d 的正负号, ( y − \left(y-\right. (y− y r ) cos ( θ r ) − ( x − x r ) sin ( θ r ) > 0 \left.y_{r}\right) \cos \left(\theta_{r}\right)-\left(x-x_{r}\right) \sin \left(\theta_{r}\right)>0 yr)cos(θr)−(x−xr)sin(θr)>0, d d d 取正号,否则 d d d取负号。公式如下:
d = sign ( ( y − y r ) cos ( θ r ) − ( x − x r ) sin ( θ r ) ) ( x − x r ) 2 + ( y − y r ) 2 (2.5) \tag{2.5} d=\operatorname{sign}\left(\left(y-y_{r}\right) \cos \left(\theta_{r}\right)-\left(x-x_{r}\right) \sin \left(\theta_{r}\right)\right) \sqrt{\left(x-x_{r}\right)^{2}+\left(y-y_{r}\right)^{2}} d=sign((y−yr)cos(θr)−(x−xr)sin(θr))(x−xr)2+(y−yr)2(2.5)
至于为什么是 ( y − \left(y-\right. (y− y r ) cos ( θ r ) − ( x − x r ) sin ( θ r ) \left.y_{r}\right) \cos \left(\theta_{r}\right)-\left(x-x_{r}\right) \sin \left(\theta_{r}\right) yr)cos(θr)−(x−xr)sin(θr) 这一项来判断符号。很简单,因为 d = ( x − x r , y − y r ) d=(x-x_r,y-y_r) d=(x−xr,y−yr), n ⃗ r = [ − sin θ r , cos θ r ] T \vec{n}_{r} =\left[-\sin \theta_{r}, \cos \theta_{r}\right]^T nr=[−sinθr,cosθr]T,两者的夹角公式为 cos θ d n = ( y − y r ) cos ( θ r ) − ( x − x r ) sin ( θ r ) ( x − x r ) 2 + ( y − y r ) 2 \cos{\theta_{dn}}=\frac{\left(y-y_{r}\right) \cos \left(\theta_{r}\right)-\left(x-x_{r}\right) \sin \left(\theta_{r}\right)}{\sqrt{(x-x_r)^2+(y-y_r)^2}} cosθdn=(x−xr)2+(y−yr)2(y−yr)cos(θr)−(x−xr)sin(θr),显然由分子这一项判断。
令 t ⃗ x 、 n ⃗ x \vec{t}_{x} 、 \vec{n}_{x} tx、nx 为点 Q Q Q 处的正交单位向量; t ⃗ r 、 n ⃗ r \vec{t}_{r} 、 \vec{n}_{r} tr、nr 为 参考线在投影点 P P P 处的正交单位向量。
根据 v x v_x vx与 s ˙ \dot{s} s˙定义,因为 x ⃗ = ∣ ∣ x ⃗ ∣ ∣ t ⃗ x \vec{x}=||\vec{x}||\vec{t}_{x} x=∣∣x∣∣tx,所以
x ⃗ ˙ = d x ⃗ d t = d ∣ ∣ x ⃗ ∣ ∣ d t t ⃗ x = v x t x ⃗ \dot{\vec{x}}=\frac{d\vec{x}}{dt}=\frac{d||\vec{x}||}{dt}\vec{t}_{x}=v_x \vec{t_x} x˙=dtdx=dtd∣∣x∣∣tx=vxtx
同理可以推导出 r ⃗ ˙ = s ˙ t r ⃗ \dot{\vec{r}}=\dot{s}\vec{t_r} r˙=s˙tr.
综上,有
{ r ⃗ ˙ = s ˙ t r ⃗ x ⃗ ˙ = v x t x ⃗ (3.1) \tag{3.1} \left\{ \begin{aligned} \dot{\vec{r}}=\dot{s}\vec{t_r}\\ \dot{\vec{x}}=v_x \vec{t_x} \end{aligned} \right. {r˙=s˙trx˙=vxtx(3.1)
根据公式(2.2),横向速度 d ˙ \dot{d} d˙ 为
d ˙ = ( x ⃗ ˙ − r ⃗ ˙ ) T ⋅ n ⃗ r + ( x ⃗ − r ⃗ ) T ⋅ n ⃗ ˙ r = v x t x ⃗ T n ⃗ r − s ˙ t r ⃗ T n ⃗ r + d n r ⃗ T n ⃗ ˙ r (3.2) \tag{3.2} \begin{aligned} \dot{d}&=(\dot{\vec{x}}-\dot{\vec{r}})^{\mathrm{T}} \cdot \vec{n}_{r}+(\vec{x}-\vec{r})^{\mathrm{T}} \cdot \dot{\vec{n}}_{r}\\ &= v_{x} \vec{t_{x}}^{T} \vec{n}_{r}-\dot s \vec{t_{r}}^{T}\vec{n}_{r}+d\vec{n_{r}}^{T}\dot{\vec{n}}_{r}\\ \end{aligned} d˙=(x˙−r˙)T⋅nr+(x−r)T⋅n˙r=vxtxTnr−s˙trTnr+dnrTn˙r(3.2)
由Frenet公式(1.3),有
n r ⃗ ′ = d n r ⃗ d s = − κ r t r ⃗ (3.3) \tag{3.3} \vec{n_{r}}'=\frac{d\vec{n_{r}}}{ds}=-\kappa_{r}\vec{t_{r}} nr′=dsdnr=−κrtr(3.3)
于是有
n r ⃗ ˙ = d s d t d n r ⃗ d s = − κ r s ˙ t r ⃗ (3.4) \tag{3.4} \dot{\vec{n_{r}}}=\frac{ds}{dt}\frac{d\vec{n_{r}}}{ds}=-\kappa_{r}\dot{s}\vec{t_{r}} nr˙=dtdsdsdnr=−κrs˙tr(3.4)
代入公式(3.2)可得:
d ˙ = v x t x ⃗ T n ⃗ r − s ˙ t r ⃗ T n ⃗ r + d n r ⃗ T n ⃗ ˙ r = v x t x ⃗ T n ⃗ r − s ˙ t r ⃗ T n ⃗ r − d s ˙ κ r n r ⃗ T t ⃗ r (3.5) \tag{3.5} \begin{aligned} \dot{d} &= v_{x} \vec{t_{x}}^{T} \vec{n}_{r}-\dot s \vec{t_{r}}^{T}\vec{n}_{r}+d\vec{n_{r}}^{T}\dot{\vec{n}}_{r}\\ &=v_{x} \vec{t_{x}}^{T} \vec{n}_{r}-\dot s \vec{t_{r}}^{T}\vec{n}_{r}-d\dot s \kappa_r\vec{n_{r}}^{T}\vec{t}_{r}\\ \end{aligned} d˙=vxtxTnr−s˙trTnr+dnrTn˙r=vxtxTnr−s˙trTnr−ds˙κrnrTtr(3.5)
由于 n r ⃗ \vec{n_{r}} nr与 t r ⃗ \vec{t_{r}} tr正交, 可得
n r ⃗ T t r ⃗ = t r ⃗ T n r ⃗ = 0 (3.6) \tag{3.6} \vec{n_{r}}^{T}\vec{t_{r}}=\vec{t_{r}}^{T}\vec{n_{r}}=0 nrTtr=trTnr=0(3.6)
又因为
t x ⃗ T n r ⃗ = ∣ ∣ t x ⃗ T ∣ ∣ ⋅ ∣ ∣ n r ⃗ ∣ ∣ cos ( θ x − ( θ r + π 2 ) ) = cos ( θ x − θ r − π 2 ) = sin ( θ x − θ r ) = sin Δ θ (3.7) \tag{3.7} \vec{t_{x}}^{T}\vec{n_{r}}=||\vec{t_{x}}^{T}||\cdot||\vec{n_{r}}||\cos(\theta_x-(\theta_r+\frac{\pi}{2}))=\cos(\theta_{x}-\theta_{r}-\frac{\pi}{2})=\sin(\theta_{x}-\theta_{r})=\sin{\Delta \theta} txTnr=∣∣txT∣∣⋅∣∣nr∣∣cos(θx−(θr+2π))=cos(θx−θr−2π)=sin(θx−θr)=sinΔθ(3.7)
故公式(3.5)化简后, d ˙ \dot{d} d˙最终为
d ˙ = v x sin Δ θ (3.8) \tag{3.8} \dot d = v_x\sin{\Delta \theta} d˙=vxsinΔθ(3.8)
对公式(2.1)的 x ⃗ \vec{x} x两边对时间 t t t求导,结合公式(3.1)和(3.4)可得
x ⃗ ˙ = d d t ( r ⃗ + d ⋅ n ⃗ r ) ⇒ v x t ⃗ x = r ⃗ ˙ + d ˙ ⋅ n ⃗ r + d ⋅ n ⃗ r ˙ = s ˙ ( 1 − κ r d ) ⋅ t ⃗ r + d ˙ ⋅ n ⃗ r (4.1) \tag{4.1} \begin{aligned} \dot{\vec{x}}&=\frac{\mathrm{d}}{\mathrm{d} t}\left(\vec{r}+d \cdot \vec{n}_{r}\right)\\ \Rightarrow v_x\vec{t}_x&=\dot {\vec{r}}+\dot{d}\cdot \vec{n}_{r}+d\cdot \dot{\vec{n}_{r}}\\ &=\dot{s}\left(1-\kappa_{r} d\right) \cdot \vec{t}_r+\dot{d} \cdot \vec{n}_{r} \end{aligned} x˙⇒vxtx=dtd(r+d⋅nr)=r˙+d˙⋅nr+d⋅nr˙=s˙(1−κrd)⋅tr+d˙⋅nr(4.1)
公式(4.1)右乘 t ⃗ r \vec{t}_r tr,且由正交性质得到
v x t ⃗ x ⋅ t ⃗ r = s ˙ ( 1 − κ r d ) ⋅ t ⃗ r ⋅ t ⃗ r + d ˙ ⋅ n ⃗ r ⋅ t ⃗ r ⇓ v x cos ( θ x − θ r ) = s ˙ ( 1 − κ r d ) ⇓ v x cos ( Δ θ ) = s ˙ ( 1 − κ r d ) (4.2) \tag{4.2} \begin{aligned} v_x\vec{t}_x\cdot\vec{t}_r&=\dot{s}\left(1-\kappa_{r} d\right) \cdot \vec{t}_r\cdot\vec{t}_r+\dot{d} \cdot \vec{n}_{r} \cdot\vec{t}_r\\ &\Downarrow\\ v_x\cos(\theta_x-\theta_r)&=\dot{s}\left(1-\kappa_{r} d\right) \\ &\Downarrow\\ v_x\cos(\Delta \theta)&=\dot{s}\left(1-\kappa_{r} d\right) \end{aligned} vxtx⋅trvxcos(θx−θr)vxcos(Δθ)=s˙(1−κrd)⋅tr⋅tr+d˙⋅nr⋅tr⇓=s˙(1−κrd)⇓=s˙(1−κrd)(4.2)
故 s ˙ \dot{s} s˙为
s ˙ = v x cos Δ θ ( 1 − κ r d ) (4.3) \tag{4.3} \dot{s} =\frac{v_x\cos{\Delta \theta}}{\left(1-\kappa_{r} d\right) } s˙=(1−κrd)vxcosΔθ(4.3)
因为
d ′ = d d s ( d ) = d t d s d d t ( d ) = d ˙ s ˙ (5.1) \tag{5.1} d^{\prime}=\frac{\mathrm{d}}{\mathrm{d} s}(d)=\frac{\mathrm{d} t}{\mathrm{~d} s} \frac{\mathrm{d}}{\mathrm{d} t}(d)=\frac{\dot{d}}{\dot{s}} d′=dsd(d)= dsdtdtd(d)=s˙d˙(5.1)
将公式(3.8)和(4.3)分别求得的 d ˙ 和 s ˙ \dot{d}和\dot{s} d˙和s˙代入,化简后可得
d ′ = ( 1 − κ r d ) tan Δ θ (5.2) \tag{5.2} d^{\prime}=\left(1-\kappa_{r} d\right) \tan \Delta \theta d′=(1−κrd)tanΔθ(5.2)
由式(5.2) 可得
d ′ ′ = d d s ( d ′ ) = ( 1 − κ r d ) ′ tan Δ θ + ( 1 − κ r d ) ( tan Δ θ ) ′ = ( 1 − κ r d ) ′ tan Δ θ + ( 1 − κ r d ) ( Δ θ ) ′ cos 2 ( Δ θ ) (6.1) \tag{6.1} \begin{aligned} d^{\prime \prime}&=\frac{\mathrm{d}}{\mathrm{d} s}\left(d^{\prime}\right)\\ &=\left(1-\kappa_{r} d\right)^{'} \tan \Delta \theta+\left(1-\kappa_{r} d\right) (\tan \Delta \theta)^{'} \\ &=\left(1-\kappa_{r} d\right)^{'} \tan \Delta \theta+\left(1-\kappa_{r} d\right)\frac{(\Delta \theta)'}{\cos^2(\Delta \theta)} \\ \end{aligned} d′′=dsd(d′)=(1−κrd)′tanΔθ+(1−κrd)(tanΔθ)′=(1−κrd)′tanΔθ+(1−κrd)cos2(Δθ)(Δθ)′(6.1)
设 s x s_{x} sx为车辆当前轨迹 x ⃗ \vec{x} x的弧长,结合公式(4.3),有:
d ( ⋅ ) d s = d s x d t d t d s d ( ⋅ ) d s x = v x s ˙ d ( ⋅ ) d s x = 1 − κ r d cos Δ θ d ( ⋅ ) d s x (6.2) \tag{6.2} \frac{\mathrm{d}(\cdot)}{\mathrm{d}s}=\frac{\mathrm{d}s_{x}}{\mathrm{d}t}\frac{\mathrm{d}t}{\mathrm{d}s}\frac{\mathrm{d}(\cdot)}{\mathrm{d}s_{x}}=\frac{v_{x}}{\dot{s}}\frac{\mathrm{d}(\cdot)}{\mathrm{d}s_{x}}=\frac{1-\kappa_{r}d}{\cos{\Delta\theta}}\frac{\mathrm{d}(\cdot)}{\mathrm{d}s_{x}} dsd(⋅)=dtdsxdsdtdsxd(⋅)=s˙vxdsxd(⋅)=cosΔθ1−κrddsxd(⋅)(6.2)
又根据曲率的定义:
{ κ r = θ r ′ = d θ r d s κ x = θ x ′ = d θ x d s x (6.3) \tag{6.3} \left\{ \begin{aligned} \kappa_{r}=\theta_r^{'}=\frac{\mathrm{d}\theta_{r}}{\mathrm{d}s} \\ \kappa_{x}=\theta_{x}^{'}=\frac{\mathrm{d}\theta_{x}}{\mathrm{d}s_{x}} \end{aligned} \right. ⎩⎪⎪⎨⎪⎪⎧κr=θr′=dsdθrκx=θx′=dsxdθx(6.3)
注意到 Δ θ = θ x − θ r \Delta \theta=\theta_x-\theta_r Δθ=θx−θr,故结合公式(6.2)和(6.3)有
( Δ θ ) ′ = d d s ( θ x − θ r ) = d d s θ x − d d s θ r = d d s θ x − κ r = 1 − κ r d cos Δ θ d θ x d s x − κ r = κ x 1 − κ r d cos Δ θ − κ r (6.4) \tag{6.4} \begin{aligned} (\Delta\theta)'&=\frac{\mathrm{d}}{\mathrm{d}s}(\theta_x-\theta_r)\\ &=\frac{\mathrm{d}}{\mathrm{d}s}\theta_x-\frac{\mathrm{d}}{\mathrm{d}s}\theta_r\\ &=\frac{\mathrm{d}}{\mathrm{d}s}\theta_x-\kappa_{r}\\ &=\frac{1-\kappa_{r}d}{\cos{\Delta\theta}}\frac{\mathrm{d}\theta_x}{\mathrm{d}s_{x}}-\kappa_{r}\\ &=\kappa_x\frac{1-\kappa_{r}d}{\cos{\Delta\theta}}-\kappa_{r}\\ \end{aligned} (Δθ)′=dsd(θx−θr)=dsdθx−dsdθr=dsdθx−κr=cosΔθ1−κrddsxdθx−κr=κxcosΔθ1−κrd−κr(6.4)
对于 ( 1 − κ r d ) ′ \left(1-\kappa_{r} d\right)^{'} (1−κrd)′,有
( 1 − κ r d ) ′ = d d s ( − κ r d ) = − ( κ r ′ d + κ r d ′ ) (6.5) \tag{6.5} \begin{aligned} \left(1-\kappa_{r} d\right)^{'} &=\frac{\mathrm{d}}{\mathrm{d}s}(-\kappa_{r} d)\\ &=-(\kappa_{r}^{\prime} d+\kappa_{r} d^{\prime}) \end{aligned} (1−κrd)′=dsd(−κrd)=−(κr′d+κrd′)(6.5)
故公式(6.1)最终化简得
d ′ ′ = − ( κ r ′ d + κ r d ′ ) tan Δ θ + 1 − κ r d cos 2 Δ θ ( κ x 1 − κ r d cos Δ θ − κ r ) (6.6) \tag{6.6} \begin{aligned} d^{\prime \prime} &=-(\kappa_{r}^{\prime} d+\kappa_{r} d^{\prime}) \tan \Delta \theta+ \frac{1-\kappa_{r} d}{\cos ^{2} \Delta \theta}\left(\kappa_{x} \frac{1-\kappa_{r} d}{\cos \Delta \theta}-\kappa_{r}\right) \end{aligned} d′′=−(κr′d+κrd′)tanΔθ+cos2Δθ1−κrd(κxcosΔθ1−κrd−κr)(6.6)
因为 a x = v x ˙ = d v x d t a_x=\dot{v_x}=\frac{{\rm d}v_x}{{\rm d}t} ax=vx˙=dtdvx,故根据公式(4.3)以及公式(6.2)、(6.3)有
a x = d v x d t = d d t ( s ˙ ( 1 − k r d ) cos Δ θ ) = s ¨ 1 − k r d cos Δ θ + s ˙ d d t ( 1 − k r d cos Δ θ ) = s ¨ 1 − k r d cos Δ θ + s ˙ d s d t d d s ( 1 − k r d cos Δ θ ) = s ¨ 1 − k r d cos Δ θ + s ˙ 2 d d s ( 1 − k r d cos Δ θ ) = s ¨ 1 − k r d cos Δ θ + s ˙ 2 ( ( 1 − k r d ) ′ cos Δ θ − ( 1 − k r d ) ( cos Δ θ ) ′ ) ( cos Δ θ ) 2 ) = s ¨ 1 − k r d cos Δ θ + s ˙ 2 ( − ( k r ′ d + k r d ′ ) cos Δ θ + ( 1 − k r d ) sin ( Δ θ ) ( Δ θ ) ′ ( cos Δ θ ) 2 ) = s ¨ 1 − k r d cos Δ θ + s ˙ 2 cos Δ θ ( ( 1 − k r d ) tan Δ θ ( Δ θ ) ′ − ( k r ′ d + k r d ′ ) ) (7.1) \tag{7.1} \begin{aligned} a_{x} &=\frac{\mathrm{d} v_{x}}{\mathrm{d} t}\\ &=\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\dot{s}(1-k_{r} d)}{\cos \Delta \theta}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\dot{s}\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{1-k_{r} d}{\cos \Delta \theta}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\dot{s}\frac{\mathrm{d}s}{\mathrm{d}t}\frac{\mathrm{d}}{\mathrm{d}s}\left(\frac{1-k_{r} d}{\cos \Delta \theta}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\dot{s}^{2}\frac{\mathrm{d}}{\mathrm{d}s}\left(\frac{1-k_{r} d}{\cos \Delta \theta}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\dot{s}^{2}\left(\frac{(1-k_{r} d)^{'}\cos{\Delta\theta}-(1-k_{r} d)(\cos{\Delta\theta})^{'})}{(\cos{\Delta\theta)}^2}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\dot{s}^{2}\left(\frac{-(k_{r}^{'}d+k_rd^{'})}{\cos{\Delta\theta}}+\frac{(1-k_rd)\sin(\Delta\theta)(\Delta\theta)^{'}}{(\cos{\Delta\theta})^2}\right)\\ &=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\frac{\dot{s}^{2}}{\cos \Delta \theta}\left((1-k_r d)\tan{\Delta\theta}(\Delta\theta)^{'}-\left(k_{r}^{\prime} d+k_{r} d^{\prime}\right)\right) \\ \end{aligned} ax=dtdvx=dtd(cosΔθs˙(1−krd))=s¨cosΔθ1−krd+s˙dtd(cosΔθ1−krd)=s¨cosΔθ1−krd+s˙dtdsdsd(cosΔθ1−krd)=s¨cosΔθ1−krd+s˙2dsd(cosΔθ1−krd)=s¨cosΔθ1−krd+s˙2((cosΔθ)2(1−krd)′cosΔθ−(1−krd)(cosΔθ)′))=s¨cosΔθ1−krd+s˙2(cosΔθ−(kr′d+krd′)+(cosΔθ)2(1−krd)sin(Δθ)(Δθ)′)=s¨cosΔθ1−krd+cosΔθs˙2((1−krd)tanΔθ(Δθ)′−(kr′d+krd′))(7.1)
最后,将公式(5.2)和(6.4)代入,得
a x = s ¨ 1 − k r d cos Δ θ + s ˙ 2 cos Δ θ [ d ′ ( k x 1 − k r d cos Δ θ − k r ) − ( k r ′ d + k r d ′ ) ] (7.2) \tag{7.2} a_{x}=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\frac{\dot{s}^{2}}{\cos \Delta \theta}\left[d^{\prime}\left(k_{x} \frac{1-k_{r} d}{\cos \Delta \theta}-k_{r}\right)-\left(k_{r}^{\prime} d+k_{r} d^{\prime}\right)\right] ax=s¨cosΔθ1−krd+cosΔθs˙2[d′(kxcosΔθ1−krd−kr)−(kr′d+krd′)](7.2)
故 s ¨ 为 \ddot{s}为 s¨为
s ¨ = a x cos Δ θ − s ˙ 2 [ d ′ ( k x 1 − k r d cos Δ θ − k r ) − ( k r ′ d + k r d ′ ) ] 1 − k r d (7.3) \tag{7.3} \ddot{s}=\frac{a_{x} \cos \Delta \theta-\dot{s}^{2}\left[d^{\prime}\left(k_{x} \frac{1-k_{r} d}{\cos \Delta \theta}-k_{r}\right)-\left(k_{r}^{\prime} d+k_{r} d^{\prime}\right)\right]}{1-k_{r} d} s¨=1−krdaxcosΔθ−s˙2[d′(kxcosΔθ1−krd−kr)−(kr′d+krd′)](7.3)
根据公式(3.8),易得 d ¨ \ddot{d} d¨为
d ¨ = a x sin Δ θ (8.1) \tag{8.1} \ddot d = a_x\sin{\Delta \theta} d¨=axsinΔθ(8.1)
再将公式(7.2)得到的 a x a_x ax代入即可。
首先,作为参考系,投影点P点在笛卡尔坐标系下的坐标,角度,切向量角度以及曲率都已知,即 ( x r , y r ) , θ r , k r (x_r, y_r), θ_r,k_r (xr,yr),θr,kr。Frenet坐标系下, 车辆的运动状态 [ s , s ˙ , s ¨ , d , d ˙ , d ¨ , d ′ , d ′ ′ ] \left[s, \dot{s}, \ddot{s}, d, \dot{d}, \ddot{d} , d^{\prime}, d^{\prime \prime}\right] [s,s˙,s¨,d,d˙,d¨,d′,d′′]也已知。
先推 x ⃗ = ( x , y ) \vec{x}=(x,y) x=(x,y)。
显然,结合公式(1.4)有
x ⃗ = r ⃗ + d n r ⃗ ⇓ ( x , y ) = ( x r , y r ) + ( − d sin θ r , d cos θ r ) (10.1) \tag{10.1} \begin{aligned} \vec{x}&=\vec{r}+d \vec{n_{r}}\\ &\Downarrow\\ (x,y)&=(x_r,y_r)+(-d\sin{\theta_r},d\cos{\theta_r}) \end{aligned} x(x,y)=r+dnr⇓=(xr,yr)+(−dsinθr,dcosθr)(10.1)
故
{ x = x r − d sin ( θ r ) y = y r + d cos ( θ r ) (10.2) \tag{10.2} \left\{ \begin{aligned} x&= x_{r}-d\sin \left(\theta_{r}\right) \\ y&= y_{r}+d \cos \left(\theta_{r}\right) \\ \end{aligned} \right. {xy=xr−dsin(θr)=yr+dcos(θr)(10.2)
v x = d ∣ ∣ x ⃗ ∣ ∣ d t = ∣ ∣ d x ⃗ d t ∣ ∣ = ∣ ∣ x ⃗ ˙ ∣ ∣ = x ⃗ ˙ T x ⃗ ˙ (11.1) \tag{11.1} v_x=\frac{d||\vec{x}||}{dt}=||\frac{d\vec{x}}{dt}||=||\dot{\vec{x}}||=\sqrt{\dot{\vec{x}}^T\dot{\vec{x}}} vx=dtd∣∣x∣∣=∣∣dtdx∣∣=∣∣x˙∣∣=x˙Tx˙(11.1)
因为
x ⃗ ˙ = d ( r ⃗ + d n r ⃗ ) d t = r ⃗ ˙ + d ( d ) d t n r ⃗ + d d n r ⃗ d t = r ⃗ ˙ + d ( d ) d t n r ⃗ + d n ⃗ ˙ r (11.2) \tag{11.2} \dot{\vec{x}}=\frac{\mathrm{d}(\vec{r}+d \vec{n_{r}})}{\mathrm{d}t}=\dot{\vec{r}}+\frac{\mathrm{d}(d)}{\mathrm{d}t}\vec{n_{r}}+d\frac{\mathrm{d}\vec{n_{r}}}{\mathrm{d}t}=\dot{\vec{r}}+\frac{\mathrm{d}(d)}{\mathrm{d}t}\vec{n_{r}}+d\dot{\vec{n}}_r x˙=dtd(r+dnr)=r˙+dtd(d)nr+ddtdnr=r˙+dtd(d)nr+dn˙r(11.2)
结合公式(3.1)和公式(3.4),有
x ⃗ ˙ = s ˙ t ⃗ r + d ( d ) d t n r ⃗ − κ r s ˙ t ⃗ r = s ˙ ( 1 − κ r d ) t ⃗ r + d ˙ n r ⃗ (11.3) \tag{11.3} \dot{\vec{x}}=\dot{s}\vec{t}_r+\frac{\mathrm{d}(d)}{\mathrm{d}t}\vec{n_{r}}-\kappa_r\dot{s}\vec{t}_r=\dot{s}(1-\kappa_r d)\vec{t}_r+\dot{d}\vec{n_{r}} x˙=s˙tr+dtd(d)nr−κrs˙tr=s˙(1−κrd)tr+d˙nr(11.3)
将公式(11.3)代入公式(11.1),并且注意 t ⃗ r \vec{t}_r tr和 n ⃗ r \vec{n}_r nr是单位正交的,有:
v x = x ⃗ ˙ T x ⃗ ˙ = { s ˙ ( 1 − κ r d ) t ⃗ r + d ˙ n r ⃗ } T { s ˙ ( 1 − κ r d ) t ⃗ r + d ˙ n r ⃗ } = { s ˙ ( 1 − κ r d ) t ⃗ r T + d ˙ n r ⃗ T } { s ˙ ( 1 − κ r d ) t ⃗ r + d ˙ n r ⃗ } = s ˙ 2 ( 1 − κ r ) 2 + d ˙ 2 (11.4) \tag{11.4} \begin{aligned} v_x&=\sqrt{\dot{\vec{x}}^T\dot{\vec{x}}}\\ &=\sqrt{\{\dot{s}(1-\kappa_r d)\vec{t}_r+\dot{d}\vec{n_{r}}\}^T\{\dot{s}(1-\kappa_r d)\vec{t}_r+\dot{d}\vec{n_{r}}\}}\\ &=\sqrt{\{\dot{s}(1-\kappa_r d){\vec{t}_r}^T+\dot{d}{\vec{n_{r}}^T}\}\{\dot{s}(1-\kappa_r d)\vec{t}_r+\dot{d}\vec{n_{r}}\}}\\ &=\sqrt{\dot{s}^2(1-\kappa_r)^2+\dot{d}^2}\\ \end{aligned} vx=x˙Tx˙={s˙(1−κrd)tr+d˙nr}T{s˙(1−κrd)tr+d˙nr}={s˙(1−κrd)trT+d˙nrT}{s˙(1−κrd)tr+d˙nr}=s˙2(1−κr)2+d˙2(11.4)
故最终
v x = s ˙ 2 ( 1 − κ r ) 2 + d ˙ 2 = [ s ˙ ( 1 − k r d ) ] 2 + ( s ˙ d ′ ) 2 (11.5) \tag{11.5} \begin{aligned} v_x&=\sqrt{\dot{s}^2(1-\kappa_r)^2+\dot{d}^2}\\ &=\sqrt{\left[\dot{s}\left(1-k_{r} d\right)\right]^{2}+\left(\dot{s} d^{\prime}\right)^{2}} \end{aligned} vx=s˙2(1−κr)2+d˙2=[s˙(1−krd)]2+(s˙d′)2(11.5)
θ x \theta_x θx由公式(5.2)即得
θ x = arctan ( d ′ 1 − k r d ) + θ r (12.1) \tag{12.1} \theta_{x}= \arctan(\frac{d'}{1-k_r d})+\theta_r θx=arctan(1−krdd′)+θr(12.1)
a x a_x ax的求解过程已在前面的过程给出,即公式(7.2)
a x = s ¨ 1 − k r d cos Δ θ + s ˙ 2 cos Δ θ [ d ′ ( k x 1 − k r d cos Δ θ − k r ) − ( k r ′ d + k r d ′ ) ] (13.1) \tag{13.1} a_{x}=\ddot{s} \frac{1-k_{r} d}{\cos \Delta \theta}+\frac{\dot{s}^{2}}{\cos \Delta \theta}\left[d^{\prime}\left(k_{x} \frac{1-k_{r} d}{\cos \Delta \theta}-k_{r}\right)-\left(k_{r}^{\prime} d+k_{r} d^{\prime}\right)\right] ax=s¨cosΔθ1−krd+cosΔθs˙2[d