Foot Tracking
Find Example in ExampleScripts- Foot_Tracking and also as an option in the Walk the Plank demo. For most setups this would involve strapping the hand controllers to your feet using something like these straps, but can also use vive trackers. To adjust the position of the feet more precisely, can modify the leftFoot and rightFoot.osgb models in utils/resources/objects. If head height is off may need to re-do your room setup, or could also adjust height optionally in the code using
transportNode = vizconnect.getTransport('main_transport').getNode3d()
transportNode.setPosition([x,y,z])
This can be added to any script using the following code:
#set number of trials
sightlab.sceneConfigDict["trials"] = 1
#Set hands to invisible if using hand controllers on feet
sightlab.sceneConfigDict["avatarlhand"]= "utils/resources/avatar/hands/empty.osgb"
sightlab.sceneConfigDict["avatarrhand"] = "utils/resources/avatar/hands/empty.osgb"
rightFoot = vizfx.addChild('utils/resources/objects/rightShoe.osgb')
leftFoot = vizfx.addChild('utils/resources/objects/leftShoe.osgb')
transportNode = vizconnect.getTransport('main_transport').getNode3d()
rightFoot.setParent(transportNode)
leftFoot.setParent(transportNode)
if VIVE_TRACKERS:
import steamvr
tracker = steamvr.getTrackerList()[0]
tracker2=steamvr.getTrackerList()[1]
else:
tracker = vizconnect.getTracker('r_hand_tracker').getNode3d()
tracker2= vizconnect.getTracker('l_hand_tracker').getNode3d()
trackerLink = viz.link(tracker,rightFoot)
trackerLink2 = viz.link(tracker2,leftFoot)
#If wanting to be able to use gravity
if USE_COLLISION:
from utils import collision
c = collision.Collision()
rightFoot.disable(viz.INTERSECTION)
leftFoot.disable(viz.INTERSECTION)