feat(low_controller): Integrate LowController for low-level command handling

- Added LowController class to manage low-level commands and communication.
- Updated CustomRobot to initialize and manage LowController, including methods for processing low-level commands.
- Enhanced logger functionality with variadic template methods for formatted logging.
- Updated CMakeLists.txt to include the new low_controller.cpp source file and low_controller.hpp header.
This commit is contained in:
2025-09-22 19:11:20 +08:00
parent 1a0618f50f
commit c5cff9fbdb
7 changed files with 305 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
#include "logger.hpp"
#include "mqtt.hpp"
#include "navigation.hpp"
#include "low_controller.hpp"
#include <memory>
#include <atomic>
@@ -40,11 +41,13 @@ public:
bool processRscCmd(const std::string& cmd, const nlohmann::json& message);
bool processNavCmd(const std::string& cmd, const nlohmann::json& message);
bool processMscCmd(const std::string& cmd, const nlohmann::json& message);
bool processLowCmd(const std::string& cmd, const nlohmann::json& message);
void printServiceList(const std::vector<unitree::robot::go2::ServiceState>& serviceList, int filterStatus = -1);
private:
std::string generateRandomClientId() const;
std::unique_ptr<Controller> controller_;
std::unique_ptr<LowController> low_controller_;
std::unique_ptr<Navigation> navigation_;
std::unique_ptr<unitree::robot::go2::RobotStateClient> rsc_;
std::unique_ptr<MqttClient> mqttClient_;