Go Down

Topic: Map Generation (Read 4581 times) previous topic - next topic

budder8818

I making a path following robot, which understands where certain static objects are located on a map.

I'm generated a digital representation of a 2D map. It is 12' by 7' area. It is represented in a 2D array which stores the priority level. The higher the priority level the more the robot wants to travel towards that direction.

A further desciption:
I'm trying to digitize a 12 foot by 7 foot map with the UNO. I'm using a 2D array. I was planning on having a boolean array in stored in RAM which is why i want it so small.
The way it works, lets say you want the transition from each matrix element to represent 1 inch. In other words if you go from array[j] to array[i+1][j] then you have just moved one inch north. So the resolution of the map is 1inch per matrix element. Thus, if you need a 12 foot by 7 foot map the minminum amount of memory would be:

1. Matrix size row: 12 foot x 12inch/foot * 1element / 1 inch = 144 row elements
2. Matrix size column: 7foot x 12inch/foot * 1element/1inch = 84 col elements
3. Hence, we need a 144x84 matrix which contains a total of 12096 elements. These elements are a digital representation of the map.
4. If those elements are bytes then the amount of memory needed is 12KB approx which can only be stored in flash memory, but if they where bits, 0 or 1 then the memory needed is 12096 bits x (1 byte/8 bits) 1512bytes. You can see the dramatic reduce in memory.

The other way to do this is to make the resolution worst, say 2 inch /element.

Right now I'm just trying to generate the 2D array with java code, I'm not writing on the Uno platform yet. I have successfully generated the map.

Map Attached.

My question is:

The map is a 2D in programming terminology but if you think about in term of vector calculus, it's just a 2D (discrete) scalar field. Where:
f(i,j,P(i,j)) where P(i,j) is the priority of a certain cell (i,j). My question is:

Does anyone know of a program, like matlab perhaps that is capable of taking a 2D matrix, and chracteristing it as 3D function?

PaulS

Quote
The map is a 2D in programming terminology but if you think about in term of vector calculus, it's just a 2D (discrete) scalar field. Where:
f(i,j,P(i,j)) where P(i,j) is the priority of a certain cell (i,j).

If you have a function with 3 variables - i, j, and P(i.j), the function must represent something. It isn't clear to me just what that function represents. Typically, one would say that y = f(x) or w = f(x,y), where y is a function of x or w is a function of y and y. What replaces the ? in
Code: [Select]
? = f(i, j, P(i,j))

What do the values in the map shown mean? How will you replace those values that are all over the place with 0 or 1 and retain the same meaning?
The art of getting good answers lies in asking good questions.

johnmchilton

Priority(i,j) = f(i,j)

where f is determined by ... ?

Since you don't need blazing fast access to the data, and because flash storage has a relatively short lifespan in read/write cycles, why not get the 256KB EEPROM on SparkFun? It's I2C. I know some people who used it successfully in their first embedded project ever and said it was very easy.

growler

What kind of positional feedback does the robot use? Mostly just curious but I think you are going to need some very good positional feedback before you need a map with 1 inch resolution.

budder8818

Rotary Encoders, and a gyroscope.

PaulS

Quote
Rotary Encoders, and a gyroscope.

What is the rotary encoder measuring? How are you preventing slippage?

How are you calibrating the gyroscope? How do you account for the inevitable drift?
The art of getting good answers lies in asking good questions.

growler

I don't think either of those two methods will provide the kind of accuracy needed to follow a map for very long.  Your error will build up so fast if that is all you rely on that a map isn't going to be a ton of help I think.

zodiak

#7
Jul 22, 2011, 08:19 pm Last Edit: Jul 22, 2011, 08:22 pm by tecmac Reason: 1
I'm also working on robot map building at the moment but in my case, because of computational constraints (and I'm using a dual Arduino setup!!) , I moved the calculations to an external computer and it looks like this will work well.

About your question:

Code: [Select]
Does anyone know of a program, like matlab perhaps that is capable of taking a 2D matrix, and chracteristing it as 3D function?


I never thought about things this way and it's very interesting, but in my view:

1. Should you consider to use it on an external computer (read common PC), an array of 12096 elements is not a problem, so I wouldn't use that function. But,
2. if you plan to use that hypothetical 3D function on the robot on the UNO, you potentially use up less memory but you need to consider the very likely possibility that the UNO will just be bogged down by way too many slow floating point divisions and multiplications once you start manipulating the function to generate something useful...
3. I would consider decreasing the grid resolution, what is the size of your machine? For many cases a grid (matrix) that is much smaller than the machine itself adds no advantage to the goal.

Good luck!

moebious

I agree with Tecmac, if your machine cannot move into a 1 inch square space it is not necessary to have that level of resolution.
BigTrak http://www.retrojunk.com/details_commercial/2313/

Also i would not use boolean. With only two states you won't have room for pathfinding. 1=open 2=blocked 3=waypoint 4=path

Go Up