WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-25-2017, 01:04 PM
Canucks Canucks is offline
Member
 
Join Date: Jan 2017
Posts: 18
Treadmill , Optotrak & Vizard

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?
Reply With Quote
  #2  
Old 01-25-2017, 04:18 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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 to get started if you're not familiar with vizconnect.
Reply With Quote
  #3  
Old 02-01-2017, 04:10 PM
Canucks Canucks is offline
Member
 
Join Date: Jan 2017
Posts: 18
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?
Reply With Quote
  #4  
Old 02-01-2017, 07:16 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Attached Files
File Type: zip groupTrackerExample.zip (3.9 KB, 1692 views)

Last edited by Jeff; 02-02-2017 at 10:27 AM.
Reply With Quote
  #5  
Old 04-28-2017, 02:07 PM
Canucks Canucks is offline
Member
 
Join Date: Jan 2017
Posts: 18
Hi Jeff,
what is unit for scale in vizard? m/s?
Reply With Quote
  #6  
Old 04-29-2017, 01:14 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you describe further the code you are referring to that's scaling the movement?
Reply With Quote
  #7  
Old 04-29-2017, 07:18 PM
Canucks Canucks is offline
Member
 
Join Date: Jan 2017
Posts: 18
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)
Reply With Quote
  #8  
Old 05-01-2017, 10:41 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The following code allows you to specify the speed in meters per second:

Code:
# 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)
Reply With Quote
Reply

Tags
coordinate system, optotrak, treadmill, vizard

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optotrak and vizard Canucks Vizard 4 05-01-2017 10:18 PM
Connecting Vizard and NDI Optotrak vserchi Vizard 3 02-06-2015 01:04 AM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard 4 Beta Testing farshizzo Vizard 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM


All times are GMT -7. The time now is 01:32 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC