Calculating Speed with sensor
Hello,
Right now I am trying to figure out how to calculate speed with a sensor. I know that speed is the rate of change with respect to time. So change of position / time. I know I need to get the position(pos) of the sensor first. Then i have to have a def: that will check for its new pos then do the calculation - (new pos - old pos) / time. Then after that I need to start over and set the new pos to old pos. The problem im having is trying to establish a pos before the def: starts running. Whenever I test for the old position i keep getting 0.0, 0.0, 0.0. So its going to look something like this: Code:
Thanks |
Here is a sample function that takes any sensor object and calculates the speed of it:
Code:
import viz |
All times are GMT -7. The time now is 10:19 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC