-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add parametrization w.r.t Hardware Parameters #49
Conversation
… implement change in representation in parametrix
Solved the CI in 5bec824 I added a workaround to avoid reading the line of the stickbot urdf declaring the XML encoding, this was an outcome of a conversation done in icub-tech-iit/ergocub-gazebo-simulations#49 (comment) |
Can't we add the hack directly in https://github.com/CarlottaSartore/ADAM/blob/3ad9e5d64a3469856db22b8f7e3f35422b40f0db/src/adam/core/urdf_tree.py#L45 ? Otherwise ADAM will continue to not work for stickbot or similar models. |
For me, it is fine, if @Giulero agrees I can add it directly to this PR |
By the way, a compact way to remove the header if present seems to be: output_xml_string = ET.tostring(ET.fromstring(input_xml_string), xml_declaration=False) This is a bit more robust as the xml declaration could also have a non-UTF-8 encoding, or also have other attributes such as |
About this
Thanks to ros/urdf_parser_py#83 (comment) we should have it fixed now! @Giulero I have implemented the refactor we talked f2f and the CI passed ! |
Sorry, I missed something. How it is possible that that fixed the problem if it still needs to be merged and released? |
|
Sure, but how why the CI is green now? |
In 5bec824 I have modified the CI to remove the encoding of the stickbot, thus the CI runs, see But the problem is not solved in adam itself |
Ahh so we have still the workaround, I missed that. |
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.
Just few comments!
T[0, 3] = xyz[0] | ||
T[1, 3] = xyz[1] | ||
T[2, 3] = xyz[2] |
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.
Can you remember me why the assignment T[:3, 3] = xyz
does not work?
It's more of a log for the feature :)
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.
The issue was that xyz contains both symbolic and not symbolic elements if the robot model is parametric, therefore it was complaining due to different types in xyz !
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.
Got it!
src/adam/core/spatial_math.py
Outdated
@@ -381,6 +400,33 @@ def spatial_inertia( | |||
IO[:3, :3] = self.factory.eye(3) * mass | |||
return IO | |||
|
|||
def spatial_inertial_with_parameter(self, I, mass, c, rpy): |
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.
parameter
or parameters
?
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 in ab08cf9
root_link (str, optional): the first link. Defaults to 'root_link'. | ||
""" | ||
math = SpatialMath() | ||
n_param_link = len(links_name_list) |
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.
link
or links
?
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 in ab08cf9
Co-authored-by: Giuseppe L'Erario <[email protected]>
@Giulero I should have resolved all your comments, however I see the CI fails, namely the one related to |
Thanks @CarlottaSartore! Yeah the CI fails since there are some issues related to the new default Python version in conda. |
Thanks @CarlottaSartore ! I guess we can merge :) |
With this PR the changes done in the tag
AdamWithHardwareParameters
have been ported into main .@Giulero I have tried to be compliant with the refactor you did in #37, but please let me know if you would prefer a different code organization :)
Currently the CI are failing due to #icub-tech-iit/ergocub-gazebo-simulations#49 but in my machine everything is working fine, I will update the CI as soon as we find a way to solve the issue.
C.C. @S-Dafarra @lrapetti @traversaro