Safe Real-Time Obstacle Detection and Navigation Using CBF–CLF and CBF–PID Control