Where can I find the modified .osim file?
Posted: Wed May 06, 2020 6:04 am
Hi all,
After I successfully run the .m file to add a torque actuator to the gait2354_simbody.osim file, where can I find the modified model and open it in OpenSim? I tried to open the original gait2354_simbody.file but the actuator doesn't exist.
As a reference, the .m file is shown below:
myModel = Model('gait2354_simbody.osim'); % Create a Model Object from file
femur_r = myModel.getBodySet().get('femur_r'); % Get a handle to the femur
tibia_r = myModel.getBodySet().get('tibia_r'); % Get a handle to the tibia
zAxis = Vec3(0,0,1); % A Vec3 of the z-axis
torqueActuator = TorqueActuator(); % Create a TorqueActuator Object
torqueActuator.setBodyA(femur_r); % Set BodyA
torqueActuator.setBodyB(tibia_r); % Set BodyB
torqueActuator.setAxis(zAxis); % Set the axis about which the torque will act
torqueActuator.setOptimalForce(10); % Set the optimal force (gain) of the actuator
Caesar
After I successfully run the .m file to add a torque actuator to the gait2354_simbody.osim file, where can I find the modified model and open it in OpenSim? I tried to open the original gait2354_simbody.file but the actuator doesn't exist.
As a reference, the .m file is shown below:
import org.opensim.modeling.*
myModel = Model('gait2354_simbody.osim'); % Create a Model Object from file
femur_r = myModel.getBodySet().get('femur_r'); % Get a handle to the femur
tibia_r = myModel.getBodySet().get('tibia_r'); % Get a handle to the tibia
zAxis = Vec3(0,0,1); % A Vec3 of the z-axis
torqueActuator = TorqueActuator(); % Create a TorqueActuator Object
torqueActuator.setBodyA(femur_r); % Set BodyA
torqueActuator.setBodyB(tibia_r); % Set BodyB
torqueActuator.setAxis(zAxis); % Set the axis about which the torque will act
torqueActuator.setOptimalForce(10); % Set the optimal force (gain) of the actuator
Thank you for your help!
Caesar