Line following with obstacle avidance


Hi there, can anyone help me out with mBlock program.

I am using the same program from Decision narrow line Chapter 14 for line following and obstacle avoidance for my mBot Ranger.

How ever, the program looks like the ranger stops once it detect the obstacle and turn around and goes back. (Please see the attachment for mBlock program)

Can anyone help me to do the same procedure as in the
where, mBot should be replaced by mBot Ranger.

Please help me to fix the obstacle avoiding algorithm moving forward for the program attached.

mBot: Line Follower and Object Avoidance
Line following with obstacle avidance - mBlock 3 - Makeblock

Is anyone there to help me out?


What do you want the robot to do - bypass the obstacle, find the line again and go on?


Hi Andreas,

Yes, you got me right! bypassing and going forward. Do you have any solution? please


Is anyone there to help me out? Please


Can you post a link to the


Hi Andreas,

I have tried the total code given in this chapter, the ranger model with 3 wheeled is what my configuration is.

Mainly EX14.2, which uses both line follower and uktrasonic, (Learning Task 2 – Park first or Go back to the Line first (Change of Judgment Priority)).

There, the logic is confusing under the ultrasonic sensor algorithm, i tried to change as below

if distance >15,
run right 100rpm
wait 0.1sec
runleft 100rpm.

Still the robot goes a turn and goes on the path which it comes from.

It is not taking turn and bypassing the obstacle and not going forward.

Please help me out with the logic.