-
Notifications
You must be signed in to change notification settings - Fork 70
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
Optional def arg #565
Optional def arg #565
Conversation
I don't think they have triggered "garbage" values for exotica/exotations/exotica_core_task_maps/src/joint_pose.cpp Lines 85 to 110 in 79699fc
I.e. since they are correctly handled in the implementation they neither need a default value nor need to be required. For double/int/other standard types, this is, of course, different - but for Eigen-types we usually handle it well. |
These should be optional and set to empty vectors. |
I think I found another, more narrow bug related to this and will update #561 with my findings shortly. |
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.
Having dug into the issue with the minimal example you provided it seems that there are two distinct things at play:
(a) To require Optional arguments to have a default parameter - what you are proposing to fix in this PR. This should go ahead. Please revert and fix the change to JointPose though.
(b) The fact that Required
arguments are not enforced if the initializer is passed manually via Python. If you create the same example in XML, it throws.
This PR only addresses the issue that Optional parameters should have default arguments (a). It's not related to the bug that you can initialise Required parameters without a value via a Python dict (b). |
9c8c2e9
to
41a9cde
Compare
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.
Thank you for the fix :-) Happy to merge once CI goes green.
As discussed in #561, this PR changes the initialiser code generator to require default arguments for
Optional
paramters.It already triggered for the JointPose task map initiliasier (
Optional parameter 'JointRef' requires a default argument!
) which is a Eigen Matrix type and would load garbage values if not set by the user.What would be a good default value for these:
exotica/exotations/exotica_core_task_maps/init/joint_pose.in
Lines 1 to 6 in 79699fc
or should they be
Required
?Edit: I already made them
Required
to let the CI pass.