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
Specifying initial height?
- Thomas Geijtenbeek
- Posts: 484
- Joined: Wed Mar 12, 2014 8:08 am
Re: Specifying initial height?
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:
Let me know if this works!
P.S. I noticed this feature is missing in the documentation, I'll make sure it gets updated.
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
}
P.S. I noticed this feature is missing in the documentation, I'll make sure it gets updated.
- Nirav Maniar
- Posts: 32
- Joined: Tue May 12, 2015 11:03 pm
Re: Specifying initial height?
Hi Thomas,tgeijten wrote: ↑Fri Sep 06, 2019 6:14 amHi 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:
Let me know if this works!Code: Select all
OpenSimModel { model_file = data/Human0914.osim initial_load = 0 }
P.S. I noticed this feature is missing in the documentation, I'll make sure it gets updated.
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
}
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
}
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
}
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.
}
Cheers,
Nirav
- Thomas Geijtenbeek
- Posts: 484
- Joined: Wed Mar 12, 2014 8:08 am
Re: Specifying initial height?
Hi Nirav,
Good to hear you got it working. A couple of things that might help:
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.