-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Update of the inertial parameters #100 #105
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ANaaim)
bionc/model_creation/biomechanical_model_template.py
line 129 at r1 (raw file):
inertia_matrix=s.inertia_parameters.inertia, transformation_matrix=TransformationMatrixType.Buv, )
Okay, does this works for you ? here are my toughts:
The user should only be considered by the choice of Inertia Parameters Antropometric Table Item such as Dumas2007.Thigh for example.
thus, at that stage we need to be able to pass the length computed just before ("v = rp -rd") to compute the inertia parameters from the identified length.
What do you think ?
Also, if we uncomment this feature, we need to test to maintain it 👍
Code quote:
natural_segment.set_inertial_parameters(
mass=s.inertia_parameters.relative_mass,
center_of_mass=s.inertia_parameters.center_of_mass,
inertia_matrix=s.inertia_parameters.inertia,
transformation_matrix=TransformationMatrixType.Buv,
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ANaaim)
bionc/model_creation/biomechanical_model_template.py
line 129 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
Okay, does this works for you ? here are my toughts:
The user should only be considered by the choice of Inertia Parameters Antropometric Table Item such as Dumas2007.Thigh for example.
thus, at that stage we need to be able to pass the length computed just before ("v = rp -rd") to compute the inertia parameters from the identified length.What do you think ?
Also, if we uncomment this feature, we need to test to maintain it 👍
model["THIGH"].set_inertia_paramters(
mass=
center_of_mass_inertia=
inertia=
)
def set_inertial_parameters(
self,
mass: float,
center_of_mass: np.ndarray,
inertia_matrix: np.ndarray,
transformation_matrix: TransformationMatrixType,
):
self._natural_inertial_parameters = NaturalInertialParameters.from_cartesian_inertial_parameters(
mass=mass,
center_of_mass=center_of_mass,
inertia_matrix=inertia_matrix,
inertial_transformation_matrix=self.compute_transformation_matrix(transformation_matrix),
)
self._mass = mass
self._natural_center_of_mass = self._natural_inertial_parameters.natural_center_of_mass
self._natural_pseudo_inertia = self.natural_pseudo_inertia
self._mass_matrix = self._natural_inertial_parameters.mass_matrix
Do not forget to use |
Should i still work on this ? |
I think this PR should be closed as this is not the spirit of the model creation to allow passing numerical values. But mostly to pass the numerical values after the "kinematic model only was updated", like I said in my last comment. model["THIGH"].set_inertia_paramters(
mass=1,
center_of_mass_inertia=[1,2,3],
inertia=[1,2,3,4,5,6],
)
def set_inertial_parameters(
self,
mass: float,
center_of_mass: np.ndarray,
inertia_matrix: np.ndarray,
transformation_matrix: TransformationMatrixType,
):
self._natural_inertial_parameters = NaturalInertialParameters.from_cartesian_inertial_parameters(
mass=mass,
center_of_mass=center_of_mass,
inertia_matrix=inertia_matrix,
inertial_transformation_matrix=self.compute_transformation_matrix(transformation_matrix),
)
self._mass = mass
self._natural_center_of_mass = self._natural_inertial_parameters.natural_center_of_mass
self._natural_pseudo_inertia = self.natural_pseudo_inertia
self._mass_matrix = self._natural_inertial_parameters.mass_matrix I don't remember if I implemented it. |
black . -l120
This change is