Skip to content
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

Deprecate PointCloud message and APIs using it #107

Merged
merged 2 commits into from
Apr 17, 2020

Conversation

tfoote
Copy link
Contributor

@tfoote tfoote commented Apr 11, 2020

Fixes #105

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@tfoote tfoote self-assigned this Apr 11, 2020
@@ -71,6 +75,7 @@ static inline int getPointCloud2FieldIndex(
* \param input the message in the sensor_msgs::msg::PointCloud format
* \param output the resultant message in the sensor_msgs::msg::PointCloud2 format
*/
RCUTILS_DEPRECATED_WITH_MSG("PointCloud is deprecated as of Foxy to be removed after. Please use sensor_msgs/PointCloud2.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++14 has already a deprecated attribute: https://en.cppreference.com/w/cpp/language/attributes/deprecated.

Except the code here requires pre-C++14 compatibility, I would limits the usage of the new macros to pure C code.

@tfoote tfoote force-pushed the tfoote/deprecate_point_cloud branch from 4c27ca5 to 84dc9a0 Compare April 15, 2020 12:25
@tfoote
Copy link
Contributor Author

tfoote commented Apr 16, 2020

Package only builds:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

For good measure here's a sanity check with a full downstream rebuild.

  • Linux Build Status

@tfoote tfoote requested a review from ivanpauno April 16, 2020 17:42
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments and questions, otherwise LGTM!

#ifdef _MSC_VER
#pragma message(POINT_CLOUD_DEPRECATION_MESSAGE)
#else
#ifndef RCUTILS_SKIP_WARNING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoudn't RCUTILS_SKIP_WARNING also be taken in account on Windows?
i.e.:

#ifndef RCUTILS_SKIP_WARNING
#  ifdef _MSC_VER
#    pragma message(POINT_CLOUD_DEPRECATION_MESSAGE)
#  else
#    warning POINT_CLOUD_DEPRECATION_MESSAGE
#  endif
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specifically to the bug in g++ that the preprocessor doesn't respect the pragmas. So it's better to have the pragma suppress the warning on Windows instead of compiling it out.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

@@ -15,6 +15,7 @@
<build_depend>geometry_msgs</build_depend>
<build_depend>std_msgs</build_depend>


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seems like a leftover of a previous change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i went through a lot of iterations. I'll squash this out.

#ifndef __clang__
#pragma GCC diagnostic ignored "-Wcpp"
#endif
#define RCUTILS_SKIP_WARNING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this actually a macro defined in rcutils?

If not, I would use a name more specific to this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was originally going to try to prototype it here and then move it upstream, but it go so complicated I'm going to need to defer the upstream proposal until after the freeze. I'll rename it for clarity for now. And we can replace it with a potential macro.

@@ -18,7 +18,26 @@
#include "sensor_msgs/msg/point_cloud.hpp"
#include "sensor_msgs/msg/point_cloud2.hpp"

#ifdef _MSC_VER
#pragma warning(push)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seem to be pushing the "warning configuration" state, but not adding any #pragma warning( disable : ...) in the middle

#else
#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wcpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the docs, is this for ignoring a #pragma message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the answer is yes, you can ignore this other comment #107 (comment).

Copy link
Contributor Author

@tfoote tfoote Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: sorry no, this isn't ignoring the windows message pragma. They aren't suppressed, but they also don't actually cause warnings so our compile tests don't complain.

@tfoote tfoote force-pushed the tfoote/deprecate_point_cloud branch from d5148ab to 7893bce Compare April 16, 2020 22:36
@tfoote
Copy link
Contributor Author

tfoote commented Apr 16, 2020

Squashed with the feedback. Simplifying it for this specific use case and avoiding the more generic approaches that don't work in many cases.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@tfoote tfoote requested a review from ivanpauno April 17, 2020 08:30
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

The comments I've left are non-blocking.


#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seems to be an extra space before the closing bracket.

@@ -68,7 +91,19 @@ TEST(sensor_msgs, PointCloudConversion)

// Convert back to PointCloud
sensor_msgs::msg::PointCloud cloud3;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Signed-off-by: Tully Foote <[email protected]>
@tfoote tfoote merged commit b30ed13 into master Apr 17, 2020
@delete-merged-branch delete-merged-branch bot deleted the tfoote/deprecate_point_cloud branch April 17, 2020 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fully deprecated PointCloud, the original, and plan for the removal in the next release
2 participants