-
Notifications
You must be signed in to change notification settings - Fork 650
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
refactor: use __has_include for backward compatibility #2236
Conversation
@wep21 Does this PR make sense to you? |
Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
… utils.hpp Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
… roi_cluster_fusion/node.cpp Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
… laserscan_based_occupancy_grid_map_node.cpp Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
… pointcloud_based_occupancy_grid_map/occupancy_grid_map.cpp Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
… pointcloud_based_occupancy_grid_map_node.cpp Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
…clude Signed-off-by: Grzegorz Głowacki <Grzegorz Głowacki gglowacki@autonomous-systems.pl>
41e101f
to
8d1aff7
Compare
LGTM |
Yes, it makes sense to me, but cppcheck caused this error in |
@wep21 Seems like the issue in cppcheck is far from resolving it, is the inability to use cppcon a blocker? |
@ralwing Thank you for the PR. Since I have several concerns, I'll comment on them. First of all, as explained in https://github.com/orgs/autowarefoundation/discussions/2622, we'll move to Humble soon. And considering the transitioning tasks, I'm concerned about that this PR makes the tasks a little difficult. I'll explain the reason below. The
Let's think about when we remove the code for ROS distro compatibility. If there is only the But if @xmfcx What do you think? I'd like to hear your opinion. |
I don't mind header file being written twice, because it is still easier than writing a macro variable and the header. But like @kenji-miyake pointed, when we want to end galactic support, it will be hard to know what to remove. Example#ifdef ROS_DISTRO_GALACTIC
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif turns into: #if __has_include(<tf2_geometry_msgs/tf2_geometry_msgs.hpp> )
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#endif To make this easy to show that we are keeping #if __has_include(<tf2_geometry_msgs/tf2_geometry_msgs.hpp> )
// humble and later
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#else
// for galactic support
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#endif so that people who wants to deprecate the galactic can search for "for galactic support" to see the references. But this makes it longer. And if I agree it helps us remove dependency for a variable ( |
@ralwing Even if we are to make this change, please suggest and add an identifier keyword comment like |
@xmfcx Thanks for the detailed comment. And there is another reason. |
Codecov ReportBase: 11.15% // Head: 11.08% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2236 +/- ##
==========================================
- Coverage 11.15% 11.08% -0.07%
==========================================
Files 1200 1200
Lines 86184 86963 +779
Branches 20787 20882 +95
==========================================
+ Hits 9615 9644 +29
- Misses 66443 67184 +741
- Partials 10126 10135 +9
*This pull request uses carry forward flags. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
If I may @kenji-miyake, in my opinion refactor would be even easier, because You could simply
vs:
This slight difference could have complicated the refactor in the future.
Does this satisfy Your needs? If so I'll update this branch. |
@ralwing Thank you for your comment. My proposal is, as I wrote first, to wait for the Humble transition. Then we don't need
|
Also, CI build fails. I don't want to use much time for this now if there is no issue. |
@ralwing However, for future works, I'd appreciate it if you could explain the following things:
|
ok, i'm closing this. |
@ralwing Anyway, thank you again for the PR and patience! I really appreciate your contribution. |
This PR implements changes from #2235