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:
@@ -12,9 +12,7 @@ find_package(Threads REQUIRED)
|
||||
# Find installed unitree_sdk2
|
||||
find_package(unitree_sdk2 REQUIRED)
|
||||
|
||||
# Find MQTT library (Eclipse Paho)
|
||||
pkg_check_modules(PAHO_MQTT REQUIRED libpaho-mqtt3c)
|
||||
pkg_check_modules(PAHO_MQTTPP REQUIRED libpaho-mqttpp3)
|
||||
# MQTT library is no longer required
|
||||
|
||||
# Find JSON library
|
||||
find_package(nlohmann_json REQUIRED)
|
||||
@@ -27,7 +25,6 @@ include_directories(
|
||||
# Source files
|
||||
set(SOURCES
|
||||
src/main.cpp
|
||||
src/mqtt.cpp
|
||||
src/controller.cpp
|
||||
src/custom_robot.cpp
|
||||
src/config.cpp
|
||||
@@ -40,18 +37,10 @@ add_executable(main ${SOURCES})
|
||||
# Link libraries
|
||||
target_link_libraries(main
|
||||
unitree_sdk2
|
||||
${PAHO_MQTT_LIBRARIES}
|
||||
${PAHO_MQTTPP_LIBRARIES}
|
||||
nlohmann_json::nlohmann_json
|
||||
Threads::Threads
|
||||
)
|
||||
|
||||
# Compiler options
|
||||
target_compile_options(main PRIVATE
|
||||
${PAHO_MQTT_CFLAGS_OTHER}
|
||||
${PAHO_MQTTPP_CFLAGS_OTHER}
|
||||
)
|
||||
|
||||
# Set output directory
|
||||
set_target_properties(main PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
|
||||
Reference in New Issue
Block a user