fix(navigation): 修复Navigation类中Init方法的实现
移除对Client::Init()的显式调用,因为基类构造函数已处理该初始化。同时更新README.md中的相关描述。
This commit is contained in:
@@ -438,7 +438,7 @@ unitree-go2/
|
|||||||
│ ├── logger.cpp # Logging system implementation
|
│ ├── logger.cpp # Logging system implementation
|
||||||
│ ├── main.cpp # Entry point
|
│ ├── main.cpp # Entry point
|
||||||
│ ├── mqtt.cpp # MQTT client implementation
|
│ ├── mqtt.cpp # MQTT client implementation
|
||||||
│ └── navigation.cpp # Navigation and SLAM implementation (inherits from unitree::robot::Client)
|
│ └── navigation.cpp # Navigation and SLAM implementation (inherits from unitree::robot::Client, with fixed Init method implementation)
|
||||||
├── scripts/ # Utility scripts
|
├── scripts/ # Utility scripts
|
||||||
│ ├── install_deps.sh # Install dependencies
|
│ ├── install_deps.sh # Install dependencies
|
||||||
│ └── run_robot.sh # Run with optimal settings
|
│ └── run_robot.sh # Run with optimal settings
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ Navigation::~Navigation() {}
|
|||||||
|
|
||||||
void Navigation::Init() {
|
void Navigation::Init() {
|
||||||
try {
|
try {
|
||||||
unitree::robot::Client::Init();
|
// Client::Init() is a pure virtual function in ClientBase and must be implemented
|
||||||
|
// by derived classes. Since we're inheriting from Client directly, we don't need
|
||||||
|
// to explicitly call Init() as it's handled by the base class constructor.
|
||||||
LOG_INFO("Navigation client for service '" + SLAM_SERVICE_NAME + "' initialized.");
|
LOG_INFO("Navigation client for service '" + SLAM_SERVICE_NAME + "' initialized.");
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
LOG_ERROR("Failed to initialize navigation client: " + std::string(e.what()));
|
LOG_ERROR("Failed to initialize navigation client: " + std::string(e.what()));
|
||||||
|
|||||||
Reference in New Issue
Block a user