I am very new to Latex. I have problem with \SetAlgoLined in algorithm2e. As seen from the picture, inside the while loop the line seem to be normal. I don't know why outside the while loop, the line seem strange.
\documentclass{article}
\usepackage[ruled,vlined,algo2e]{algorithm2e}
\begin{document}
\begin{algorithm2e}
\SetAlgoLined
\SetKwInOut{Input}{Subscribe}\SetKwInOut{Output}{Publish}
\SetKw{Set}{set}
\SetKw{Read}{read}
\SetAlFnt{\large}
\SetAlCapFnt{\large}
\SetAlCapNameFnt{\large}
\caption{Single Robot Auto Navigation}
\Input{initialize\_state, custom\_waypose ($q_i,\alpha_i$), robot\_status, camera\_interrupt, object\_depth}
\Output{robot\_pose ($p_i,\alpha_i$), sphere\_marker\_position ($q$) }
\If{finished initialize\_state}{
\Read {custom\_waypose}\;
\For{waypoint ($q_i$) in custom\_waypose:}{
\For{wayorientation ($\theta_i$) in custom\_waypose:}{
\Set{WAIT to robot\_status}\;
$p_i = q_i$\;
$\theta_i = \alpha_i$\;
return waypose\;
\While{waiting robot\_status}{
\If {robot reached goal}{
break\;}
\If {camera_interrupt}{
$q_i_x = p_i_x+ object\_depth * sin(\theta_i)$\;
$q_i_y = p_i_y+ object\_depth * cos(\theta_i)$ \;
return sphere marker (q)\;
end program\;
}
}
}
}
}
\end{algorithm2e}
\end{document}
