From 48cae46960db88e3895bd4d1c8b239b96eef7380 Mon Sep 17 00:00:00 2001 From: Sucan126 <632190820@qq.com> Date: Mon, 22 Sep 2025 14:50:52 +0800 Subject: [PATCH] refactor(navigation): Update ChannelSubscriberPtr to use specific message type - Changed ChannelSubscriberPtr to ChannelSubscriberPtr for slamInfo and slamKeyInfo in navigation.hpp and navigation.cpp. - Updated initialization of subscribers to reflect the new type specification. --- include/navigation.hpp | 4 ++-- src/navigation.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/navigation.hpp b/include/navigation.hpp index 420ff83..5b2b94e 100644 --- a/include/navigation.hpp +++ b/include/navigation.hpp @@ -83,8 +83,8 @@ private: void slamInfoHandler(const void *message); void slamKeyInfoHandler(const void *message); - unitree::robot::ChannelSubscriberPtr subSlamInfo; - unitree::robot::ChannelSubscriberPtr subSlamKeyInfo; + unitree::robot::ChannelSubscriberPtr subSlamInfo; + unitree::robot::ChannelSubscriberPtr subSlamKeyInfo; poseDate currentPose; bool is_arrived = false; diff --git a/src/navigation.cpp b/src/navigation.cpp index 179f615..c5c7765 100644 --- a/src/navigation.cpp +++ b/src/navigation.cpp @@ -4,12 +4,12 @@ namespace custom { Navigation::Navigation() : unitree::robot::Client(SLAM_SERVICE_NAME) { - subSlamInfo = unitree::robot::ChannelSubscriberPtr( + subSlamInfo = unitree::robot::ChannelSubscriberPtr( new unitree::robot::ChannelSubscriber(SlamInfoTopic)); subSlamInfo->InitChannel( std::bind(&Navigation::slamInfoHandler, this, std::placeholders::_1), 1); - subSlamKeyInfo = unitree::robot::ChannelSubscriberPtr( + subSlamKeyInfo = unitree::robot::ChannelSubscriberPtr( new unitree::robot::ChannelSubscriber(SlamKeyInfoTopic)); subSlamKeyInfo->InitChannel( std::bind(&Navigation::slamKeyInfoHandler, this, std::placeholders::_1), 1);