Skip to content

Conversation

@Prathmesh2931
Copy link

  • Added new LifecycleSubscription wrapper class.

  • Integrated lifecycle-state checking before executing user callbacks.

  • Added new create_subscription() helper that automatically:

    • Applies Nav2 QoS & SubscriptionOptions

    • Wraps user callbacks in lifecycle checks

    • Registers the subscription inside the lifecycle wrapper

  • Updated:

    • interface_factories.hpp
    • lifecycle_node.hpp
    • subscription.hpp
      to support the new lifecycle subscription interface.
  • Added the new header:
    nav2_ros_common/lifecycle_subscription.hpp

@mini-1235
Copy link
Collaborator

@Prathmesh2931
Copy link
Author

Prathmesh2931 commented Dec 9, 2025

@mini-1235
Thanks for the clarification. I’m currently trying to set up a clean, reproducible build environment for testing changes on the main branch, but I’m running into container-related issues (mainly DevContainer build failures, /tmp/devcontainercli-* temp folder problems, and incomplete multi-stage builds).

@mini-1235
Copy link
Collaborator

Take a look at https://github.com/ros-navigation/nav2_docker/pkgs/container/nav2_docker, you can directly pull the image:

docker pull ghcr.io/ros-navigation/nav2_docker:rolling-nightly

@SteveMacenski
Copy link
Member

Please fill in the PR template properly :-)

Comment on lines 52 to 59
const bool allow_parameter_qos_overrides = true,
const rclcpp::CallbackGroup::SharedPtr callback_group_ptr = nullptr,
rclcpp::QOSMessageLostCallbackType qos_message_lost_callback = nullptr,
rclcpp::SubscriptionMatchedCallbackType subscription_matched_callback = nullptr,
rclcpp::IncompatibleTypeCallbackType incompatible_qos_type_callback = nullptr,
rclcpp::QOSRequestedIncompatibleQoSCallbackType requested_incompatible_qos_callback = nullptr,
rclcpp::QOSDeadlineRequestedCallbackType qos_deadline_requested_callback = nullptr,
rclcpp::QOSLivelinessChangedCallbackType qos_liveliness_changed_callback = nullptr)
Copy link
Member

Choose a reason for hiding this comment

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

We need all this, do not change

*/
template<typename MessageT>
using Subscription = rclcpp::Subscription<MessageT>;
using Subscription = LifecycleSubscription<MessageT>;
Copy link
Member

Choose a reason for hiding this comment

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

This file should contain the new subscription, not lifecycle_subscription.hpp. This is now Nav2 subscription

double bond_heartbeat_period{0.1};
rclcpp::TimerBase::SharedPtr autostart_timer_;

// ADDED: Vector to store all managed entities (publishers, subscriptions, etc.)
Copy link
Member

@SteveMacenski SteveMacenski Dec 9, 2025

Choose a reason for hiding this comment

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

This line and ones like it are making me think this is the output of an LLM. How did you validate, test, review, and compile this? We do not typically review AI outputs without you taking responsibility for quality control, we cannot review direct AI outputs - it is not a good use of maintainer time and resources. If you want to contribute a feature or fix, please put in your own legwork / effort to at least do QA and testing.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for your feedback @SteveMacenski ,
The issue was on my side -I hadn’t fully verified the build environment and Docker setup before submitting the changes. That’s my mistake.
I will make sure to do Proper checks , validation and QC from my end .
I really appreciate your guidance and it means lot to me .
Sorry for inconvenience .

Copy link
Member

Choose a reason for hiding this comment

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

Its ok - just for the future its important to do your own QC before involving other developers :-)

@SteveMacenski
Copy link
Member

Any update?

@Prathmesh2931
Copy link
Author

Yes , I am doing some lifecycle subscription testing

Prathmesh2931 and others added 2 commits December 28, 2025 14:08
Add nav2::Subscription class that wraps rclcpp subscriptions with
lifecycle state management, blocking message processing when inactive.

Signed-off-by: Prathmesh Atkale <[email protected]>
@Prathmesh2931
Copy link
Author

Prathmesh2931 commented Dec 28, 2025

I am running into a build issue here - the existing test files are trying to use the old subscription type but I changed it to a lifecycle wrapper class.
Can you please guide me or any hint , how should i be proceeding further .
Should I fix the test or any other approach ?

@Prathmesh2931
Copy link
Author

Prathmesh2931 commented Dec 29, 2025

And also the ordering of parameter is different of rclcpp::Node::create_subscription and nav2::LifecycleNode::create_subscription .
I guess that is what causing build problem and also rclcpp::Subscription does not have virtual callback methods to override.

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