[chronojump] ForceSensor elastic applies de captureOptions (for 2.2.0 code) normal/ABS/inverted



commit 3f455d494f26f1d0c1a2f0157f2e1d0b313a0b7a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jan 3 16:07:05 2022 +0100

    ForceSensor elastic applies de captureOptions (for 2.2.0 code) normal/ABS/inverted

 src/forceSensorDynamics.cs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/forceSensorDynamics.cs b/src/forceSensorDynamics.cs
index c0e922bae..39358e502 100644
--- a/src/forceSensorDynamics.cs
+++ b/src/forceSensorDynamics.cs
@@ -580,19 +580,20 @@ public class ForceSensorDynamicsElastic : ForceSensorDynamics
                {
                        LogB.Information(string.Format("i pre: {0}, force_l[i]: {1}, accel_l[i]: {2}", i, 
force_l[i], accel_l[i]));
                        //LogB.Information(string.Format("i: {0}, force_l[i]: {1}, force_l.Count: {2}", i, 
force_l[i], force_l.Count));
-            /*
+                       /*
                        double force = Math.Sqrt(
                                        Math.Pow(Math.Cos(fse.AngleDefault * Math.PI / 180.0) * 
(Math.Abs(force_l[i]) + totalMass * accel_l[i]), 2) +                  //Horizontal
                                        Math.Pow(Math.Sin(fse.AngleDefault * Math.PI / 180.0) * 
(Math.Abs(force_l[i]) + totalMass * accel_l[i]) + totalMass * 9.81, 2) //Vertical
                                        );
-            */
+                        */
+
+                       double force = force_l[i]  +  totalMass*(accel_l[i] + 9.81 * 
Math.Sin(fse.AngleDefault * Math.PI / 180.0));
 
-            double force = force_l[i]  +  totalMass*(accel_l[i] + 9.81 * Math.Sin(fse.AngleDefault * Math.PI 
/ 180.0));
+                       LogB.Information(string.Format("post force (but before applying captureoptions): 
{0}", force));
 
-                       LogB.Information(string.Format("post force: {1}", i, force));
+                       force_l[i] = calculeForceWithCaptureOptions(force); //
 
-                       //force_l[i] = calculeForceWithCaptureOptions(force); //Elastic is always resultant. 
Capture otions does not apply
-                       force_l[i] = force;
+                       LogB.Information(string.Format("post force (after applying captureoptions): {0}", 
force_l[i]));
                }
        }
        


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