[chronojump] RaceAnalyzer. Fixed wrong speed at trigger signals



commit 5e9fd6d11e5489f7a4ff40ea6f7fe577c5284f79
Author: Xavier Padullés <x padulles gmail com>
Date:   Thu Jan 30 11:30:53 2020 +0100

    RaceAnalyzer. Fixed wrong speed at trigger signals

 r-scripts/sprintEncoder.R | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index 3ce22e5f..f4bf00cf 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -88,7 +88,7 @@ getSprintFromEncoder <- function(filename, testLength, Mass, Temperature = 25, H
 
         raceAnalyzer$displacement = raceAnalyzer$displacement * metersPerPulse
         position = cumsum(raceAnalyzer$displacement)
-        speed = raceAnalyzer$displacement / elapsedTime
+        speed = raceAnalyzer$displacement[2:length(raceAnalyzer$displacement)] / elapsedTime
         
         #Adjusting the time of each sample to the mean time between two samples
         for( i in 2:length(totalTime)){
@@ -519,7 +519,7 @@ getTrimmingSamples <- function(totalTime, position, speed, accel, testLength, st
                 startSample = startSample +1
                 if(accel[startSample] > startAccel)
                 {
-                        print(paste("accel[", startSample +1 ,"] = ", accel[startSample + 1], sep = ""))
+                        print(paste("accel[", startSample,"] = ", accel[startSample], sep = ""))
                         
                         #Looking iF after 1 seconds the position has increased  at least 1m.
                         sampleAfterSecond = which.min(abs(totalTime - (totalTime[startSample] +1)))
@@ -595,8 +595,8 @@ testEncoderCJ <- function(filename, testLength, mass, personHeight, tempC)
                                       title = op$title,
                                       subtitle = op$datetime,
                                       plotRawMeanSpeed = TRUE,
-                                      plotRawSpeed = FALSE,
-                                      plotRawAccel = TRUE,
+                                      plotRawSpeed = TRUE,
+                                      plotRawAccel = FALSE,
                                       plotRawForce = FALSE,
                                       plotMeanRawForce = FALSE,
                                       plotRawPower = FALSE,


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