Page 1 of 1
Perturbation triggered by contact event
Posted: Wed Nov 25, 2020 10:50 am
by hausselle
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!
Re: Perturbation triggered by contact event
Posted: Thu Nov 26, 2020 1:27 am
by tgeijten
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:
- 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.
- 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!
Re: Perturbation triggered by contact event
Posted: Fri Nov 27, 2020 12:25 pm
by hausselle
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!
Re: Perturbation triggered by contact event
Posted: Fri Nov 27, 2020 8:25 pm
by hausselle
I followed you advice for option #2 and it works perfectly!
Thank you so much!
Re: Perturbation triggered by contact event
Posted: Mon Nov 30, 2020 2:24 am
by tgeijten
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.
Re: Perturbation triggered by contact event
Posted: Mon Nov 30, 2020 8:52 am
by hausselle
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!
Re: Perturbation triggered by contact event
Posted: Mon Dec 04, 2023 2:21 am
by vahid34
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.
Re: Perturbation triggered by contact event
Posted: Mon Dec 04, 2023 2:28 am
by tgeijten
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