PDA

View Full Version : Coordinate Transforms: Vizard to Haptic


VDong
05-12-2009, 09:36 PM
Hello,

In a haptic demo (using the SensAble Omni + Vizard 3.1, if that makes any difference), I'm trying to set the location of a node3d object (a pen) to a specific location on-screen before I set it as the marker.

To do this, I have a bit of alignment code which allows me to continually adjust the pen's position (using pen.translate(...) until it's where I want it to be; then I set hd.translate(pen.getPosition()), and hd.marker(pen). The reason I do the alignment first, then set the marker is because as far as I know, once the haptic device's marker has been set, there's no way to alter its position (independent of the haptic device's movement).

However, Vizard and hd do not appear to use the same coordinate systems, or there is some sort of weird transformation going on when I set hd.translate, because printing the pen's position and hd.get(hd.POSITION) give me significantly different values right after I set hd.translate to pen.getPosition()!

I don't know precisely how hd.translate relates to the position of the marker, so that could be the problem. I'm not attached to this method, either - basically, all I need is for the marker to appear/start from a specific reference point as seen in-world/on-screen as opposed to its default starting point in front of the user.

Thanks,
Jeff

P.S. Along with setting the marker's translation, its rotation also needs to be set, but the code we have for that appears to be working via the method outlined above.

Jeff
05-14-2009, 07:46 AM
When you use hd.get(hd.POSITION) the value you are returned is not in Vizard's coordinate system. When you scale the haptic space you define the boundaries and set values to them and the position follows from that. The position is not given in meters, there are no units, its relative to the values of the boundaries.