Closed aaiaueil closed 7 months ago
If you think some modifications should be done we can take care of it! For now an ugly solution has been implemented to bypass this issue but I'm trying to overcome my ugly code phase
Removing raise is globally a bad idea, because I excluded cases where I know my code is not safe to be used. I prevent the user to do something wrong, and also for the developer removing a raise, is a huge responsibility.
Why can set your marker as an anatomical and a technical marker ? Would it work for you ? Nothing prevents you to define a marker as technical and as anatomical at the same time.
Because if the marker is labeled as a technical marker it will be used later for the optimisation process.
Does it work if you set istechnical to false for the given marker after having built the model ?
Ok, did not think that was possible ==> we will have a look at it.
My thoughts got clearer:
In which context do you used this function Q_from_markers? Is it absolutely useful ?
This function Q_from_markers estimates Qi of segment from experimental markers, so we cannot remove a marker. As it needs a specific set of markers to be evaluated...
The best way would be to build a new model not relaying on that marker...
Another avenue (not sure of what it cost in terms of implementation) would be to reset all the experimental functions of all segments excluding the marker you want.
Can you provide the full error message that initially came out ?
Q_initialize = model_init.Q_from_markers(marker_xp_initialize[:, :, 0:nb_frames])
model["LFOOT"].add_marker(
MarkerTemplate(name="left_heel", parent_name="LFOOT", is_technical=False, is_anatomical=True)
)
Ok so the problem is later... you should implement weights in inverse kinematics class add an extra argument that sets the weights to 1 to every marker if no weights are given, or take the user define weight list.
And yes, you cannot evaluate Qi through markers if you don't give the markers that has been used to build the model, that's the expected behavior
Normally, Q_from_markers is automatically called when you provide no Q_init to simplify the user interface.
Another way of by passing it, is to provide your custom Q_init to the inverse kinematics class so that it doesn't use Q_from_markers.
Can I close the issue ?
up @aaiaueil, @ANaaim ?
Would it be possible to use non technical markers to build the model?
In the function biomecanical_model.py on line 451 we had to do the following modification to use some non technical markers for the model creation. We are not sure with @ANaaim that only technical marker marker should pass down to the model creation. Any thought about it ? Did we do something ''illegal'' 👮♂️ ?