05-22-2018 03:03 PM
Hi there,
I am capturing changes in thumb position using an accelerometer. I want the user to create a movement, and to try and match that movement to a target movement displayed on screen.
When I plot my target movement array and the user's movement array they are tilted to the side (with respect to veridical) so the feedback is hard to understand.
I read a bunch of forums and all I can see is suggestions to A. turn the XY plot into an image, then B. use this VI someone posted to rotate the image as desired.
I have done this and it looks pretty awful - largely because I can't work out how to remove the edges of the graph where you can see the axes all turned sideways. Also I can't quite work out how to take it off the loop to rotate with the slider without it stopping working (sorry, I am new to labview...), I just want a constant rotation of 160 degrees.
Is there a better way to do this that anyone can think of???
(final thing for bonus points, I would love to put extra lines onto this so the 'target movement' line is the top axis (0 degrees), but there is also a 90, 180, 270 line - where the target movement is rotated about its x axis by these degrees. I been trying to use a rotation matrix to do this but am failing miserably)
Harry
Solved! Go to Solution.
05-22-2018 11:00 PM
Sorry, I can't open your VI right now, but it looks (to me) like you are drawing two lines between two points. If so, and if you know how to do rotations about a point (you mentioned "rotation matrices", which is basically the right idea), then all you need to do is to draw lines between P1' and P2', where P1' and P2' are the XY values of the original P1 and P2 endpoints of the line about a center and with a rotation amount that you specify. Don't rotate the graph, rotate the points that make up the end-points of the lines in the graph.
Bob Schor
05-24-2018 11:19 AM
Hi Bob,
You are right, rotating the vector would make more sense - I just was not having any luck working out how to do it yesterday. In the end I found a VI to translate all my points around a pivot point, thus, translating the line. Which is great!
Only thing is, I would like to get the 2D array representing this line (all X and Y values), so I can perform calculations on it. However I can't seem to get the array back from the cluster. It might be because I don't quite understand what the VI is doing, as when I try plot in XY graph the output it generates a strange looking scatterplot...
VI attached
05-25-2018 01:38 PM
I'll get back to you on that. I don't have LabVIEW 2017 available, and am (slowly) downloading and building LabVIEW 2018 in a VM, so be patient ...
Bob Schor
06-01-2018 06:22 AM
No worries, thanks for all your help regardless!