Specifying initial height?

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
Nirav Maniar
Posts: 32
Joined: Tue May 12, 2015 11:03 pm

Specifying initial height?

Post by Nirav Maniar » Thu Sep 05, 2019 10:42 pm

Hi Thomas,

I am wondering if there is a way to specify the initial height of the model for a simulation? My goal is to investigate a drop landing task.

I have tried using the standing high jump tutorial as a starting point, as I thought it might create a "drop jump" sort of effect so long as the initial pelvis_ty value could be specified. I first tried modifying the baseline .osim model to have a default starting pelvis_ty of a high value (e.g. 1.4m), but it did not create the effect I was after. I also tried specifying an initial states.sto file, which I pulled from the standing balance tutorial, and then modified the pelvis_ty to a higher value, again with no success.

I'll admit my knowledge of the scone environment is still quite limited, so I could be missing something quite basic. Could you point me in the correct direction if what I am trying to do is indeed possible?

Cheers,
Nirav

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

Re: Specifying initial height?

Post by Thomas Geijtenbeek » Fri Sep 06, 2019 6:14 am

Hi Nirav,

Your approach to increase pelvis_ty is correct -- however, by default, SCONE moves the model so that it touches the ground plane with a specific force. You can disable this behavior by specifying an 'initial_load' of zero in the 'OpenSimModel' section of your .scone scenario:

Code: Select all

OpenSimModel {
	model_file = data/Human0914.osim
	initial_load = 0
}
Let me know if this works!

P.S. I noticed this feature is missing in the documentation, I'll make sure it gets updated.

User avatar
Nirav Maniar
Posts: 32
Joined: Tue May 12, 2015 11:03 pm

Re: Specifying initial height?

Post by Nirav Maniar » Sun Oct 06, 2019 9:51 pm

tgeijten wrote:
Fri Sep 06, 2019 6:14 am
Hi Nirav,

Your approach to increase pelvis_ty is correct -- however, by default, SCONE moves the model so that it touches the ground plane with a specific force. You can disable this behavior by specifying an 'initial_load' of zero in the 'OpenSimModel' section of your .scone scenario:

Code: Select all

OpenSimModel {
	model_file = data/Human0914.osim
	initial_load = 0
}
Let me know if this works!

P.S. I noticed this feature is missing in the documentation, I'll make sure it gets updated.
Hi Thomas,

Thank you for the suggestion, that worked perfectly as I now have the model started above the ground as desired. I have been spending the last few weeks trying a few different constraints to create either a drop jump or drop landing (i.e. landing from a height without jumping up again), and have a couple more questions if you do not mind.

To make the model jump, I have included a BodyMeasure aiming to maximise the vertical velocity of the pelvis. However, from looking at the documentation, I have been unable to work out exactly how to do this. I have achieved reasonable results by including the following in my composite measure (along with a few other measures e.g. balance), but could you advise me on how to maximise vertical pelvis velocity if this is incorrect?

Code: Select all

BodyMeasure {
	body = pelvis
	axes_weights [ 0 100 0 ]
	velocity { min = 0 max = 0 abs_penalty = -100 } #negative penalty seems to produce the right sort of motion
	minimize = true
	weight = 1000
	threshold = 0
	start_time = 0.145 #this is approximately when the model lands
}
 
In addition, I have also tried minimising pelvis vertical velocity in order to try to make the model land (but not necessarily jump up again). I have tried writing this a few different ways, but it seems to produce identical results even if I change some of the settings (which leads me to believe I have not understood the documentation correctly).

Here was my first attempt for a measure to minimise vertical velocity of the pelvis.

Code: Select all

BodyMeasure {
	body = pelvis
	axes_weights = [0 100 0]
	velocity { min = -inf max = inf abs_penalty = -100 } 
	minimize = true
	weight = 1000
	threshold = 0
	start_time = 0.145
}
This produced a very "stiff" landing, so I tried to also minimise the "peak" vertical acceleration, but it made no difference.

Code: Select all

BodyMeasure {
	body = pelvis
	axes_weights = [0 100 0]
	velocity { min = -inf max = inf abs_penalty = -100 } 
	acceleration { min = -inf max = inf abs_penalty = -100 mode = highest } #changing the penalties did not change anything
	minimize = true
	weight = 1000
	threshold = 0
	start_time = 0.145
}
Since that did not work, I tried adding a measure to minimise the peak ground reaction force to the composite measure, but again my results were identical.

Code: Select all

BodyMeasure {
	body = pelvis
	axes_weights = [0 100 0]
	velocity { min = -inf max = inf abs_penalty = -100 }  #just velocity this time, left out the acceleration component
	minimize = true
	weight = 1000
	threshold = 0
	start_time = 0.145
}

#measure to minimise GRF, not sure if I have done this correctly. I tried to set a range similar to the BodyMeasure above, but kept getting errors.
ReactionForceMeasure {
	abs_penalty = -100 
	mode = highest 
	minimize = true
	weight = 1000 #I even bumped this up to 10000 with no difference. 
}
I am probably making basic errors, but any advice/suggestions you can provide would be appreciated.

Cheers,
Nirav

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

Re: Specifying initial height?

Post by Thomas Geijtenbeek » Wed Oct 09, 2019 5:23 am

Hi Nirav,

Good to hear you got it working. A couple of things that might help:
  • If you use BodyMeasure, you have to specify a valid min / max range (-inf / inf is not a valid range) -- the penalty will only be applied when a value is outside this range.
  • Look at the Standing Balance tutorial for a good example on how to define an objective for balancing. These should work for different initial heights after lowering the termination_height parameter in the BalanceMeasure.
  • The reflex-based control strategy used in the standing balance tutorial might work better for landing than just a FeedForward controller.
  • To penalize stiff landings, add a ReactionForceMeasure. Make sure to tweak the penalty weighting and the max of the range.
  • When combining different measures in a CompositeMeasure, you can see the individual contributions in the Messages Window after running the simulation (Ctrl + T). This can be very useful for tweaking the weights and the offsets.
  • If you want full control over your objective function (useful for complex tasks such as jumping after landing), using a ScriptMeasure is probably the way to go. See Tutorial 6a for a good starting point for writing a custom script Measure.
Hope this helps!

POST REPLY