Dear Thomas,
I hope this email finds you well.
I am currently starting to use SCONE. It is wonderful and powerful to implement the prediction simulation.
Now I am trying to build up the controller via the script controller.
I have a question regarding the neural delay in the script controller.
I am starting to study the spinal circuit and want to use the script controller to perform the simulation.
Is there any way to apply the neural delay in the script controller?
The method I think is to use the model: time()/delta_time(), if statement, add_input () to add some reflex inputs into the muscle excitation/actuator input parallel with default excitation.
Sincerely regards,
Yihui
Neural delay in the scriptcontroller
- Thomas Geijtenbeek
- Posts: 432
- Joined: Wed Mar 12, 2014 8:08 am
Re: Neural delay in the scriptcontroller
In order to get accurate neural delays with good simulation performance, it is advised to always use the ReflexController.
If you need the ScriptController to activate/deactivate different reflexes during the simulation, you can use the ReflexController in combination with the ScriptController and get the best of both worlds. In order to do so, add any number of ReflexControllers as children to your ScriptController:
After that, you can enable/disable individual ReflexControllers in the update() function of your script:
Please let me know if this helps!
If you need the ScriptController to activate/deactivate different reflexes during the simulation, you can use the ReflexController in combination with the ScriptController and get the best of both worlds. In order to do so, add any number of ReflexControllers as children to your ScriptController:
Code: Select all
ScriptController {
script_file = "data/my_script_file.lua"
ReflexController {
...
}
ReflexController {
...
}
}
Code: Select all
function update( model, time, controller )
-- enable only the first ReflexController
controller:set_child_enabled( 1, true )
controller:set_child_enabled( 2, false )
end
- Yihui Zhao
- Posts: 7
- Joined: Thu Mar 15, 2018 8:11 am
Re: Neural delay in the scriptcontroller
Dear Thomas,
Thanks for your reply.
I was away for a workshop yesterday.
I got an error pop up when I implement the enable/disable the controller, which shows that the index should between 1 and 1.
Many thanks,
Yihui
Thanks for your reply.
I was away for a workshop yesterday.
I got an error pop up when I implement the enable/disable the controller, which shows that the index should between 1 and 1.
Many thanks,
Yihui
- Attachments
-
- Screenshot 2023-09-07 102954.jpg (72.12 KiB) Viewed 204 times
- Thomas Geijtenbeek
- Posts: 432
- Joined: Wed Mar 12, 2014 8:08 am
Re: Neural delay in the scriptcontroller
It appears you have misspelled the first child controller, so only one child controller is created.
- Yihui Zhao
- Posts: 7
- Joined: Thu Mar 15, 2018 8:11 am
Re: Neural delay in the scriptcontroller
Thanks Thomas!