06-09-2010 09:19 PM
Hello forum users-
I'm working on an application that uses a mobile robot to map out an area.
To do this, I get 16 sonar readings once every second. These sonar readings give me an X and Y coordinate of where an obstacle is.
Now what I want to do is make a matrix/2d array that I define the inicial size as 501 by 501 and have all the elements of this matrix be zero. For each of my sonar readings I want to add 1 to a specific cell of the matrix.
(example lets say that that robot detects the first object at position 400x400 this cell instead of being zero would have a value of 1).
The final product should be a 3d mesh/surface graph that updates as the robot moves around the room (updated at 1 second intervals).
I know it could be done in Matlab so I figured I could use the MathScript Node but can I export the mesh function to my front panel???
Thanks for the help
Solved! Go to Solution.
06-09-2010 11:28 PM
06-09-2010 11:47 PM
bnoronha wrote:Now what I want to do is make a matrix/2d array that I define the inicial size as 501 by 501 and have all the elements of this matrix be zero. For each of my sonar readings I want to add 1 to a specific cell of the matrix.
06-10-2010 12:29 AM - edited 06-10-2010 12:29 AM
Here's some quick code showing a 2D histogram, displayed in 2D or 3D.
Modify as needed. Of course if you want to cap the z-axis at 1, simply use "replace array subset" with "1" as element instead of the current "in place" structure.
06-10-2010 01:01 AM
05-04-2015 11:46 AM