LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Laser scanners continuous 1D data into sequential arrays

I am working with the Laser scanner LMS 100 which gives me an output of string and I have converted string to a distance 1D array. Now I intend to use Kalman filter on these array values. Thats why I want to get 10 or more times scanned data in several arrays or in a multi-dimensional array or in a matrix. Can anyone please help me to sort it out? Mathscript ideas are also welcome.

0 Kudos
Message 1 of 5
(2,446 Views)

Can yu place a typical input string (Eingangsdaten) in the control and make the current values default?

 

Just lookig at it for a few seconds, there are some questionable constructs. Why do you initialize the shift register with an array of one empty string element, just to delete the first element righ after the loop. Why do you append the last element just to delete it later?I think the entire while loop (and more) could be replaced by a simple "spreadsheet string to array" with a space as delimiter and a 1D array of strings as type.

Both small FOR loops can be removed. The primitives in them work equally well on arrays.

"Index array" can be resized for four outputs, so you only need one instance.

If you wire a I32 constant to the default input of "hexadecimal string to number", you get I32 directly on the output. No need to convert. Same for the DBL conversion.

I think all this could be done with less than 50% of the current code.

 

Can you explain how you want the multiple datasets arranged in the 2D array? Do all sets have the same lenght?

0 Kudos
Message 2 of 5
(2,415 Views)

Thank you for your quick reply. My goal is to detect an object shape by LMS 100 Laser scanner , where I am trying to use Kalman filter for precision and now my problem is I am getting an string of data from my laser scanner with nearly 1080 values in 1D array but I need to have it on 2D array for calculating in Kalman filter. So I want to put every scanning result in different arrays as if I have 10 scanning values in one second. So I am trying gather all 10 array values and filterring those values with Kalman filter which could provide better edge detection of an object.

 

Herewith I am attaching the program with default values. Here all sets have the same length or I will limit the length of array.

0 Kudos
Message 3 of 5
(2,407 Views)

So where do the 10 input strings come from? Do you have an array of 10 input strings? You could simply call the given subVI in an autoindexing FOR loop and then autoindex on the right loop boundary to get 2D arrays. Othrwise, we need more detail!

 

Here's what I had in mind for simplifying the current code. It is arguably quite a bit simpler. 😄

 

 

Download All
Message 4 of 5
(2,390 Views)

Hello Mr.Altenbach,

Thank you for your help. My task is to build a 2D array from the value I get from 1D array of scanned results. I mean I get 10 times of scanning result in an array. but it always changes. I want to store all scanning results in arrays which would help me to use kalman filter for getting precise result. If I can have all my continuous results stored in different arrays and can build a 2d array from these result would be great for initializing Kalman filter. Thank you once again.

0 Kudos
Message 5 of 5
(2,373 Views)