We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is the recommended way while dealing with LifeCycle nodes?
File lifecycle_example.hpp:
lifecycle_example.hpp
protected: void dataCallback(sensor_msgs::msg::PointCloud2::ConstSharedPtr msg); point_cloud_transport::Subscriber data_sub_; sensor_msgs::msg::PointCloud2::ConstSharedPtr data_;
File lifecycle_example.cpp:
lifecycle_example.cpp
void lifeCycleNodeExample::configure() { rclcpp_lifecycle::LifecycleNode::SharedPtr node = node_.lock(); if (!node) { throw std::runtime_error{"Failed to lock node"}; } std::string source_topic; getParameters(source_topic); data_sub_ = point_cloud_transport::create_subscription( std::dynamic_pointer_cast<rclcpp::Node>(node), source_topic, std::bind(&lifeCycleNodeExample::dataCallback, this, std::placeholders::_1), "raw" ); } lifeCycleNodeExample::~lifeCycleNodeExample() { RCLCPP_INFO(logger_, "[%s]: Destroying PointCloud", source_name_.c_str()); data_sub_.shutdown(); }
Thanks :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the recommended way while dealing with LifeCycle nodes?
File
lifecycle_example.hpp
:File
lifecycle_example.cpp
:Thanks :)
The text was updated successfully, but these errors were encountered: