-
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] #76 Add General Spherical joint #85
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.
Here is my little comments.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @ANaaim)
bionc/bionc_casadi/enums.py
line 21 at r1 (raw file):
UNIVERSAL = Joint.Universal SPHERICAL = Joint.Spherical GENERAL_SPHERICAL = Joint.GeneralSpherical
to be removed
bionc/bionc_casadi/joint.py
line 415 at r1 (raw file):
), self.child_constraint_jacobian_derivative(Qdot_parent, Qdot_child) class GeneralSpherical(JointBase):
Like said in the issue #76 , we should merge the feature of the existing class Spherical.
The default behavior should take parent and child as default points, or it should use the specified points, if any.
bionc/bionc_casadi/joint.py
line 438 at r1 (raw file):
self.nb_constraints = 3 self.parent_point = parent.marker_from_name(parent_point)
In the future class
self.parent_point = (
NaturalMarker(
name=f"{self.name}_parent_point",
position=NaturalVector.distal(),
is_technical=False,
is_anatomical=True,
)
if parent_point is None else parent.marker_from_name(parent_point)
)
self.parent_point = (
NaturalMarker(
name=f"{self.name}_child_point",
position=NaturalVector.proximal(),
is_technical=False,
is_anatomical=True,
)
if parent_point is None else parent.marker_from_name(parent_point)
)
bionc/bionc_casadi/joint.py
line 439 at r1 (raw file):
self.nb_constraints = 3 self.parent_point = parent.marker_from_name(parent_point) self.child_point = child.marker_from_name(child_point)
Explained over this.
bionc/bionc_casadi/joint.py
line 470 at r1 (raw file):
) -> MX: K_k_parent = MX.zeros((self.nb_constraints, 12)) K_k_parent[:3, 6:9] = self.parent_point.interpolation_matrix
I think the slicing should be [:3, : ]
bionc/bionc_casadi/joint.py
line 478 at r1 (raw file):
) -> MX: K_k_child = MX.zeros((self.nb_constraints, 12)) K_k_child[:3, 3:6] = -self.child_point.interpolation_matrix
idem
bionc/bionc_numpy/enums.py
line 21 at r1 (raw file):
UNIVERSAL = Joint.Universal SPHERICAL = Joint.Spherical GENERAL_SPHERICAL = Joint.GeneralSpherical
to be removed
bionc/bionc_numpy/joint.py
line 513 at r1 (raw file):
self.nb_constraints = 3 self.parent_point = parent.marker_from_name(parent_point) self.child_point = child.marker_from_name(child_point)
same comment as for casadi
bionc/bionc_numpy/joint.py
line 544 at r1 (raw file):
) -> np.ndarray: K_k_parent = np.zeros((self.nb_constraints, 12)) K_k_parent[:3, 6:9] = self.parent_point.interpolation_matrix
same slicing error
bionc/bionc_numpy/joint.py
line 552 at r1 (raw file):
) -> np.ndarray: K_k_child = np.zeros((self.nb_constraints, 12)) K_k_child[:3, 3:6] = -self.child_point.interpolation_matrix
same slicing error
bionc/bionc_numpy/joint.py
line 611 at r1 (raw file):
The joint as a mx joint """ # TODO: implement this in joint casadi
should be fined to remove if Done, I guess.
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.
Almost done ! I like the fact you spotted some errors in my docstrings 🙈
Please clic on the violet button "Reviewable", to write "Done" under each comment that has been treated.
Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @ANaaim)
bionc/bionc_casadi/joint.py
line 415 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
Like said in the issue #76 , we should merge the feature of the existing class Spherical.
The default behavior should take parent and child as default points, or it should use the specified points, if any.
Please write "Done" under each comment is treated, so I can remove the comments when the action has been done.
bionc/bionc_casadi/joint.py
line 342 at r2 (raw file):
): super(Joint.Spherical, self).__init__( name, parent, child, index, parent_point, child_point, projection_basis, parent_basis, child_basis
"parent_point", "child_point" have to be removed, that's why the tests are not passing.
"Super" calls the parent class JointBase
that has common entries for every joint. As all joints doesn't have a parent and child point yet.
It's not relevant to initialize them now. But this would be a great idea in the future !
Then, to initialize parent and child point with proximal and distal point would be automated for every joint, in the parent class JointBase
to avoid redundancy.
- So, can you remove it for now? And make your PR pass.
- Can you open an issue about it ? :)
Previously, Ipuch (Pierre Puchaud) wrote…
Done |
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 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @ANaaim)
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 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @ANaaim)
Previously, Ipuch (Pierre Puchaud) wrote…
Done |
Previously, Ipuch (Pierre Puchaud) wrote…
Done. |
Previously, Ipuch (Pierre Puchaud) wrote…
Done |
Previously, Ipuch (Pierre Puchaud) wrote…
Done (Both) |
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.
Done
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @Ipuch)
bionc/bionc_casadi/joint.py
line 438 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
In the future class
self.parent_point = ( NaturalMarker( name=f"{self.name}_parent_point", position=NaturalVector.distal(), is_technical=False, is_anatomical=True, ) if parent_point is None else parent.marker_from_name(parent_point) ) self.parent_point = ( NaturalMarker( name=f"{self.name}_child_point", position=NaturalVector.proximal(), is_technical=False, is_anatomical=True, ) if parent_point is None else parent.marker_from_name(parent_point) )
Done.
bionc/bionc_casadi/joint.py
line 439 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
Explained over this.
Done.
bionc/bionc_casadi/joint.py
line 470 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
I think the slicing should be
[:3, : ]
Done.
bionc/bionc_casadi/joint.py
line 478 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
idem
Done.
bionc/bionc_numpy/joint.py
line 552 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
same slicing error
Done.
bionc/bionc_casadi/enums.py
line 21 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
to be removed
Done.
bionc/bionc_numpy/enums.py
line 21 at r1 (raw file):
Previously, Ipuch (Pierre Puchaud) wrote…
to be removed
Done.
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.
black, and ready to merge I think !!
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ANaaim)
tests/test_joints.py
line 100 at r5 (raw file):
assert joint.nb_joint_dof == 3 assert joint.nb_constraints == 3
Just put a comment to explain why we need two joints, or name them better:
"joint_distal_proximal" and "joint_custom_location".
tests/test_joints.py
line 706 at r5 (raw file):
# # jacobian_mx = j_jacobian_func(np.arange(24)).toarray() # def joint_spherical_not_distal_proximal():
plz remove the last line. :)
Previously, Ipuch (Pierre Puchaud) wrote…
Done |
Previously, Ipuch (Pierre Puchaud) wrote…
Done |
Done |
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 r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ANaaim)
black . -l120
This change is