PDA

View Full Version : Treadmill , Optotrak & Vizard


Canucks
01-25-2017, 01:04 PM
We are trying to run Vizard for Optotrak in which the participant walk on the treadmill. The problem is since it's on a treadmill, on Vizard it shows it as going back & forth ( not moving forward) since the coordinates are not changing ( ir: you go from (0,0,1) to (0,0,2) even if you go 10K on treadmill). Is there way to fix this issue?

Jeff
01-25-2017, 04:18 PM
Use vizconnect to configure the viewpoint to move with optotrack data. Add a group tracker above the headtracker in the vizconnect scenegraph and update the group's position in the script that imports the vizconnect config file based on the treadmill speed. Take a look at all the vizconnect tutorials (http://docs.worldviz.com/vizard/#vizconnect_tutorial_displays_and_trackers.htm) to get started if you're not familiar with vizconnect.

Canucks
02-01-2017, 04:10 PM
Thank you for your reply. I created group tracker in the vizconnect. I'm wondering how can we read treadmill speed to update my mainview position? Are you suggesting let's say treadmill speed is 2 MPH, should I update the position based on that?

Jeff
02-01-2017, 07:16 PM
I'm not sure how you would get the treadmill data in Vizard. Does the manufacturer provide a Python API? If so, you could use that to get the data into Vizard. Attached is an example that updates a group tracker every frame to move the viewpoint.

Canucks
04-28-2017, 02:07 PM
Hi Jeff,
what is unit for scale in vizard? m/s?

Jeff
04-29-2017, 01:14 AM
Can you describe further the code you are referring to that's scaling the movement?

Canucks
04-29-2017, 07:18 PM
You sent me the simulated treadmill .. i'm wondering what's the unit of speed is so I can adjust with ours
TREADMILL_SPEED = .05

viz.add('sky_day.osgb')

# Add ground model 20 times
for i in range (20):
viz.addChild('ground_grass.osgb', cache = viz.CACHE_CLONE, pos = [0,0.01,i+25])

groupTracker = vizconnect.getTracker('treadmill_node').getRaw()

def updateGroup():
groupTracker.setPosition([0,0,TREADMILL_SPEED],viz.REL_LOCAL)

vizact.onupdate(0,updateGroup)

Jeff
05-01-2017, 10:41 PM
The following code allows you to specify the speed in meters per second:

# Speed in meters per second
SPEED = 1

def updateGroup():
# Get the elapsed time since the previous frame and multiply that against the speed in m/s
groupTracker.setPosition([0,0,SPEED * viz.getFrameElapsed()],viz.REL_LOCAL)

vizact.onupdate(0,updateGroup)