Perturbation triggered by contact event

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
Jerome Hausselle
Posts: 4
Joined: Tue May 12, 2009 2:09 am

Perturbation triggered by contact event

Post by Jerome Hausselle » Wed Nov 25, 2020 10:50 am

Good morning Dr. Geijtenbeek,

First, thank you very much for this very nice and useful software!

Second, I was wondering if it would be possible to trigger the start of a perturbation force based on a contact event, e.g. when the foot touches or leaves the ground after a pre-defined number of steps?

Thank you!

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

Re: Perturbation triggered by contact event

Post by Thomas Geijtenbeek » Thu Nov 26, 2020 1:27 am

Good to hear you find SCONE useful!

Perturbations via the PerturbationController are always triggered at a specific time. Alternatively, you can apply perturbations via the ScriptController (just make sure to set enable_external_forces = 1). Depending on your goal, you can either:
  1. Evaluate an optimized result and see at what time the event you're looking for takes place. You can then set the time in the PerturbationController to match this event. This does require the timing of the event to be fixed.
  2. Create your own script using a ScriptController and detect the contact event by monitoring the ground reaction force. You can then apply any perturbation force at any event you define in the script. Tutorial 6b should help to get you started with this.
Let me know if this helps!

User avatar
Jerome Hausselle
Posts: 4
Joined: Tue May 12, 2009 2:09 am

Re: Perturbation triggered by contact event

Post by Jerome Hausselle » Fri Nov 27, 2020 12:25 pm

Thank you for your quick answer!

I tried option 1 but when I ran the simulation again the timing of the event changed (I guessed because the optimized parameters were slightly different). Is-it possible to run a "basic" forward simulation with SCONE (i.e. input conditions and the optimized parameters)?

I will try option 2 and keep you posted.

Thank you!

User avatar
Jerome Hausselle
Posts: 4
Joined: Tue May 12, 2009 2:09 am

Re: Perturbation triggered by contact event

Post by Jerome Hausselle » Fri Nov 27, 2020 8:25 pm

I followed you advice for option #2 and it works perfectly!
Thank you so much!

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

Re: Perturbation triggered by contact event

Post by Thomas Geijtenbeek » Mon Nov 30, 2020 2:24 am

That's great to hear, thanks!

In answer to your previous question: you can run a simulation with optimized parameters by specifying an init_file in the Optimizer, and pressing Ctrl + E to evaluate the scenario. However, this will use the population mean instead of the population best from the .par file, so the results will be slightly different than the optimized results. They will be consistent though, so you should get your timing here instead of from the optimized results.

User avatar
Jerome Hausselle
Posts: 4
Joined: Tue May 12, 2009 2:09 am

Re: Perturbation triggered by contact event

Post by Jerome Hausselle » Mon Nov 30, 2020 8:52 am

I did not realize it was using the mean individual and not the best, I guess I will test both options.
Thank you so much for your help and your quick replies!

User avatar
vahid F
Posts: 19
Joined: Mon Jul 23, 2018 8:02 am

Re: Perturbation triggered by contact event

Post by vahid F » Mon Dec 04, 2023 2:21 am

Dear Thomas,

I'm wondering if there is a way to use population best from the .par file instead of population mean, while evaluating a .scone scenario using init function?

tgeijten wrote:
Mon Nov 30, 2020 2:24 am
That's great to hear, thanks!

In answer to your previous question: you can run a simulation with optimized parameters by specifying an init_file in the Optimizer, and pressing Ctrl + E to evaluate the scenario. However, this will use the population mean instead of the population best from the .par file, so the results will be slightly different than the optimized results. They will be consistent though, so you should get your timing here instead of from the optimized results.

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

Re: Perturbation triggered by contact event

Post by Thomas Geijtenbeek » Mon Dec 04, 2023 2:28 am

Yes, you can, using the new init syntax:

Code: Select all

init { file = par_file.par use_best_as_mean = 1 }
For more information, see:

https://scone.software/doku.php?id=ref: ... t_settings

POST REPLY