Combine Road Following and Obstacle avoidance?

Hello

What’s the best way to combine the road following notebook with the obstacle avoidance ? eg. would like to design a lego road but the ability to stop when JetBot comes into contact with a lego person.

thanks