About ScriptController parameter model

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
Wei Wang
Posts: 3
Joined: Thu Feb 20, 2020 12:21 am

About ScriptController parameter model

Post by Wei Wang » Thu Mar 19, 2020 12:53 am

Hi,

We revised 0914 model with an ideal ankle actuator called <CoordinateActuator name="Ankle_Exoskeleton_r">.

Then we want to use it in the ScriptController by command :
target_actuator = model:find_actuator("Ankle_Exoskeleton_r")

but an error shows that "Could not find 'Ankle_Exoskeleton_r'".

How can i solve this problem?

Thanks!

User avatar
Nathan Timmers
Posts: 12
Joined: Thu Apr 04, 2019 11:10 am

Re: About ScriptController parameter model

Post by Nathan Timmers » Thu Mar 19, 2020 4:35 am

If I am correct you can find the actuator just by using the actuated dof's name, thus:

target_actuator = model:find_actuator("ankle_r")

Another way to check which actuators are present, you can loop over the actuators in a lua script and display the names

Code: Select all

	scone.debug("\nActuators:")
	for i = 1, model:actuator_count(), 1 do
		scone.debug(model:actuator(i):name())
	end
which could be in a ScriptController file for instance:

Code: Select all


function init(model, par)

	scone.debug("\nActuators:")
	for i = 1, model:actuator_count(), 1 do
		scone.debug(model:actuator(i):name())
	end
	
end

function update(model)
	t = model:time()
	return false
end



The output with the names will show up in the console of SCONE

User avatar
Wei Wang
Posts: 3
Joined: Thu Feb 20, 2020 12:21 am

Re: About ScriptController parameter model

Post by Wei Wang » Thu Mar 19, 2020 4:53 am

You are correct! It's ok now.

Thank you very much for the answer and suggestion!

POST REPLY