Skip to content

Feat/Add LifecycleNode Support#109

Merged
ahcorde merged 16 commits intoros-perception:rollingfrom
elsayedelsheikh:feature/support_life_cycle_node
May 30, 2025
Merged

Feat/Add LifecycleNode Support#109
ahcorde merged 16 commits intoros-perception:rollingfrom
elsayedelsheikh:feature/support_life_cycle_node

Conversation

@elsayedelsheikh
Copy link
Contributor

Closes (#107)
In progress ...

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Two main ideas:

  • Don't apply style modifications because linter will complain
  • Keep old methods and deprecated them

@elsayedelsheikh
Copy link
Contributor Author

elsayedelsheikh commented Feb 18, 2025

@DasariChaitanya
All unit tests have passed.
I've also tested the plugins (raw, draco, etc.), and everything is working fine. However, I'm unsure whether we might encounter issues with sub-namespaces in the future without get_effective_namespace().

Could you review the latest changes, along with the overall architecture? Additionally, please check which methods should be marked with the [[deprecated]] attribute and whether any visibility control macros are missing.

Edit:
Also, consider adding additional methods for LifecycleNode calls, such as on_activate(), etc.

@elsayedelsheikh
Copy link
Contributor Author

elsayedelsheikh commented Feb 20, 2025

Should we deprecate the old methods and enforce using NodeInterfaces, /or turn them into templates would be better to preserve the existing API?

Option 1: Direct NodeInterfaces

pct = std::make_shared<point_cloud_transport::PointCloudTransport>(
  point_cloud_transport::create_node_interfaces(this)
);

std::shared_ptr<point_cloud_transport::PublisherPlugin> pub;
pub->advertise(
  point_cloud_transport::create_node_interfaces(this),
  out_topic, rmw_qos_profile_default, pub_options);

Option 2: Templates

pct = std::make_shared<point_cloud_transport::PointCloudTransport>(this->shared_from_this());

std::shared_ptr<point_cloud_transport::PublisherPlugin> pub;
pub->advertise(
  this->shared_from_this(),
  out_topic, rmw_qos_profile_default, pub_options);

CC @ahcorde

@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch from f16e978 to fd96167 Compare March 15, 2025 13:15
@elsayedelsheikh
Copy link
Contributor Author

@ahcorde
Could you please review this and LMK if there's anything I need to do?
Thanks :)

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

sorry the late response, I was taking a look to this suggestion made by @methylDragon in geometry2 ros2/geometry2#698
and I think we should use rclcpp::node_interfaces::NodeInterfaces instead of point_cloud_transport::NodeInterfaces

@elsayedelsheikh elsayedelsheikh marked this pull request as draft April 15, 2025 17:17
@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch from fd96167 to 41c844d Compare April 23, 2025 15:04
@elsayedelsheikh elsayedelsheikh marked this pull request as ready for review April 23, 2025 15:04
@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch from c56131b to 9fc9b07 Compare April 23, 2025 15:25
@DasariChaitanya DasariChaitanya force-pushed the feature/support_life_cycle_node branch from 9fc9b07 to 629381d Compare April 23, 2025 16:54
@DasariChaitanya
Copy link
Contributor

@ahcorde
Could you please review this PR?

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

@DasariChaitanya point_cloud_transport_plugins are not compiling

point_cloud_transport/simple_publisher_plugin.hpp:152:23: error: ‘struct point_cloud_transport::SimplePublisherPlugin<point_cloud_interfaces::msg::CompressedPointCloud2_<std::allocator<void> > >::SimplePublisherPluginImpl’ has no member named ‘node_interface_’; did you mean ‘node_interfaces_’?
  152 |         simple_impl_->node_interface_->get_node_parameters_interface()
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
      |         node_interfaces_

@elsayedelsheikh
Copy link
Contributor Author

Sorry for late response

@DasariChaitanya point_cloud_transport_plugins are not compiling

Fixed the variable name and tested the plugins, everything is working 👍

@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch from 10549ac to a326255 Compare April 29, 2025 19:23
@elsayedelsheikh
Copy link
Contributor Author

@ahcorde
Could you please check this PR?

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

This comment is still open

  • Keep old methods and deprecated them

Still need to deprecate the rclcpp::Node methods

@DasariChaitanya DasariChaitanya force-pushed the feature/support_life_cycle_node branch from a326255 to 63723b1 Compare May 20, 2025 19:01
@DasariChaitanya
Copy link
Contributor

@ahcorde
Do I need to deprecate the methods that have been templatized with a default to rclcpp::Node? The usage and API remain unchanged for users, so I wanted to confirm if formal deprecation is required in this case.

