Changing muscle type from existing model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Maria Cordero
Posts: 6
Joined: Mon Jun 17, 2024 12:38 am

Changing muscle type from existing model

Post by Maria Cordero » 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:

Code: Select all

  
  // Changing muscles from Thelen2003 to new FatigableMuscle
  Object::renameType("Thelen2003Muscle", "FatigableMuscle");

  // Arm26 instance
  Model osimModel("arm26.osim");
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:

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);
Any help would be appreciated!

Best regards,
Maria C.

Tags:

POST REPLY