[chronojump] Fixed getAccelerationSafe method



commit 3f9491b9dd82dca1292227e099c419a047dee7f2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 9 17:58:45 2015 +0200

    Fixed getAccelerationSafe method

 encoder/util.R |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index b3acaf3..ac2adf3 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -245,10 +245,10 @@ getSpeed <- function(displacement, smoothing) {
 
 getAccelerationSafe <- function(speed) {
        #x vector should contain at least 4 different values
-       if(length(displacement) >= 4)
+       if(length(speed) >= 4)
                return(getAcceleration(speed))
        else
-               return(list(y=rep(0,length(displacement))))
+               return(list(y=rep(0,length(speed))))
 }
 getAcceleration <- function(speed) {
        #no change affected by encoderConfiguration


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]