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}
