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.

This commit is contained in:
2025-09-08 18:38:37 +08:00
parent 90228e4ab9
commit 60a5490ec8

View File

@@ -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();
};