Remove MQTT dependency and refactor configuration structure. Updated CMakeLists.txt to eliminate MQTT library checks and adjusted config.hpp to use string_view for configuration parameters. Simplified controller and custom_robot classes by removing MQTT-related code and enhancing robot state management. Introduced service management methods in CustomRobot for better state handling.

This commit is contained in:
2025-09-07 20:20:34 +08:00
parent ecb4c602a1
commit f72ce9ce58
8 changed files with 373 additions and 1519 deletions

View File

@@ -11,24 +11,18 @@ std::unique_ptr<CustomRobot> g_robot;
void signalHandler(int signal) {
LOG_INFO("Received signal " + std::to_string(signal) + ", shutting down...");
if (g_robot) {
g_robot->stop();
}
exit(0);
}
int main(int argc, char** argv) {
// Initialize logger with default settings
Logger::getInstance().setLevel(LogLevel::INFO);
LOG_INFO("Starting Unitree GO2 System v0.0.1");
// Setup signal handlers
signal(SIGINT, signalHandler);
signal(SIGTERM, signalHandler);
try {
// Create robot with compile-time defaults (no config file needed)
g_robot = std::make_unique<CustomRobot>("");
if (!g_robot->initialize()) {
@@ -37,11 +31,7 @@ int main(int argc, char** argv) {
}
LOG_INFO("Robot initialized successfully");
LOG_INFO("Press Ctrl+C to stop the robot");
// Run the robot
g_robot->run();
g_robot->start();
} catch (const std::exception& e) {
LOG_ERROR("Exception: " + std::string(e.what()));
return 1;