#pragma once #include "controller.hpp" #include "config.hpp" #include "logger.hpp" #include "mqtt.hpp" #include "navigation.hpp" #include "mqtt_client.hpp" #include "recharge.hpp" // #include "low_controller.hpp" #include #include #include #include #include #include namespace custom { class CustomRobot { public: explicit CustomRobot(); ~CustomRobot(); bool initialize(); bool start(); Controller* getController() const { return controller_.get(); } Navigation* getNavigation() const { return navigation_.get(); } bool GetServiceList(std::vector& serviceList); bool SwitchService(const std::string& serviceName, bool enable); bool SetReportFreq(int32_t interval, int32_t duration); bool initializeMqtt(); void onMqttMessage(const std::string& topic, const std::string& payload); void onMqttConnection(bool connected); void processCmd(const nlohmann::json& message); bool processOacCmd(const std::string& cmd, const nlohmann::json& message); bool processSportCmd(const std::string& cmd, const nlohmann::json& message); 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); bool processRechargeCmd(const std::string& cmd, const nlohmann::json& message); void printServiceList(const std::vector& serviceList, int filterStatus = -1); private: std::string generateRandomClientId() const; std::unique_ptr controller_; // std::unique_ptr low_controller_; std::unique_ptr navigation_; std::unique_ptr rsc_; std::unique_ptr mqttClient_; std::unique_ptr recharge_; CustomConfig config_; std::atomic running_; std::atomic initialized_; }; } // namespace custom