Skip to content

Commit 77db0a6

Browse files
Unique to Shared Bond Connection [Kilted manual backport] (#5349)
* Unique to Shared Bond Connection Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Update lifecycle_node.cpp Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Unique to Shared Bond Connection [Jazzy backport] Changes bond connection from std::unique_ptr to std::shared_ptr for better memory management and lifecycle handling. Co-authored-by: Steve Macenski <SteveMacenski@users.noreply.github.com> * Unique to Shared Bond Connection [Humble backport] Changes bond connection from std::unique_ptr to std::shared_ptr for better memory management and lifecycle handling. Co-authored-by: Steve Macenski <SteveMacenski@users.noreply.github.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent b4f48ab commit 77db0a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎nav2_util/include/nav2_util/lifecycle_node.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class LifecycleNode : public rclcpp_lifecycle::LifecycleNode
210210
void runCleanups();
211211

212212
// Connection to tell that server is still up
213-
std::unique_ptr<bond::Bond> bond_{nullptr};
213+
std::shared_ptr<bond::Bond> bond_{nullptr};
214214
double bond_heartbeat_period;
215215
rclcpp::TimerBase::SharedPtr autostart_timer_;
216216
};

‎nav2_util/src/lifecycle_node.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void LifecycleNode::createBond()
7373
if (bond_heartbeat_period > 0.0) {
7474
RCLCPP_INFO(get_logger(), "Creating bond (%s) to lifecycle manager.", this->get_name());
7575

76-
bond_ = std::make_unique<bond::Bond>(
76+
bond_ = std::make_shared<bond::Bond>(
7777
std::string("bond"),
7878
this->get_name(),
7979
shared_from_this());

0 commit comments

Comments
 (0)