Commit c377b812 authored by Xavier Padullés's avatar Xavier Padullés

SprintEncoder. Improved detection of wrong execution.

parent 79b64e8f
#Function to get the interpolated x at a given y
interpolateXAtY <- function(X, Y, desiredY){
if(max(Y) < desiredY){
print("desiredY is greater than max(Y)")
return(max(Y))
}
#find the closest sample
nextSample = 1
print("X:")
print(X)
print("Y:")
print(Y)
print("desiredY:")
print(desiredY)
while (Y[nextSample] < desiredY){
nextSample = nextSample +1
}
......
......@@ -293,6 +293,11 @@ plotSprintFromEncoder <- function(sprintRawDynamics, sprintFittedDynamics, title
#Detecting where the sprint start and stops
getTrimmingSamples <- function(totalTime, position, speed, accel, testLength)
{
if(position[length(position)] < 5){
print("Sprint too short")
return()
}
#The test starts when the speed is grater than 1
startSample = 0
startingSample = FALSE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment