Combine the Play "Drive" function with the "Line Following" function


#1

Hi
I have a request for using the mBot Ranger with the combination of first manually driving the robot until you hit a line and then having it follow the line by itself.
Is it possible to combine those two features without having to switch programs?
I thought I had 2 days to complete it, but I only have til the morning where I have to hand over the setup.
Thaks in advance :slight_smile:
Best regards,
Mikkel


#2

You could write a program that allows for the robot to be driven until a line is detected. :slight_smile:

State 1 - No line detected - User drives mBot

State 2 - Line detected - mBot autopilots based on the presence of a line beneath the line detection sensor

You may also want to consider whether you want to provide a way for the user to take back control of driving while in State 2. Something else to consider is what to do when the mBot is completely off of the line and can’t find one immediately.


#3

Thanks Chuckmcknight
I am all new and when you say state 1, I am uncertain what to do and where to do it.
There are 2 apps I have downloaded.
One named Makeblock and one named mBlock (programming)
Could you guide a bit more for a total newbie.
Thanks :slight_smile:


#4

Thanks Chuckmcknight
I am all new and when you say state 1, I am uncertain what to do and where to do it.
There are 2 apps I have downloaded.
One named Makeblock and one named mBlock (programming)
Could you guide a bit more for a total newbie.
Thanks :slight_smile:


#5

You are suggested to download PC software mBlock to program.
And you may try some simpler program first.


#6

As @tech_support suggested, you may want to start with simpler programs in mBlock before diving in on this one.

As far as the “state”, it refers to the mode the robot is operating in at the time. For example, if the robot is in the state where no line has been detected, it would allow the user to drive the robot (likely with the remote control) while periodically checking the line following sensor to determine if a line had been detected. When the line was detected, the robot would change its mode of operation to follow the line. In this case, it would be similar to a light switch which can only be in a single state (on or off). Generally the current state is controlled by a system-level variable which changes based on the criteria selected by the programmer.


#7

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.