Use Scone to set body trajectory

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
Kostas Risvas
Posts: 12
Joined: Thu Oct 03, 2019 10:24 pm

Use Scone to set body trajectory

Post by Kostas Risvas » Thu May 14, 2020 12:58 am

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

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

Re: Use Scone to set body trajectory

Post by Thomas Geijtenbeek » Fri May 15, 2020 4:29 am

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!

User avatar
Kostas Risvas
Posts: 12
Joined: Thu Oct 03, 2019 10:24 pm

Re: Use Scone to set body trajectory

Post by Kostas Risvas » Fri May 15, 2020 4:45 am

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

User avatar
Kostas Risvas
Posts: 12
Joined: Thu Oct 03, 2019 10:24 pm

Re: Use Scone to set body trajectory

Post by Kostas Risvas » Sat May 16, 2020 9:48 am

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

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

Re: Use Scone to set body trajectory

Post by Thomas Geijtenbeek » Fri May 29, 2020 12:24 pm

Sorry for the late response, I missed your post! Please check out this suggestion.

POST REPLY