Skip to content

Commit b1f9cfb

Browse files
committed
test
1 parent 93228bd commit b1f9cfb

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

docs/modules/6_path_tracking/pure_pursuit_tracking/pure_pursuit_tracking_main.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,104 @@ Pure pursuit tracking
44
Path tracking simulation with pure pursuit steering control and PID
55
speed control.
66

7+
.. raw:: latex
8+
\usepackage{tikz}
9+
\usetikzlibrary{shapes.misc, shadows, calc, positioning, backgrounds}
10+
\usepackage[margin=1cm]{geometry} % 调整页面边距
11+
12+
\begin{document}
13+
14+
\begin{figure}[htbp]
15+
\centering
16+
\begin{tikzpicture}[line width=1.7pt, scale=0.6, every node/.style={scale=0.6}] % 缩放图形
17+
18+
\pgfmathsetmacro{\dist}{3}
19+
\pgfmathsetmacro{\deltavar}{11.3}
20+
\pgfmathsetmacro{\ax}{tan(90-\deltavar)*\dist*(-1)}
21+
\pgfmathsetmacro{\lookahead}{12}
22+
\pgfmathsetmacro{\cs}{17}
23+
\pgfmathsetmacro{\csb}{4}
24+
25+
\path[clip] (-\cs,-\csb)--(-\cs,\cs)--(\cs,\cs)--(\cs, -\csb) --cycle;
26+
27+
% NODES
28+
\node(tire1)[draw=blue, thick, fill=white,
29+
shape=rounded rectangle,
30+
drop shadow={opacity=.5,shadow xshift=0pt},
31+
minimum width=1.8cm,
32+
minimum height=0.5cm,
33+
line width =2,
34+
rotate=90] at (0,0) {};
35+
36+
\node(tire2)[draw=blue, thick, fill=white,
37+
shape=rounded rectangle,
38+
drop shadow={opacity=.5,shadow xshift=0pt},
39+
minimum width=1.8cm,
40+
minimum height=0.5cm,
41+
line width =2,
42+
rotate=\deltavar-90] at (0,\dist) {};
43+
44+
\node(triangle_left) at (\ax,0){};
45+
46+
% TRIANGLE
47+
\draw[line width=2, color=blue] (tire1.center) -- (tire2.center);
48+
\draw[dashed] (triangle_left.center) -- (tire2.center);
49+
\draw[dashed] (triangle_left.center) -- (tire1.center);
50+
51+
% length R and L
52+
\draw[<->] (\ax, -1) -- (0,-1) node[midway, fill=white] {\Huge $R$};
53+
\draw[<->] (\lookahead, 0) -- (0,0) node[midway, fill=white] {\Huge $l_d$};
54+
55+
% angle delta top
56+
\draw[dashed] (0, \dist) -- (0,\dist+6);
57+
\draw[dashed] (0, \dist) -- ({-sin(\deltavar)*6},{\dist+6)});
58+
\draw[color=black] (0,\dist+3.3) arc (90:90+\deltavar:3.3);
59+
\draw (-0.27, \dist+2.9) node[black] {\Huge $\delta$};
60+
61+
% angle delta left
62+
\draw[color=black] ({\ax+2.7},0) arc (0:1.3*\deltavar:2);
63+
\draw (\ax+1.9, 0.85) node[black] {\Huge $\delta$};
64+
65+
% circle
66+
\draw[ ->, orange, line width=3] (0,0) arc (0:70:-\ax);
67+
68+
% circle LookAhead
69+
\draw[ ->, dotted] (\lookahead,0) arc (0:360:\lookahead);
70+
71+
% ICR
72+
\node[red](ICR) at (\ax,0.5)[above]{\Huge Center of Rotation};
73+
\draw[red, fill] (triangle_left) circle(0.13);
74+
75+
% PATH
76+
\draw[green!80!gray, line width =3](1, -6) --(0,-3) -- (-0.5, -1) -- (-1,0) -- (-1.5,1) -- (-2,2) -- (-3, 8) -- (-6,13) ;
77+
\node[green!80!gray] at (0.6,-2.6)[right=-0.4]{\Huge path};
78+
79+
% target
80+
\node[red] at (-4.8,11)[above right=0.5 and -0.1]{\Huge Target Point};
81+
\draw[red, fill] (-4.8,11) circle(0.13);
82+
83+
% magenta triangle
84+
\draw[magenta, line width=3] (0,0) -- (triangle_left) -- (-4.8,11) -- (0,0);
85+
86+
% angle \gamma_1
87+
\draw[color=magenta, line width=3] ({\ax+5},0) arc (0:47:5);
88+
\draw (-11.2,1.5) node[magenta] {\Huge $\gamma_1$};
89+
90+
% gamma_2
91+
\draw[color=magenta, line width=3] (-3.6, 8.2) arc (290:226:3.05);
92+
\draw (-5, 9.2) node[magenta] {\Huge $\gamma_2$};
93+
94+
% gamma bottom
95+
\draw[color=magenta, line width=3] (-4.5,0) arc (180:111:4.3);
96+
\draw (-2.6,1.7) node[magenta] {\Huge $\gamma_3$};
97+
98+
% \alpha
99+
\draw[color=magenta, line width=3] (0,8) arc (90:113.2:8);
100+
\draw (-1.9, 8.6) node[magenta] {\Huge $\alpha$};
101+
102+
\end{tikzpicture}
103+
\end{figure}
104+
7105
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathTracking/pure_pursuit/animation.gif
8106

9107
The red line is a target course, the green cross means the target point

0 commit comments

Comments
 (0)