Changing muscle type from existing model
Posted: Tue Mar 11, 2025 12:08 am
Hello,
I'm trying to introduce fatigable muscles from the example provided into the Arm26 model. For that, I used the following:
When changing the muscles to Millard2012, there's no issue, but it crashes when doing it with the new muscles. I tried to change the constructor of the FatigableMuscle to match Thelen's and Millard's but is still crashing.
The other issue I'm having is that, even with the original Thelen muscles, using the PrescribedController to manage the model's actuators is crashing. I was using the following with no avail:
Any help would be appreciated!
Best regards,
Maria C.
I'm trying to introduce fatigable muscles from the example provided into the Arm26 model. For that, I used the following:
Code: Select all
// Changing muscles from Thelen2003 to new FatigableMuscle
Object::renameType("Thelen2003Muscle", "FatigableMuscle");
// Arm26 instance
Model osimModel("arm26.osim");
The other issue I'm having is that, even with the original Thelen muscles, using the PrescribedController to manage the model's actuators is crashing. I was using the following with no avail:
Code: Select all
PrescribedController* muscleController = new PrescribedController();
muscleController->setActuators(osimModel.updActuators());
// Set the prescribed muscle controller to use the same muscle control function for each muscle
muscleController->prescribeControlForActuator("BRA", new Constant(0.5);
osimModel.addController(muscleController);
Best regards,
Maria C.