mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
[python] fix natnet3 speed filter
previously, only the last computed speed was return in the end, regardless of the filter option (number of points to use)
This commit is contained in:
committed by
Freek van Tienen
parent
8f4b107ad2
commit
4d7045d6ff
@@ -114,15 +114,15 @@ def compute_velocity(ac_id):
|
|||||||
dt = t2 - t1
|
dt = t2 - t1
|
||||||
if dt < 1e-5:
|
if dt < 1e-5:
|
||||||
continue
|
continue
|
||||||
vel[0] = (p2[0] - p1[0]) / dt
|
vel[0] += (p2[0] - p1[0]) / dt
|
||||||
vel[1] = (p2[1] - p1[1]) / dt
|
vel[1] += (p2[1] - p1[1]) / dt
|
||||||
vel[2] = (p2[2] - p1[2]) / dt
|
vel[2] += (p2[2] - p1[2]) / dt
|
||||||
p1 = p2
|
p1 = p2
|
||||||
t1 = t2
|
t1 = t2
|
||||||
if nb > 0:
|
if nb > 0:
|
||||||
vel[0] / nb
|
vel[0] /= nb
|
||||||
vel[1] / nb
|
vel[1] /= nb
|
||||||
vel[2] / nb
|
vel[2] /= nb
|
||||||
return vel
|
return vel
|
||||||
|
|
||||||
def receiveRigidBodyList( rigidBodyList, stamp ):
|
def receiveRigidBodyList( rigidBodyList, stamp ):
|
||||||
|
|||||||
Reference in New Issue
Block a user