Page 1 of 1
Use Scone to set body trajectory
Posted: Thu May 14, 2020 12:58 am
by konris87
Greetings,
I have recently started to experiment with Scone and I have a question. Is it possible to set up a scone scenario, where a certain body or end point (e.g. fingertip) follows a user defined trajectory (a 2D rotary motion)? I suppose the Jump scripting example can be useful?
Also, i have a problem with the 3D viewer, it just disappeared and i cant find a way to make it visible again.
Kind regards,
Konstantinos Risvas
University of Patras
Re: Use Scone to set body trajectory
Posted: Fri May 15, 2020 4:29 am
by tgeijten
The best approach is indeed to use a
ScriptMeasure, as it gives you the most flexibility. Inside your lua script, you can track a body by using the following code as a basis:
Code: Select all
function init( model )
-- find the body you want to track
body = model:find_body( "yourbodyname" )
-- keep track of the error
tracking_error = 0
end
function update( model )
-- get current com position
local pos = body:com_pos()
-- update the tracking error
tracking_error = tracking_error + <insert your algorithm here>
return false
end
function result( model )
-- This function is called at the end of the simulation
return tracking_error
end
Concerning the missing 3D viewer, do you remember what happened before it disappeared?
For now, you can fix it by deleting the following entry in the windows registry:
Code: Select all
HKEY_CURRENT_USER\Software\SCONE\SconeStudio
Let me know if this helps!
Re: Use Scone to set body trajectory
Posted: Fri May 15, 2020 4:45 am
by konris87
Thanks a lot, now the 3D viewer appears again. if i remember correctly, before it disappeared i exited Scone while an optimization was running (actually my pc restarted).
Kind regards,
Konstantinos
Re: Use Scone to set body trajectory
Posted: Sat May 16, 2020 9:48 am
by konris87
Greetings again,
I would like to use Mobl model of upper extremity to perform the above trajectory tracking. Since all examples are for gait or jump, is there something i need to consider or set up in order to make the model work? Also, when I try to use a similar approach as with standing jump, in order to move the hand up, the optimization process takes forever to start even if i greatly reduce the model's complexity.
Kind regards,
Konstantinos
Re: Use Scone to set body trajectory
Posted: Fri May 29, 2020 12:24 pm
by tgeijten
Sorry for the late response, I missed your post! Please check out
this suggestion.