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!
About ScriptController parameter model
- Nathan Timmers
- Posts: 12
- Joined: Thu Apr 04, 2019 11:10 am
Re: About ScriptController parameter model
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
which could be in a ScriptController file for instance:
The output with the names will show up in the console of SCONE
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
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
Re: About ScriptController parameter model
You are correct! It's ok now.
Thank you very much for the answer and suggestion!
Thank you very much for the answer and suggestion!