123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- /**
- * @project shutter_verify
- * @brief $BRIEF$
- * @author lz
- * @data 2023/4/13
- **/
- #pragma once
- #include "json/json.h"
- #include "defines.hpp"
- class lidarsJsonConfig {
- public:
- struct NetConfig {
- std::string ip_address;
- int port;
- void info() {
- printf("---Debug %s %d : ip_address %s .\n", __func__, __LINE__, ip_address.c_str());
- printf("---Debug %s %d : port %d .\n", __func__, __LINE__, port);
- }
- };
- struct ScanBoxLimit {
- int dist_limit;
- double minx;
- double maxx;
- double miny;
- double maxy;
- void info() {
- printf("---Debug %s %d : minx %f .\n", __func__, __LINE__, minx);
- printf("---Debug %s %d : maxx %f .\n", __func__, __LINE__, maxx);
- printf("---Debug %s %d : miny %f .\n", __func__, __LINE__, miny);
- printf("---Debug %s %d : maxy %f .\n", __func__, __LINE__, maxy);
- }
- };
- struct LidarConfig {
- double angle_min;
- double angle_max;
- double angle_increment;
- double time_increment;
- int range_min;
- int range_max;
- NetConfig net_config;
- ScanBoxLimit scan_box_limit;
- void info() {
- printf("---Debug %s %d : angle_min %f .\n", __func__, __LINE__, angle_min);
- printf("---Debug %s %d : angle_max %f .\n", __func__, __LINE__, angle_max);
- printf("---Debug %s %d : angle_increment %f .\n", __func__, __LINE__, angle_increment);
- printf("---Debug %s %d : time_increment %f .\n", __func__, __LINE__, time_increment);
- printf("---Debug %s %d : range_min %d .\n", __func__, __LINE__, range_min);
- printf("---Debug %s %d : range_max %d .\n", __func__, __LINE__, range_max);
- net_config.info();
- scan_box_limit.info();
- }
- };
- public:
- explicit lidarsJsonConfig(std::string path);
- ~lidarsJsonConfig() = default;
- bool getLidarConfig(int ordinal, LidarConfig &lidarconfig);
- bool getNetConfig(int ordinal, NetConfig &net_config);
- bool getScanBoxLimit(int ordinal, ScanBoxLimit &scan_box_limit);
- double angle_min(int ordinal);
- double angle_max(int ordinal);
- double angle_increment(int ordinal);
- double time_increment(int ordinal);
- int range_min(int ordinal);
- int range_max(int ordinal);
- std::string ip_address(int ordinal);
- int port(int ordinal);
- int dist_limit(int ordinal);
- double minx(int ordinal);
- double maxx(int ordinal);
- double miny(int ordinal);
- double maxy(int ordinal);
- bool update();
- private:
- std::string m_path;
- Json::Value m_config;
- };
|