Can anyone help me coding how to combine line follower and object avoidance together where robot doesn’t return back, just pass the obstacle which one is on the line?
Combine line follower and object avoidance together
Our robot is going on the line and returning back when it is meet at obstacle on the line.
We need the robot pass the obstacle and continue on the line.
I could just write down the solution, but the point of the Makeblock system is to learn by doing, so I won’t do that. Instead I’ll try to give you some hints so you find out yourself.
Please do the following:
a) Please make a screenshot of the coding you used so far and attach it here
b) Please imagine that the mBot is a blind person. Imagine that this person walks on a path and can only tell if the left foot, right foot or both feet are on the path or on grass. In addition, this person has a stick to detect obstacles in front if him.
Now also image that this person is very dumb, but can follow orders very accurately. So please give the person detailed verbal orders so it can bypass an obstacle on the path. Please write that down here.
I see this as Andreas, please post the program you have so far. Then you can get tips to further develop this.
Here is a program we did a few days ago - the mbot stops as soon as 10 cm is an obstacle - and goes as soon as the obstacle has been removed:
You have to adjust the last function so that the robot moves around the obstacle.
Hi all, I have the same question and i am doing this project with @spolat. Please find the screen shot of the mBlock.
- the line following is selected here is only 1,2 and 3. as we are using a narrow line.
- From the block, the ultrasound sensor detects and stops.
Need logic to make the robot understand that the left wheel has to go forward and right wheel has to go backward and take a rotation either right or left orientation and follow the path as usual.
Please give your suggestions for.
- How to avoida the obtacle and follow the path going forward?
- How to make a smooth move on selecting the narrow line as the robot takes left 0 or 1 when line = 1 or 2.
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 http://openlab.makeblock.com/topic/56e38e5660a70d5c503f7fce
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
Unfortunately, I do not have an mBot Ranger to test with. However, I will try to present how I would approach the problem.
-
When an object is within range X, turn (left or right) 45 degrees.
-
Drive forward a distance Y, until the bot is perpendicular with the object.
-
Turn in the opposite direction from step 1, 90 degrees.
-
Drive forward Y distance again, search for the line.
-
Once the line is found, return to Line Following Mode.
Note that steps 2 and 3 will be ‘blind’ operations (no line following or range finding). You will have to test different values for the distance X and Y, until you can clear the object. You may also need to test different values for the ‘wait n secs’ to adjust the distance traveled. Be sure to issue stop (motor) commands to stop turning.
If you can calculate the the true speed (mm/s) of your bot, you might be able to a value for ‘n’ during the object avoidance routine.
Let me know if this helps,
Mike