PDA

View Full Version : Flock of Birds


sleiN13
12-18-2008, 04:59 AM
I've got a problem with the flock of birds tracker (from ascension) and Vizard. As soon as I link the tracker (sensor = viz.add('flockofbirds.dls')) by means of the link function (linkviz = viz.link(sensor,viz.MainView)) the mainview point jumps to a different location and the whole image rolls over 90 degrees to the left. Also any movement from the HMD is mapped wrongly. For example head movement from left to right produces a Yaw motion and an Yaw motion from the head turns into an Roll. This is roughly the case because it's not exactly an 1 on 1 mapping.

My question is how do you get the flock of birds working correctly with Vizard because the default code from the examples and demo's all have the side-turned result.

Jeff
12-18-2008, 08:13 AM
It sound like you just need to swap position and orientation coordinates. Here are two methods available with the link object to do this and some sample code. There is also some more info on these in the command index in the docs. You will just need to pass in the proper values to both of these methods.

#Swap y,z coordinates
link.swapPos([1,3,2])

#Negate yaw value
link.swapEuler([-1,2,3])

farshizzo
12-18-2008, 09:24 AM
The coordinate frame of the sensor is relative to the orientation of the transmitter. If you place the transmitter flat on a table in front of you, with the wire coming towards you, then +Z is forward, +X is right, and +Y is up. Are you sure your transmitter is oriented correctly?

sleiN13
12-19-2008, 12:55 AM
I'm gone try the swapping as soon as possible it sounds very promising.

About the transmitter it's not bolted down to anything so I can't assume it will be in a fixed place every time so I will need to take care of that in the code. Is there any automated way to calibrate that with Vizard?

sleiN13
12-19-2008, 03:10 AM
I tried the swapping function with all possible swaps for the Euler but none had the right effect. It looks very much like the axis of the tracker and vizard isn’t aligned with each other.

I tried to figure out over what axis the data in vizard moved when I moved the HMD over an imaginary axis in the real world. With the tracker pointing directly to the front of the HMD and with the tracker cord behind it a straight movement to the left changed both the X and Z position value in Vizard significantly. And with the Roll and Pitch values it was even worse with the Roll value in Vizard changing the most for Pitch and Roll movement of the HMD

farshizzo
12-19-2008, 11:37 AM
If the transmitter and receiver are correctly aligned and you are still getting invalid values, then there might be some magnetic interference in your room. Large metal objects near the tracker can cause large errors in the tracking. Also, keep in mind that the range of the Flock-of-Birds is not very far.

sleiN13
02-17-2009, 07:12 AM
Thanks for your reply. We tried it in another setup without iron and 100% working equipment (it's regularly being used for experiments) and the problem persisted.

The exact problem we are having is that when we make a pitch movement, we are not looking from the floor to the roof in a straight line but in a bend curve in other words; If you try to follow a line on a wall with your eyes, your view gets shifted away from it. I hope this is clear, we will upload a video later. (http://www.youtube.com/watch?v=WN5Xv8AQlNc)

The movie was made by turning it (pitch) 60 degrees up and down and then turning it slightly over Yaw and do the 60 degrees pitch again. We did this because the problem seems to increase when the yaw angle increases but that could also be a optical illusion. In all movements we kept the HMD with sensor as steady as possible but mind the tracker equipment jitters like crazy. But the error occurs also on correct working equipment.

We don't use the link() method but link the sensor and MainView point with a timer function. We're doing this because in this way we can catch a bit of the jitter and stabilize the image. As you can see in the movie it's not optimal but on the other equipment the image is steady and only the curving problem exists.


def onTimer(num):
global prevEuler,prevPos

if prevEuler == None:
prevEuler = sensor.getEuler()
prevPos = sensor.getPosition()

newEuler = sensor.getEuler()
y = round(newEuler[0] - prevEuler[0],1)
p = round(newEuler[1] - prevEuler[1],1)
r = round(newEuler[2] - prevEuler[2],1)

newPos = sensor.getPosition()
px = round(newPos[0] - prevPos[0],3)
py = round(newPos[1] - prevPos[1],3)
pz = round(newPos[2] - prevPos[2],3)

prevEuler = newEuler
prevPos = newPos

eul = viz.MainView.getEuler()
pos = viz.MainView.getPosition()

viz.MainView.setEuler(eul[0]+p,eul[1]+r,eul[2]+y)

viz.MainView.setPosition(pos[0]+px,pos[1]+py,pos[2]+pz)