GaitMeasure calculation

SCONE is a software tool for predictive simulations of biomechanical movement. It uses OpenSim for modeling and simulation, and performs optimization using various control strategies, including feed-forward control, proprioceptic feedback control, and bal
POST REPLY
User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

GaitMeasure calculation

Post by Ton van den Bogert » Mon Nov 13, 2023 2:30 pm

I am running a scenario where the simulation ends after a specified number of gait cycles (unless it falls sooner). It's about 34 seconds.

When using MeasureGait10GRF15.scone from the examples, the gait measure component becomes quite large, which makes the effort measure less important. Here is the breakdown:

Code: Select all

Result              = 42.6189
  CompositeMeasure  = 42.6189
    Gait            = 41.8466 <- 100 * (0.418466 > 0.05)
      step_velocity = 0.61777
      step_count    = 66
    Effort          = 0.663531 <- 0.1 * 6.63531
      effort        = 18583.1
      distance      = 37.5767
    DofLimits       = 0
      ankle_angle_l = 0 <- 0.1 * 0
      ankle_angle_r = 0 <- 0.1 * 0
      knee_angle_l  = 0 <- 0.01 * (3.13504 > 5)
      knee_angle_r  = 0 <- 0.01 * (3.18946 > 5)
    GRF             = 0.10877 <- 10 * 0.010877
The figure shows the simulated pelvis speed. The spikes are due to impulsive perturbations applied during the simulation.
image1.png
image1.png (68.78 KiB) Viewed 1764 times

(The large font size of some GUI elements happens when I switch from laptop screen to external monitor. It would be nice if Scone would not do that...)

The walking speed is (on average) quite close to the minimum required speed of 1.0 m/s, so I would like to have more of the composite measure come from the effort, as in the 10-second gait example that came with Scone.

Does this have anything to do with simulating more than 10 seconds? Is there something in my simulation that causes the step velocity to be calculated incorrectly?

I can just reduce the weight of the GaitMeasure but first I want to make sure that the measure is calculated correctly. Otherwise it may try to walk faster than 1.0 m/s.

It would help to know more detail about how the GaitMeasure is calculated.

I used SCONE version 2.2.1.2726.

Ton van den Bogert

User avatar
Thomas Geijtenbeek
Posts: 457
Joined: Wed Mar 12, 2014 8:08 am

Re: GaitMeasure calculation

Post by Thomas Geijtenbeek » Tue Nov 21, 2023 12:33 pm

Sorry for the late response, I don't always get notified of new posts.

The GaitMeasure tracks the minimum and maximum speed for each step as you would expect, but it uses the max_duration setting to determine early falls. It appears that you terminate the simulation yourself after a fixed number of cycles, presumably before max_duration time has passed. This causes the GaitMeasure to think the model has fallen, resulting in a high penalty.

The GaitMeasure is not aware of the number of cycles you intend to perform, so in case of a fall, it cannot estimate which fraction of the cycles it has performed without falling. However, it would make sense to simply not apply a penalty if the model hasn't actually fallen. This is not ideal but it will probably solve your issue, since the GaitMeasure will then become zero once it completes all steps at the minimum velocity.

Alternatively, you can also define your own penalty in a script for early falling, based on the number of steps taken. In the GaitMeasure, falls are detected simply by checking if the com height is less than termination_height * initial_com_height (which is recorded at the start).

Let me know which option you prefer. There's a major new SCONE release around the corner and I can include this feature. It would be helpful if you could test it before the official release.

In any case, GaitMeasure should definitely always become zero so that the EffortMeasure becomes the remaining term. Reducing the weight is not a good idea.

With regards to the font, I havent seen that issue before. Are you running SCONE on Windows?

User avatar
Thomas Geijtenbeek
Posts: 457
Joined: Wed Mar 12, 2014 8:08 am

Re: GaitMeasure calculation

Post by Thomas Geijtenbeek » Tue Nov 21, 2023 1:20 pm

UPDATE: I just fixed it, GaitMeasure no longer computes an extra penalty if the simulation is terminated early without detecting a fall. This fix will be included in the next SCONE release. I would still appreciate it if you would be willing to test the update before the official release.

User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

Re: GaitMeasure calculation

Post by Ton van den Bogert » Tue Nov 21, 2023 1:44 pm

Thomas,

Thanks, that is amazing that you were able to fix that so quickly.

I will test it immediately if you give me install instructions. I agree that the GaitMeasure should become zero during the optimization so that in the end only the effort is minimized.

About the font, yes, it's on Windows. My laptop has a much higher screen resolution than the external monitor, and some GUI elements seem to keep that high number of pixels when I then run SCONE on the external monitor. Restarting SCONE does not fix it. It only resets to normal when I restart Windows and then start SCONE again.

Ton

User avatar
Thomas Geijtenbeek
Posts: 457
Joined: Wed Mar 12, 2014 8:08 am

Re: GaitMeasure calculation

Post by Thomas Geijtenbeek » Tue Nov 21, 2023 2:07 pm

Great, I just sent you an email with installation instructions.

With regards to the font size, I'm afraid that's handled automatically by the GUI toolkit I'm using for SCONE (Qt), but I'll see if I can find something.

User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

Re: GaitMeasure calculation

Post by Ton van den Bogert » Tue Nov 21, 2023 3:12 pm

That seems to work! The step velocity value is now consistent with the horizontal speed of the pelvis.

Code: Select all

Result              = 0.667518
  CompositeMeasure  = 0.667518
    Gait            = 0 <- 100 * (0.0162636 > 0.05)
      step_velocity = 1.06426
      step_count    = 72
    Effort          = 0.618483 <- 0.1 * 6.18483
      effort        = 16107.5
      distance      = 34.943
    DofLimits       = 0
      ankle_angle_l = 0 <- 0.1 * 0
      ankle_angle_r = 0 <- 0.1 * 0
      knee_angle_l  = 0 <- 0.01 * (2.23206 > 5)
      knee_angle_r  = 0 <- 0.01 * (2.47541 > 5)
    GRF             = 0.0490346 <- 10 * 0.00490346

User avatar
Thomas Geijtenbeek
Posts: 457
Joined: Wed Mar 12, 2014 8:08 am

Re: GaitMeasure calculation

Post by Thomas Geijtenbeek » Tue Nov 21, 2023 3:15 pm

That's great to hear! Thank you for reporting and testing, let me know if anything else comes up!

POST REPLY