Residual Reduction Algorithm, Tracking Tasks

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Max Riesbeck
Posts: 3
Joined: Mon Oct 14, 2024 3:34 am

Residual Reduction Algorithm, Tracking Tasks

Post by Max Riesbeck » Mon Oct 14, 2024 4:25 am

Hello everyone,

I am currently working on performing the Residual Reduction Algorithm (RRA), but I have been running into a persistent issue. Every time I try to run the RRA, I receive the following error:

Method Assembler::assemble() failed because:
Unable to achieve required assembly error tolerance.
Assembly error tolerance achieved: 5.2566849063404494e-09 required: 1e-10. Model relaxing constraints and trying again.
Requested COM adjustment time range 0.01 to 31.12, clamped to nearest available data times: 0.01 to 31.12.
Computing average residuals between 0.01 and 31.12...
InverseDynamics: ERROR - over-constrained system - need at least as many forces as there are degrees of freedom.

I think the problem might be related to missing Degrees of Freedom (DoF) in the script for the tracking tasks file. I used the default tracking tasks file from OpenSim, "gait10dof_Kinematics_Tracking_Tasks", and added all the necessary DoFs. I double-checked everything, and the DoFs in the tracking tasks file seem to match the forces in the IK file. I also tried excluding the DoFs that do not contain forces or values, but this did not solve the issue either.

Has anyone experienced a similar issue or can offer any insights on what might be going wrong? I would really appreciate any suggestions or ideas.

Here are the files I am using:

Tracking tasks file with all DoFs: gait10dof_Kinematics_Tracking_Tasks_New_FullDoF
Tracking tasks file without DoFs that have values 0: gait10dof_Kinematics_Tracking_Tasks_New_LowerDoF
Set file for GRF: LR02_CMJ_Set.xml
Reserve Actuators file: Reserve_Actuators.xml
IK file: LR_02_dl_CMJ_IK_SmallerFile.mot (this file contains only the first few seconds of the trial)
Here are all the DoFs from the file:

pelvis_tilt, pelvis_list, pelvis_rotation, pelvis_tx, pelvis_ty, pelvis_tz, hip_flexion_r, hip_adduction_r, hip_rotation_r, knee_angle_r, med_cond_adduction_r (0 values), lat_cond_adduction_r (0 values), knee_angle_r_beta, ankle_angle_r, subtalar_angle_r (0 values), mtp_angle_r (0 values), hip_flexion_l, hip_adduction_l, hip_rotation_l, knee_angle_l, med_cond_adduction_l (0 values), lat_cond_adduction_l (0 values), knee_angle_l_beta, ankle_angle_l, subtalar_angle_l (0 values), mtp_angle_l (0 values), lumbar_extension, lumbar_bending, lumbar_rotation, arm_flex_r, arm_add_r, arm_rot_r, elbow_flex_r, pro_sup_r, wrist_flex_r (0 values), wrist_dev_r (0 values), arm_flex_l, arm_add_l, arm_rot_l, elbow_flex_l, pro_sup_l, wrist_flex_l (0 values), wrist_dev_l (0 values)

Thanks in advance for your help!

Best regards,
Max
Attachments
LR_02_dl_CMJ_IK_SmallFile.mot.txt
(2.12 KiB) Downloaded 13 times
LR02_CMJ_Set.xml
(549 Bytes) Downloaded 12 times
Reserve_actuators.xml
(9.92 KiB) Downloaded 9 times
gait10dof_Kinematics_Tracking_Tasks_New_FullDoF.xml
(42.77 KiB) Downloaded 13 times
gait10dof_Kinematics_Tracking_Tasks_New_LowerDoF.xml
(30.28 KiB) Downloaded 11 times

Tags:

User avatar
Mohammadreza Rezaie
Posts: 407
Joined: Fri Nov 24, 2017 12:48 am

Re: Residual Reduction Algorithm, Tracking Tasks

Post by Mohammadreza Rezaie » Tue Oct 15, 2024 12:01 am

Hi, you need a tracking task for every free coordinate. The issue might also be your actuator file. Similarly, in RRA you need a strong coordinate actuator for every free coordinate, but weak residual actuator for pelvis coordinates.
(weld and locked coordinates must be excluded)

Hope this helps.

User avatar
Max Riesbeck
Posts: 3
Joined: Mon Oct 14, 2024 3:34 am

Re: Residual Reduction Algorithm, Tracking Tasks

Post by Max Riesbeck » Tue Oct 15, 2024 4:01 pm

Hi,

Thanks a lot for your reply, I appreciate it!

Could you elaborate a bit on what you mean with a free coordinate? Or do you have an example tracking task?
I'm still quite new to all this.

User avatar
Mohammadreza Rezaie
Posts: 407
Joined: Fri Nov 24, 2017 12:48 am

Re: Residual Reduction Algorithm, Tracking Tasks

Post by Mohammadreza Rezaie » Tue Oct 15, 2024 10:02 pm

Hi, sorry for brevity. Free coordinates are independent without any constraint, so the optimizer can change their values. The Coordinate::isConstrained method could help you find them; for example in Python:

Code: Select all

import opensim as osim

model = osim.Model('Rajagopal2016.osim')
state = model.initSystem()
for coordinate in model.getCoordinateSet():
    print(coordinate.getName(), coordinate.isConstrained(state))
Here is the tracking task of Rajagopal2016 model. For example, you can see the mtp_r coordinate is locked, and the knee_angle_r_beta has a coupler constraint, so they were excluded from both the tracking task and the actuator files:

https://github.com/opensim-org/opensim- ... walk_1.xml
https://github.com/opensim-org/opensim- ... uators.xml

Hope this helps.

User avatar
Max Riesbeck
Posts: 3
Joined: Mon Oct 14, 2024 3:34 am

Re: Residual Reduction Algorithm, Tracking Tasks

Post by Max Riesbeck » Wed Oct 16, 2024 1:23 am

It certainly does! Thanks a lot.

POST REPLY