Bajengua:
Problem: How can I make my robot Faster?
As you have not told us how fast t is now, that is a bit difficult.
Or, put another way, you need to make your question a lot more specific - what part of your program is working too slowly?
Post your program and tell us all about the hardware that is used in your robot. Post links to datasheets for anything we are unlikely to be familiar with.
So line leads to obstacle. Robot is supposed to leave line, turn 90 degrees, drive along a circle with some radius. Some 180 degrees or until line is detected.
Can the robot turn its obstacle sensor to the sides? Can the line sensor sweep over say a 45 degree sector in front of the robot?
How does a robot follow a line and at the same time avoid obstacles?
Johan_Ha suggests on solution. Rotate 90 degrees, drive circle.
But I think that this is problematic. You are hoping that you will encounter a line. And you are hoping that you will follow the line in the proper direction.
Problem: How can I make my robot Faster?
You want it to complete the task faster. Does that mean that you have built the robot and it is able to complete the task now? That would be important for us to know. Because ANY suggestions to make it faster are worthless if you cannot complete the task at all.
And how are A and B told to the robot? By the coloured line? By coordinates? By direction and distance? To find the fastest path, the robot has to know if the path turns to the left or the right after the obstacle. Which way around the obstacle is the fastest?
Since it is a race, I assume others have also got the same assignment. So you can't just set up convenient rules and premisses for yourself while developing the idea. You need more facts.
The simplest approach assumes obstacles are all the same size, and the line is straight through each
obstacle, you choose a semicircular diversion path and follow it by dead reckoning and hope the line
reappears after about 180 degrees of circling...
To go faster you have to optimize the path (no hard corners, predict the maximum speed without skidding for each circular track, etc etc).
Think about how you would perform the same task given the same sensor inputs and no others....