From 60a5490ec8a6d5687d2cd19a2ec7cdd4771cfffe Mon Sep 17 00:00:00 2001 From: Sucan126 <632190820@qq.com> Date: Mon, 8 Sep 2025 18:38:37 +0800 Subject: [PATCH] Update MQTT configuration in config.hpp. Changed broker address to a specific IP and added username and password for authentication. Removed commented-out sections for clarity. --- include/config.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/config.hpp b/include/config.hpp index 3e52b79..1def4a7 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -19,11 +19,11 @@ enum class Gait : int { constexpr std::string_view NETWORK_INTERFACE = "eth0"; // MQTT settings -constexpr std::string_view MQTT_BROKER = "localhost"; +constexpr std::string_view MQTT_BROKER = "192.168.2.236"; constexpr int MQTT_PORT = 1883; constexpr std::string_view MQTT_CLIENT_ID = "unitree_go2_client"; -constexpr std::string_view MQTT_USERNAME = ""; -constexpr std::string_view MQTT_PASSWORD = ""; +constexpr std::string_view MQTT_USERNAME = "lzwc"; +constexpr std::string_view MQTT_PASSWORD = "Lzwc@4187."; // Topic settings constexpr std::string_view TOPIC_PREFIX = "unitree/go2"; @@ -46,7 +46,6 @@ constexpr Gait DEFAULT_GAIT = Gait::IDLE; class CustomConfig { public: - // 网络和MQTT连接 std::string network_interface; std::string mqtt_broker; int mqtt_port; @@ -54,12 +53,10 @@ public: std::string mqtt_password; std::string mqtt_client_id; - // MQTT话题 std::string topic_prefix; std::string topic_cmd; std::string topic_state; - // 机器人控制和安全 double control_frequency; double state_publish_frequency; double max_linear_velocity; @@ -68,7 +65,6 @@ public: double stand_height; int default_gait; - void loadDefaults(); };