10-11-2013 05:56 AM
Hi everyone,
I'm trying to create a random search way for the robot to find its way out to the destination point which is coloured as red.
I have worked days and nights, but still cannot get it solved.
Please give me some guideline.
Attached herewith my current progress.
Many thanks.
10-11-2013 08:46 AM - edited 10-11-2013 08:49 AM
You will need to setup the main VI to be recursive (to call itself). I think this is how it should go:
Your main VI should be a case structure...
If moving left fails, move straight ahead.
If moving straight ahead fails, move right.
If moving right fails, move back to where you were.
Everytime you move to a new square, run this main VI. You will need to have a pass/fail boolean that gets passed into the main VI.
This isn't a very detailed algorithm but maybe it will get you headed in the right direction.
10-11-2013 10:16 AM
There is a maze solving example that ships with LabVIEW. It is used to illustrate queues. Assuming you're in LabVIEW 2012 (judging from the save version of your VIs), you can get it here:
[LabVIEW 2012]\examples\general\queue.llb\Queue Stack - Solve Maze.vi
This example is also available in LabVIEW 2013, but at a different location:
[LabVIEW 2013]\examples\Synchronization\Queue\Queue Stack Maze Solver.vi
10-11-2013 08:36 PM
Hi Darren,
I able to solve the maze previously by using the queue function. What I'm planning to do is to change to another algorithm which is random search. I plan to use random search this method to reach the goal point. Is there guildeline on this?
10-11-2013 11:27 PM
@Christinalau wrote:
Is there guildeline on this?
The example I mentioned is the only LabVIEW maze solver I've seen.
10-12-2013 05:37 AM
Hi Darren,
got any way to make it as a random search??
10-12-2013 09:22 AM - edited 10-12-2013 09:22 AM
@Christinalau wrote:
got any way to make it as a random search??
As a first step, you should formulate your problems slightly better. Where does the robot start? What is the meaning of "out of the maze"? (For example of it starts a 0,0 in your maze, taking a step up or to the left would be "out", right? Problem solved! :D).
Then you should use a few more colors. I would recommend to use the first colors as "forbidden", thus you get it automatically if you step out of bounds, because it is the default value. Assign the other colors accordingly. Sort the colors in a useful order (forbidden, visited, dead end, new, out, etc.), the simply check the four values and go to the field with the highest score and update the color. Pick a random file among all highest values, etc.
Your code to format the time is pure Rube Goldberg, way too complicated! All you need is a numeric indicator set to time display. No string manipulation needed. You also don't need a shift register. Here's how you could keep track of elased time and format the numeric indicator.:
10-12-2013 08:57 PM
Hi altenbach,
The robot starts at (0,0). Yup, if the robot moves up or turn to the left, it is out of the maze.
I've set few colours. If you click on the "run" inside the "Maze1.vi", you can see that.
0 - white (path)
1 - black (lost)
3 - grey (wall)
4 - green (possible path to reach the goal point)
5 - final destination
"next step.vi" is the vi which does the calculation part. Now, I want to do a random search which means when the robot starts moving, it will randomly choose the four direction (North, South, East, West) to go. If it meets dead end, it will backtrack and randomly choose another direction to go until it reaches the goal point. Can give me some clear instruction regarding to this?
Many thanks.
10-13-2013 09:50 AM
I remember having a version of exactly this problem when I was in school. When is YOUR homework due?
10-13-2013 11:31 AM
Hi Intaris,
This sounds a great news to me. It is due by this coming week. Can you send me the version of yours as a reference?
Many thanks.