[chronojump] ForceSensor. Showing force in measured direction during capture



commit 4cf742f6692da082fbbe0eb3056fe9fa1b9d96de
Author: Xavier Padullés <testing chronojump org>
Date:   Thu Dec 23 16:42:38 2021 +0100

    ForceSensor. Showing force in measured direction during capture

 src/forceSensor.cs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index e18792fdb..d3903e338 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -181,7 +181,8 @@ public class ForceSensor
 
        //static methods
 
-       //of a single point (this method will disappear)
+       //resultant force of a sample. Only used on capture.
+       //if this method changes, change also forceSensorDynamics methods
        public static double CalculeForceResultantIfNeeded (double forceRaw, CaptureOptions fsco, 
ForceSensorExercise fse, double personMass)//, double stiffness)
        {
                if(! fse.ForceResultant)
@@ -219,12 +220,17 @@ public class ForceSensor
                */
                //TODO: now we are using fse.AngleDefault, but we have to implement especific angle on capture
 
+               /*
                double forceResultant = Math.Sqrt(
                                //Math.Pow(Math.Cos(fse.AngleDefault * Math.PI / 180.0) * (forceRaw + 
totalMass * accel),2) +                   //Horizontal component
                                //Math.Pow(Math.Sin(fse.AngleDefault * Math.PI / 180.0) * (forceRaw + 
totalMass * accel) + totalMass * 9.81,2)  //Vertical component
                                Math.Pow(Math.Cos(fse.AngleDefault * Math.PI / 180.0) * (Math.Abs(forceRaw) + 
totalMass * accel),2) +                   //Horizontal component
                                Math.Pow(Math.Sin(fse.AngleDefault * Math.PI / 180.0) * (Math.Abs(forceRaw) + 
totalMass * accel) + totalMass * 9.81,2)  //Vertical component
                                );
+        */
+
+        double forceResultant = Math.Abs(forceRaw)  +  totalMass*(accel + 9.81 * Math.Sin(fse.AngleDefault * 
Math.PI / 180.0));
+
 
                //LogB.Information(string.Format("Abs(forceRaw): {0}, totalMass: {1}, forceResultant: {2}",
                //                      Math.Abs(forceRaw), totalMass, forceResultant));


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