LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a cloud cursor trajectory

I am currently trying to understand the labview code created by someone else than myself earlier on; my task is to create a cloud for a set target trajectory and I am wondering how should I start/go thorough with it. At the moment I am given the trajectory code that is consisted of key and time as inputs (the code operates on y, x axes as well as t - for time); since I am new to labiew, and given no word description, I am confused with the strucure of the target trajectory code.  Could anyone help?

0 Kudos
Message 1 of 6
(3,149 Views)

If you had attached the actual code (the file possibly called traj.vi), we could have returned it to you with little comment boxes on the various functions explaining what they were and how the code apparently is designed to work.  Much harder to do that with a picture.  The other thing that having code does is if there is something that we might not recognize, we could do what you also can do, open it in LabVIEW, right-click it, and choose Help to provide a complete description of the function, its inputs and outputs, and how to use it.

 

Bob Schor

0 Kudos
Message 2 of 6
(3,122 Views)

Thank you, Bob.

One thing about using the Context Help is that sometimes, like in this particular case, I find it hard to put in the context of the experiment (the trajectory and its changes are supposed to be created for the purpose of an object tracking task, simultaneous for two people). 

Anyway, I am attaching the *vi below (of the trajectory generation as well as the key), I would be more than grateful for any comments that could help me understand the purpose of all of the components.

Still, if anyone had ever tried coding a cloud cursor target in labview, please - let me know.

 

 

Download All
0 Kudos
Message 3 of 6
(3,115 Views)

Thanks for providing the code.  The Key Generation code looks overly complex to me.  It appears to consist of "Generate an integer from 0 to 7 using a uniform distribution when Generate is True, and return 0 when Generate is False", but lays on unnecessary feedback loops that mainly serve to confuse me (I've never liked feedback loops, find them tricky to understand, even though I've used them on rare occasion).

 

It is certainly true that Key will be an integer in the range 0 .. 7.  Thus the In Range and Coerce function in Trajectory is not only unnecessary, but a potential source of a bug if you ever decide to use the (unused-in-your-code) "In Range?" indicator, which will return "True" for inputs 0 .. 6 and "False" for the single input 7.

 

I'm about to try to catch a plane to return home, so haven't time to look at the rest of the code.  I also know nothing about "cloud cursor trajectory" -- I can't even imagine what this is ...

 

Bob Schor

0 Kudos
Message 4 of 6
(3,109 Views)

Thanks, Bob.

 

On the cloud cursor topic, I have the following info (to be applied in general; have no idea how to do it in labview within my given code):

 

'The target’s trajectory is a multi-sine function

x(t)= 1.6 sin⁡(0.1t)+4 sin⁡(0.3t)+0.8 sin⁡(0.5t)+2.4 sin⁡(0.8t)
y(t)= 0.8 sin⁡〖(0.2t)〗+2.4 sin⁡〖(0.3t)〗+4 sin⁡〖(0.6t)〗+2.4 sin⁡〖(0.8t)〗
such that the target movement is not repeated over a trial, which lasted 15 seconds, but has the same frequency content to compare tracking error between different trials. Not this target, but 5 dynamic round spots around it, were displayed, where each spot’s position and velocity were updated every millisecond. Spots were regenerated one by one every 400ms by picking a new position and velocity from normal distributions with a standard deviation of 0.005m for the position and 0.005-0.25m/s for velocity. The standard deviations of a spot position and velocity were fixed at the start of every trial.'
0 Kudos
Message 5 of 6
(3,058 Views)

It's often a Good Idea to take a complicated, complex task and break it up into simpler parts.  I'm going to discuss one such "simple part", namely generating an "exact" Cloud Cursor Trajectory.

 

You have provided formulas for the X and Y coordinates of the trajectory as a function of time, have given an "update" time of 400 msec, and a total time of 15 seconds.  If we were to plot 15000/400 = 37.5 (rounded up to 38) points at 400 msec intervals, we'd have the Exact Trajectory.

 

X-Y plots are Graphs.  The X and Y values are made up of a sum of sine terms, where each sum has an amplitude and a frequency, and there are 4 of each of them.  This suggests 4 arrays -- X Coeff, X Freq, Y Coeff, Y Freq.  A simple For loop will compute the array of X-Y coordinates, which we plot.

 

Here's a LabVIEW 2016 Snippet of the code -- I've also tried to save it as LabVIEW 2014 as an attachment.Cloud Trajectory.png

 

Bob Schor

Message 6 of 6
(3,051 Views)