// // Created by zx on 2023/10/26. // #include #include "error_code/error_code.hpp" #include "log/log.h" #if OPTION_COMMUNICATION_WITH_PLC #include "plc/snap7_clamp.h" #endif #include "protobuf/load_protobuf.hpp" #include "lidar/lidar_manager.h" #define OPTION_WATCH_DIDAR_BY_VTK 0 int main(int argc, char **argv) { const char* clamp_config_file = ETC_PATH PROJECT_NAME "/clamp_lidar_config.json"; if(ZX::InitGlog(PROJECT_NAME, ETC_PATH PROJECT_NAME "/LogInfo/")) { LOG(INFO) << "Init google log success, log file save to " ETC_PATH PROJECT_NAME "/LogInfo"; } else { LOG(ERROR) << "Init google log failed, log file save to " ETC_PATH PROJECT_NAME "/LogInfo"; exit(EXIT_FAILURE); } ClampLidarManager lidarManager; if (lidarManager.Init(clamp_config_file) != SUCCESS) { return EXIT_FAILURE; } #if OPTION_COMMUNICATION_WITH_PLC auto snap7_client = &Snap7Clamp::get_instance_references(); snap7_client->communication_init(); Snap7Clamp::Snap7_communication_statu status = snap7_client->get_status(); while (status == Snap7Clamp::SNAP7_COMMUNICATION_READY || status == Snap7Clamp::SNAP7_COMMUNICATION_RECEIVE) { sleep(1); status = snap7_client->get_status(); } #endif #if OPTION_WATCH_DIDAR_BY_VTK #endif return EXIT_SUCCESS; }