Outdoor navigation
Bob from Netherlands  [4 posts]
15 year
Hello everyone I'am Bob.
I'am part of a project group at my school and we are building a robot which should be able to find his way trough a maze field.
Now we have looked at roborealm's vision capabilities which just blew our minds.
We struggled for quite some time with different programs but got nowhere slowly.
Now we have spend some time with the roborealm it seem to be entirely possible to make this.
However we have run into some difficulty's while trying to determent the angle the robot should go trough the field.
We have used the hough transformation and the strait_lines feature to come with some nice lines for us to see the outside of the maze and plot to lines.
Now we want to make a line with it's direction for the robot to follow.
But we aren't able to find a way to do this.
If we could get the directions of the 2 lines on either side we could work with that but we are unable to do even that.
There is something obvious we are missing but we can't work out what.
Here is an test program I have written and used, and also a still picture of out test thingy.
We can get rid of almost all the stuff in the picture so it doesn't bother and the lines we get are great but we need to put a centerline in it and get the angle of that line.
Can you help me?


Shawn from United States  [5 posts] 15 year
I am just taking a guess here, as from reading from what you need and remembering some of the tutorials. There is a tutorial on the Tutuorials page that talks about how to get the angle of a line. It basically sounds very similar to what you want.

If it was me though, I would you the calculate angle module,then I would calculate the distance between the lines, assign some variables, and a bit of math and then you could display a line down the middle with coordinates.

However it seems like to me you could also just calculate the distance between the lines continuously and have your robot stay in the middle of them. Then you would not have to worry about drawing a line unless you really wanted to. You could also do that and draw the line based off your robot's movement so you could see which way he is pointing perhaps, if your camera is not solid mounted.

As far as coming to a wall in front of the robot you could do a sideways calculation and a separate forward calculation and backwards calculations.

I hope that helps you some, I am sorry I can provide examples, as I am just starting to learn how to use the software myself. To me though the above seem like one of many possible solutions to your problem,
Anonymous 15 year
Shawn has the right idea ... following is an updated robofile that includes a bit of VBScript to grab those two hough lines, create a center line and also produce the follow_angle variable.

Now the question is does the line remain when actually using this? Seems like that once you get to the end of the road that line will disappear?

Bob from Netherlands  [4 posts] 15 year
Thank you verry much.
And if we get round to it we will make some kind of end row detection to make the robot do a full turn into the next row.
But for now this is a great help.
Thank you
Bob from Netherlands  [4 posts] 15 year
Hello again everyone.
After some testing we went with a new method to detect our environment.
This works nicely but it puts out a coordinate and not an angle.
So to do this properly we annalised the program Steven Gentner gave us.
And then wrote our own.
Here it is:
SetVariable "HALF_WIDTH",half
hoek = atan2(y-0,half-x)
hoek2 = (hoek*180)/3.14159
SetVariable "ANGLE", int(hoek2+0.5)"

Now this works perfectly on our windows pc's we use to test stuff.
But when we get to our arch linux operated robot the script no longer works.
roborealm works trough a program called wine.
We have found a way to get the camera read from roborealm trough an screen capture.
But now the script no longer works do you have any idea how to resolve this problem?
Offcourse ill include our test program.
And a picture to see what we mean.


Anonymous 15 year

Looks like the VBScript dll that we use in that module does not work correctly when running under wine. You will have to create an external program that communicates with RoboRealm using the API in order to get that logic running.

Alternatively, you could purchase a netbook which is not too expensive in order to run on that ... they are not superfast but are typically ok for most tasks.

Bob from Netherlands  [4 posts] 15 year
Unfortunately we do not have the luxury to switch to a windows system.
Because we use an I2C bus to read some srf08 ultrasoon sensors.
We finally went with roborealm writing 3 text files and doing the calculations in c code which is used to do everything else.
We could not write everything in one text file because the order in which they where written would change after saving it.
So we made it work but it's not perfect.
A real solution isn't there yet just a work around.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index