你好,我收到一个与我的框重叠的箭头,有什么想法导致此问题以及如何解决它?
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{arrows,positioning,shapes}
\tikzstyle{block} = [draw,rectangle,thick,minimum height=2em,minimum width=2em,align=center]
\tikzstyle{sum} = [draw,circle,inner sep=0mm,minimum size=2mm]
\tikzstyle{connector} = [->,thick]
\tikzstyle{output} = [coordinate]
\begin{document}
\begin{tikzpicture}[scale=1, auto, >=stealth']
\small
\lineskip -2pt
\matrix[ampersand replacement=\&, row sep=1.3cm, column sep=1.32cm]{
\node [block, name=OCP] {OCP}; \&
\&
\node [block, name=V] {Vehicle}; \&
\& \\
\node [output] (q1) {}; \&
\node [block, name=E] { State Prediction }; \&
\node [output] (q2) {}; \& \\
};
\node [output, left of=OCP] (IN) {};
\node [output, right of=E] (RE) {};
\node [output, left of=E] (LE) {};
\node [output, below of=OCP] (A) {};
\node [output, below of=V] (B) {};
\draw [connector] ([xshift=-2em]IN.west) -- node[name=L]
{$\mathbf{Q},\mathbf{R}$,$\mathbf{S}$} (OCP);
\draw [connector] (OCP) -- node[name=U] {$\textbf{A}$} (V);
\draw [connector] (V) -- node[name=XA] {$\mathbf{B}$} (q2) -- (RE);
\draw [connector] (LE) -- node[name=XB] {$\mathbf{C}$} (q1) -| (OCP);
\end{tikzpicture}
\end{document}
以上内容已通过已接受的答案进行了修复。以下是使用已接受答案的附加问题:
如果我想让箭头以一定角度射入,我该如何让它们击中盒子的中心?
\draw [connector] (OCP) -- node[name=U] {$\textbf{A}$} (V);
\draw [connector] (V) -- node[name=XA] {$\mathbf{B}$} (B) -- (E);
\draw [connector] (E) -- node[name=XB] {$\mathbf{C}$} (A) -| (OCP);