fix(命名空间): 修复Unitree SDK类型命名空间问题并重构PoseData

- 将ChannelSubscriberPtr改为unitree::robot::ChannelSubscriberPtr
- 重构PoseData结构为poseDate类,增加JSON序列化功能
- 更新相关代码以使用新的poseDate类
This commit is contained in:
2025-09-22 14:46:18 +08:00
parent ccaf5f3513
commit 6b9ad80757
3 changed files with 45 additions and 17 deletions

View File

@@ -4,12 +4,12 @@
namespace custom {
Navigation::Navigation() : unitree::robot::Client(SLAM_SERVICE_NAME) {
subSlamInfo = ChannelSubscriberPtr(
subSlamInfo = unitree::robot::ChannelSubscriberPtr(
new unitree::robot::ChannelSubscriber<std_msgs::msg::dds_::String_>(SlamInfoTopic));
subSlamInfo->InitChannel(
std::bind(&Navigation::slamInfoHandler, this, std::placeholders::_1), 1);
subSlamKeyInfo = ChannelSubscriberPtr(
subSlamKeyInfo = unitree::robot::ChannelSubscriberPtr(
new unitree::robot::ChannelSubscriber<std_msgs::msg::dds_::String_>(SlamKeyInfoTopic));
subSlamKeyInfo->InitChannel(
std::bind(&Navigation::slamKeyInfoHandler, this, std::placeholders::_1), 1);