Using MATLAB to Change Spring Properties
Posted: Mon Nov 20, 2023 10:31 am
Hello,
I am a student at the University of Utah doing research in wearable robotics. I am relatively new to OpenSim and am using Moco to optimize spring parameters for a wearable device. My model has a path spring connected between the ankles and I am trying to modify the parameters of that spring (stiffness and rest length) in a MATLAB script.
I am having trouble knowing which commands to call to change the parameters of the spring. I am able to load in the spring into MATLAB as a force, but I am unsure how to change parameters from here because it loads spring into MATLAB as a 'force' and not as a .pathSpring'.
Spring = model.getForceSet().get('Spring');
The alternative method that I have been attempting is to just make a new path spring, set the parameters I desire, then add the spring to the model. However, I am also having trouble with specifying the geometry path between the ankles. To create the spring originally, I edited the .osim file in a text editor to include a path spring between two path points. How would I specify a geometry path between two path points in MATLAB?
I have also tried to specify the geometry path by using the getGeometryPath(Spring) command after the above command, but that does not work.
I could also just edit the .osim file in MATLAB but I would prefer to use OpenSim commands.
If you have any advice to give me, I would greatly apricate it.
I am a student at the University of Utah doing research in wearable robotics. I am relatively new to OpenSim and am using Moco to optimize spring parameters for a wearable device. My model has a path spring connected between the ankles and I am trying to modify the parameters of that spring (stiffness and rest length) in a MATLAB script.
I am having trouble knowing which commands to call to change the parameters of the spring. I am able to load in the spring into MATLAB as a force, but I am unsure how to change parameters from here because it loads spring into MATLAB as a 'force' and not as a .pathSpring'.
Spring = model.getForceSet().get('Spring');
The alternative method that I have been attempting is to just make a new path spring, set the parameters I desire, then add the spring to the model. However, I am also having trouble with specifying the geometry path between the ankles. To create the spring originally, I edited the .osim file in a text editor to include a path spring between two path points. How would I specify a geometry path between two path points in MATLAB?
I have also tried to specify the geometry path by using the getGeometryPath(Spring) command after the above command, but that does not work.
I could also just edit the .osim file in MATLAB but I would prefer to use OpenSim commands.
If you have any advice to give me, I would greatly apricate it.