07-13-2022 11:42 AM
Hello! I am new to LV and working on a motion capture system project using the markers to find joint angles. To start I am trying to find the angle of the left wrist. My code posted below works to find angles, but my top for loop only goes through the first 9 columns when I need columns 87-99 (there are 151 in total) for the wrist data. I also need the code to go through each row of the specified columns. I want to be able to control what position it is reading from. I have attempted something that will allow me to index (picture below) but it creates an array rather than an element which doesn't connect with the joint angle math I have coded out within a loop. Does anyone know if there is a quick fix to this problem, or am I just using the wrong array function? Thank you.
07-13-2022 12:22 PM - edited 07-13-2022 12:26 PM
I think you simply need to go back to the tutorial and understand arrays.
If you want a single elements from a 2D array, you need to wire both indices, of course. If you leave one index unwired, you get a row or column.
No, your top loop does not only go though the first nine columns. Try to understand the decimate function.
07-13-2022 12:48 PM
This wasn't very helpful. When i run my loop and compare my data it is only going through the first nine columns (first 3 body parts). I am not sure if you ran my code with the data, but when it stops it ends on the last row of the first 9 columns. I want my code to run similar to my top loop but be able to chose where it starts. That was all I was asking. I have read the help tabs and the information documents on arrays and decimate with no further answer. If you aware of how to fix that problem it would be a lot more helpful then referring me to something i have already read.
07-13-2022 01:15 PM - edited 07-13-2022 01:16 PM
No, you get 9 arrays! If you only show one element in the array displays, that will not tell the entire story! Resize the container to see it all!
For each row, you have an array of [x1, y1, z1, x2, y2, z3, ....xN, yN, zN]
If you decimate that 9x, you get 9 1D arrays. containing elements as follows.
first array (labeled X1 in your program)
x1, x4, x7, ...
second array (labeled Y1):
y1, y4, y7, ...
etc.
07-13-2022 01:49 PM - edited 07-13-2022 01:51 PM
Hmm, try the concept in the attached VI. I think the wires are tangled up in the math logic but if you sort them back out It might be what you need.
07-13-2022 02:15 PM
I am aware of that, perhaps I didn't word it well enough for you. That still is not the question I was asking though.
07-13-2022 02:16 PM
Thank you! I will work with that now.
07-13-2022 04:53 PM
@mbel wrote:
Thank you! I will work with that now.
👍 hope it works for you