#1
|
|||
|
|||
LED "Enumeration"
I was interested in programming in WorldViz to "enumerate" available LED markers upon the script being ran. Enumeration, in this case, just means to find the maximum number of markers and to have filled a list with all the markers it added.
The only roadblock I see to this is that I'm wondering if there is a null check I can use to tell if the last marker added was "real" or not. It seems to add markers whether or not it has found additional ones-- Should a basic Null check work for this, or would I have to check the data object in each for a marker that had co-ordinates of (0,0,0)? |
#2
|
|||
|
|||
Basic solution
I'm just replying to this so no one else has to. The viz.add call on the vizppt.dls will return a function call on (-1) when called inappropriately. You could probably parse this if you wanted to; I just did a comparison of the three co-ordinate input to zero values to determine if the sensor was real or phantom. I have yet to test this out, and there's an obvious loophole should anyone ever manage to have a sensor at absolute zero, but this is a statistical improbability.
The tracker will throw errors if you add too many LEDs, so I had a maximum check in there as well, though with the zero check I have yet to have it used. |
#3
|
|||
|
|||
There is currently no way to check how many markers the PPT is currently sending. As you mentioned, the position value will be zero for invalid lights. However, you will need to wait a few frames to perform this check to ensure that the plugin has received an update from PPT.
|
|
|