feat(recharge): Implement automatic recharge functionality

- Added Recharge class for managing automatic recharge capabilities using ArUco markers.
- Integrated recharge functionality into CustomRobot, including command processing for starting and stopping recharge.
- Updated CMakeLists.txt to include the new recharge.cpp source file.
- Enhanced README.md to document the new auto recharge support feature.
This commit is contained in:
2025-09-23 18:27:30 +08:00
parent 6fe07ac73c
commit e0e1b5f642
10 changed files with 273 additions and 32 deletions

View File

@@ -5,6 +5,8 @@
#include "logger.hpp"
#include "mqtt.hpp"
#include "navigation.hpp"
#include "mqtt_client.hpp"
#include "recharge.hpp"
// #include "low_controller.hpp"
#include <memory>
@@ -42,6 +44,7 @@ public:
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);
bool processRechargeCmd(const std::string& cmd, const nlohmann::json& message);
void printServiceList(const std::vector<unitree::robot::go2::ServiceState>& serviceList, int filterStatus = -1);
private:
@@ -51,6 +54,7 @@ private:
std::unique_ptr<Navigation> navigation_;
std::unique_ptr<unitree::robot::go2::RobotStateClient> rsc_;
std::unique_ptr<MqttClient> mqttClient_;
std::unique_ptr<Recharge> recharge_;
CustomConfig config_;
std::atomic<bool> running_;