@elsayedelsheikh
Copy link
Contributor Author

@DasariChaitanya
Check this ros2/geometry2#698 which recommends avoiding templates in favor of rclcpp::node_interfaces::NodeInterfaces to reduce recompilation, improve clarity, and promote reuse.

sorry the late response, I was taking a look to this suggestion made by @methylDragon in geometry2 ros2/geometry2#698 and I think we should use rclcpp::node_interfaces::NodeInterfaces instead of point_cloud_transport::NodeInterfaces

I'll start working on it removing templates and deprecating rclcpp::Node methods

@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch 3 times, most recently from f675e12 to 608840f Compare May 26, 2025 19:48
@elsayedelsheikh
Copy link
Contributor Author

This comment is still open

  • Keep old methods and deprecated them

Still need to deprecate the rclcpp::Node methods

We can close this comment now :)
@ahcorde

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

there are many warning that I can see in the tests. Do you mind to create:

  • Add new test for the new APIs
  • silent current warnings which will be removed in the next release

@ahcorde
Copy link
Collaborator

ahcorde commented May 28, 2025

you can use -Wdeprecated-declarations inside the tests file to avoid the warning message:

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

// deprecated code 

#ifdef _MSC_VER
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif

@elsayedelsheikh
Copy link
Contributor Author

Two minor changes, otherwise LGTM

Perfect! 💯

@ahcorde
Copy link
Collaborator

ahcorde commented May 29, 2025

Pulls: #109
Gist: https://gist.githubusercontent.com/ahcorde/10ae278905fe15414ef02b5a4c9de2f6/raw/f707b68267eb0bd419d3f1f0d940cabca531292c/ros2.repos
BUILD args: --packages-above-and-dependencies point_cloud_transport point_cloud_transport_py
TEST args: --packages-above point_cloud_transport point_cloud_transport_py
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16108

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Windows is failing

republish.obj : error LNK2019: unresolved external symbol "const point_cloud_transport::PointCloudTransport::`vftable'" (??_7PointCloudTransport@point_cloud_transport@@6B@) referenced in function "public: __cdecl point_cloud_transport::PointCloudTransport::PointCloudTransport(class std::shared_ptr<class rclcpp::Node>)" (??0PointCloudTransport@point_cloud_transport@@QEAA@V?$shared_ptr@VNode@rclcpp@@@std@@@Z) [C:\ci\ws\build\point_cloud_transport\pc_republish_node.vcxproj]

@elsayedelsheikh
Copy link
Contributor Author

Windows is failing

republish.obj : error LNK2019: unresolved external symbol "const point_cloud_transport::PointCloudTransport::`vftable'" (??_7PointCloudTransport@point_cloud_transport@@6B@) referenced in function "public: __cdecl point_cloud_transport::PointCloudTransport::PointCloudTransport(class std::shared_ptr<class rclcpp::Node>)" (??0PointCloudTransport@point_cloud_transport@@QEAA@V?$shared_ptr@VNode@rclcpp@@@std@@@Z) [C:\ci\ws\build\point_cloud_transport\pc_republish_node.vcxproj]

Is there any GitHub workflow that runs on Windows to test before pushing to the PR?

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

These two changes should fix the issue

DasariChaitanya and others added 16 commits May 30, 2025 15:05
Co-authored-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: DasariChaitanya <chaitanyasai30@gmail.com>
Co-authored-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: DasariChaitanya <chaitanyasai30@gmail.com>
Co-authored-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: DasariChaitanya <chaitanyasai30@gmail.com>
Co-authored-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: DasariChaitanya <chaitanyasai30@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Co-authored-by: DasariChaitanya <chaitanyasai30@gmail.com>
Signed-off-by: elsayedelsheikh <elsayed.elsheikh97@gmail.com>
Co-authored-by: DasariChaitanya <chaitanyasai30@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Co-authored-by: DasariChaitanya <chaitanyasai30@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
Signed-off-by: elsayed <elsayed.elsheikh97@gmail.com>
@elsayedelsheikh elsayedelsheikh force-pushed the feature/support_life_cycle_node branch from 5a90938 to 3280e49 Compare May 30, 2025 12:05
@ahcorde
Copy link
Collaborator

ahcorde commented May 30, 2025

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@elsayedelsheikh
Copy link
Contributor Author

@ahcorde
All builds passing 🥇 💯

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you for iterating!

@ahcorde ahcorde merged commit f7b65a4 into ros-perception:rolling May 30, 2025
3 checks passed
@elsayedelsheikh elsayedelsheikh deleted the feature/support_life_cycle_node branch May 30, 2025 20:44
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.

3 participants