-
Notifications
You must be signed in to change notification settings - Fork 38
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
Check if constants should be replaced by user-configurable parameters #35
Comments
These are meant for numerical comparisons. Like in c++ you cannot compare floats directly. But good practice is not to use EPS itself but choose a domain-specific smallest number. So I think these can stay without being parameterised.
This is a workaround for INF missing in the message. For Robot domain I think we're good here. I agree that all others can be parameterised. Is it worth doing though? Without someone actually asking for this, it just makes the package more complex. |
Just to be 100% sure we're talking about the same thing: A magic value is an unnamed literal value which is directly used in the code. The examples you listed above are constants and that's fine. Maybe they can be replaced with variables, removed or given more descriptive names but they are not magic values. Not a magic value: double upper_limit_ = 100.0; Magic value: if (abs(new_nominal_x_vel) < 0.01) |
I stand corrected. Nonetheless, at least some of these values should be made configurable for the user. Do you have a suggestion for an alternative issue title? |
"Replace constants with user configurable settings" of |
In a few places, there's magic numbers in the code. We may want to get rid of those. Some examples:
path_tracking_pid/include/path_tracking_pid/controller.hpp
Lines 22 to 24 in 1495813
path_tracking_pid/include/path_tracking_pid/path_tracking_pid_local_planner.hpp
Lines 24 to 25 in 1495813
path_tracking_pid/include/path_tracking_pid/controller.hpp
Lines 330 to 338 in 1495813
The text was updated successfully, but these errors were encountered: