-
Notifications
You must be signed in to change notification settings - Fork 59
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
Unnecessary equal operators #1114
Comments
Thank you! I build common_interfaces package and checking automatically generated equal operator for Float64 type value, it seems it is not consider machine epsilon. bool operator==(const Float64_ & other) const
{
if (this->data != other.data) {
return false;
}
return true;
} |
If the operator does not consider machine epsilon, I think the automatically generated operator should not be used and compilation error does not raised in my environment and CI/CD environment. |
The default operator does not consider epsilon as you said, but it can be confusing to have to use the operator explicitly. vector0 == vector1; This is the most common way to use the operator I think. I have created an example test case showcasing the problem here. When compiling the code from this branch the error can be observed. I found it confusing to have to use one operator explicitly as I have not found any note about this. However if you consider this to be a correct behavior then please close this issue. |
I see, I encounter error. |
#1139 was merged |
Describe the bug
The functions below generate compilation errors.
scenario_simulator_v2/common/math/geometry/include/geometry/linear_algebra.hpp
Lines 53 to 54 in 173a8c1
Both equal operators are ambiguous. ROS2 message types have automatically generated equal operator member function. Any usage of the aforementioned functions results in a compilation error.
It is unnecessary to keep functions that cannot be used, so I suggest removing these functions.
Context:
I am adding unit tests for the
geometry
package and wanted to add tests for these functions as well, but as it turns out they cannot be used.To Reproduce
Steps to reproduce the behavior:
linear_algebra.hpp
header fileExpected behavior
Using
Point
andVector3
equal operator should result in a correct evaluation and not in a compilation error.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: