Hello all,
we are designing experiments in Vizard that include both automated movement as well as manual movement (joystick, keyboard) of the viewport through an environment.
Here, we have come across an interesting problem: Whenever we have manual movement, the movement speed is inconsistent. This means it is a) dependent on the loaded environment and b) dependent on the desired speed that is set.
a) More complex scenarios produce higher deviations in movement speed (but only for manual movement! The automated movement works flawlessly)
b) Higher speeds produce higher deviations (at 10m/s it is about 0.5m/s slower, at 30m/s about 1.5m/s slower)
We are realising the joystick and/or keyboard movement with the following code:
Code:
if math.fabs(jy) > joyDeadzone and -zoneX < jx < zoneX: # translation
if jy > 0: # backward
view.move(0,0,viz.elapsed()*-joyMovSpeed)
if jy < 0: # forward
view.move(0,0,viz.elapsed()*joyMovSpeed)
elif math.fabs(jx) > joyDeadzone and -zoneY < jy < zoneY: # rotation
if jx < 0: # left
view.setEuler([joyRotSpeed*jx*viz.elapsed(),0,0],viz.HEAD_ORI,viz.REL_PARENT)
if jx > 0: # right
view.setEuler([joyRotSpeed*jx*viz.elapsed(),0,0],viz.HEAD_ORI,viz.REL_PARENT)
else:
pass
Could it be that the function viz.elapsed() is causing the deviation in movement speed?
All the best and thank you!