[chronojump] Fixed displacementPerson on ROTARYAXISINERTIAL
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed displacementPerson on ROTARYAXISINERTIAL
- Date: Mon, 16 Feb 2015 11:16:33 +0000 (UTC)
commit 6b5b4bf9cde60ddac6fb20001331e56b8f24521a
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Feb 16 12:15:23 2015 +0100
Fixed displacementPerson on ROTARYAXISINERTIAL
encoder/util.R | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index a373938..40b492b 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -769,8 +769,7 @@ fixDisplacementInertial <- function(displacement, encoderConfigurationName, diam
ticksRotaryEncoder = 200 #our rotary axis encoder send 200 ticks by turn
#angle in radians
angle = cumsum(displacementMeters * 1000) * 2 * pi / ticksRotaryEncoder
- #abs makes it change direction when signal is lower than initial position (0)
- position = abs(angle * diameterMeters / 2)
+ position = angle * diameterMeters / 2
position = position * 1000 #m -> mm
#this is to make "inverted cumsum"
displacement = c(0,diff(position)) #this displacement is going to be used now
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]