Commit 3a167d5a authored by oscar's avatar oscar

提交配置修改

parent c35f5a19
......@@ -14,47 +14,99 @@ int EventsRos::loadConfig(ros::NodeHandle& nh)
{
SDK_LOG(SDK_INFO, "EventsRos::loadConfig");
nh.param<std::string>("root_dir", m_root_dir, "/home/nvidia/oscar/catkin_ws/src/jfx_yolo5/");
int run_mode = 0;
nh.param<int>("run_mode", run_mode, 1);
std::string config_yaml;
if (run_mode == 1)
{
std::string entry_yaml;
private_nh.param<std::string>("entry_yaml", entry_yaml, "/home/nvidia/oscar/catkin_ws/src/jfx_yolo5/");
}
else
{
private_nh.param<std::string>("unittest_yaml", config_yaml, "");
}
m_config = YAML::LoadFile(config_yaml);
EventsConfig& config = m_jfx_events.m_cfg;
nh.param<std::string>("devNo", m_devNo, "none");
nh.param<std::string>("mecNo", m_mecNo, "none");
m_devNo = m_config["devNo"].as<std::string>();
//nh.param<std::string>("devNo", m_devNo, "none");
m_mecNo = m_config["mecNo"].as<std::string>();
//nh.param<std::string>("mecNo", m_mecNo, "none");
//nh.param<int32_t>("threadNum", g_Config->threadNum, 0);
//nh.param<int32_t>("maxTaskNum", g_Config->maxTaskNum, 0);
nh.param<std::string>("server_ip", m_ip, "none");
nh.param<int32_t>("server_port", m_port, 0);
m_ip = m_config["server_ip"].as<std::string>();
//nh.param<std::string>("server_ip", m_ip, "none");
m_port = m_config["server_port"].as< int32_t>();
//nh.param<int32_t>("server_port", m_port, 0);
//nh.param<std::string>("tongji_ip", g_Config->tongji_ip, "none");
//nh.param<int32_t>("tongji_port", g_Config->tongji_port, 0);
nh.param<std::string>("project_path", m_folder, "none");
config.pro_path = m_folder;
nh.param<std::string>("pro_dir", config.pro_dir, "none");
nh.param<std::string>("map_cfg", config.map_cfg, "none");
nh.param<int32_t>("high_speed_interval", config.high_speed_interval, 500);
nh.param<int32_t>("low_speed_interval", config.low_speed_interval, 2000);
nh.param<int32_t>("illegal_park_interval", config.illegal_park_interval, 2000);
nh.param<int32_t>("motor_illegal_lane_interval", config.motor_illegal_lane_interval, 1000);
nh.param<int32_t>("nonmotor_illegal_lane_interval", config.nonmotor_illegal_lane_interval, 1000);
nh.param<int32_t>("retrograde_interval", config.retrograde_interval, 2000);
nh.param<float>("max_high_speed", config.max_high_speed, 80);
nh.param<float>("min_low_speed", config.min_low_speed, 10);
nh.param<float>("min_park_speed", config.min_park_speed, 1);
nh.param<int32_t>("traffic_jam_num", config.traffic_jam_num, 10);
nh.param<int32_t>("traffic_jam_num_updown", config.traffic_jam_num_updown, 2);
nh.param<int32_t>("traffic_jam_interval", config.traffic_jam_interval, 10);
nh.param<std::string>("forbidden_park_area", config.forbidden_park_area, "");
nh.param<std::string>("nonmotor_name_list", config.nonmotor_name_list, "");
nh.param<std::string>("motorcycle_name_list", config.motorcycle_name_list, "");
nh.param<std::string>("bicyle_name_list", config.bicyle_name_list, "");
nh.param<std::string>("person_name_list", config.person_name_list, "");
nh.param<int32_t>("check_park_time", config.check_park_time, 30000);
nh.param<float>("min_retr_speed", config.min_retr_speed, 1.66);
nh.param<float>("retr_check_distance_ratio", config.retr_check_distance_ratio, 1.0);
nh.param<float>("min_land_speed", config.min_land_speed, 1.66);
nh.param<int32_t>("emergence_illegal_lane_interval", config.emergence_illegal_lane_interval, 30000);
nh.param<int32_t>("change_illegal_lane_interval", config.change_illegal_lane_interval, 30000);
nh.param<int32_t>("changes_illegal_lane_interval", config.changes_illegal_lane_interval, 30000);
nh.param<int32_t>("person_illegal_lane_interval", config.person_illegal_lane_interval, 30000);
nh.param<float>("traffic_jam_mim_speed", config.traffic_jam_mim_speed, 1.66);
nh.param<int32_t>("delete_obj_interval", config.delete_obj_interval, 200);
nh.param<int32_t>("flow_circle_interval", config.flow_circle_interval, 60000);
//nh.param<std::string>("project_path", m_folder, "none");
config.pro_path = m_root_dir;
config.pro_dir = m_config["pro_dir"].as<std::string>();
//nh.param<std::string>("pro_dir", config.pro_dir, "none");
config.map_cfg = m_config["map_cfg"].as<std::string>();
//nh.param<std::string>("map_cfg", config.map_cfg, "none");
config.high_speed_interval = m_config["high_speed_interval"].as< int32_t>();
//nh.param<int32_t>("high_speed_interval", config.high_speed_interval, 500);
config.low_speed_interval = m_config["low_speed_interval"].as< int32_t>();
//nh.param<int32_t>("low_speed_interval", config.low_speed_interval, 2000);
config.illegal_park_interval = m_config["illegal_park_interval"].as< int32_t>();
//nh.param<int32_t>("illegal_park_interval", config.illegal_park_interval, 2000);
config.motor_illegal_lane_interval = m_config["motor_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("motor_illegal_lane_interval", config.motor_illegal_lane_interval, 1000);
config.nonmotor_illegal_lane_interval = m_config["nonmotor_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("nonmotor_illegal_lane_interval", config.nonmotor_illegal_lane_interval, 1000);
config.retrograde_interval = m_config["retrograde_interval"].as< int32_t>();
//nh.param<int32_t>("retrograde_interval", config.retrograde_interval, 2000);
config.max_high_speed = m_config["max_high_speed"].as<float>();
//nh.param<float>("max_high_speed", config.max_high_speed, 80);
config.min_low_speed = m_config["min_low_speed"].as<float>();
//nh.param<float>("min_low_speed", config.min_low_speed, 10);
config.min_park_speed = m_config["min_park_speed"].as<float>();
//nh.param<float>("min_park_speed", config.min_park_speed, 1);
config.traffic_jam_num = m_config["traffic_jam_num"].as< int32_t>();
//nh.param<int32_t>("traffic_jam_num", config.traffic_jam_num, 10);
config.traffic_jam_num_updown = m_config["traffic_jam_num_updown"].as< int32_t>();
//nh.param<int32_t>("traffic_jam_num_updown", config.traffic_jam_num_updown, 2);
config.traffic_jam_interval = m_config["traffic_jam_interval"].as< int32_t>();
//nh.param<int32_t>("traffic_jam_interval", config.traffic_jam_interval, 10);
config.forbidden_park_area = m_config["forbidden_park_area"].as<std::string>();
//nh.param<std::string>("forbidden_park_area", config.forbidden_park_area, "");
config.nonmotor_name_list = m_config["nonmotor_name_list"].as<std::string>();
//nh.param<std::string>("nonmotor_name_list", config.nonmotor_name_list, "");
config.motorcycle_name_list = m_config["motorcycle_name_list"].as<std::string>();
//nh.param<std::string>("motorcycle_name_list", config.motorcycle_name_list, "");
config.bicyle_name_list = m_config["bicyle_name_list"].as<std::string>();
//nh.param<std::string>("bicyle_name_list", config.bicyle_name_list, "");
config.person_name_list = m_config["person_name_list"].as<std::string>();
//nh.param<std::string>("person_name_list", config.person_name_list, "");
config.check_park_time = m_config["check_park_time"].as< int32_t>();
//nh.param<int32_t>("check_park_time", config.check_park_time, 30000);
config.min_retr_speed = m_config["min_retr_speed"].as<float>();
//nh.param<float>("min_retr_speed", config.min_retr_speed, 1.66);
config.retr_check_distance_ratio = m_config["retr_check_distance_ratio"].as<float>();
//nh.param<float>("retr_check_distance_ratio", config.retr_check_distance_ratio, 1.0);
config.min_land_speed = m_config["min_land_speed"].as<float>();
//nh.param<float>("min_land_speed", config.min_land_speed, 1.66);
config.emergence_illegal_lane_interval = m_config["emergence_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("emergence_illegal_lane_interval", config.emergence_illegal_lane_interval, 30000);
config.change_illegal_lane_interval = m_config["change_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("change_illegal_lane_interval", config.change_illegal_lane_interval, 30000);
config.changes_illegal_lane_interval = m_config["changes_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("changes_illegal_lane_interval", config.changes_illegal_lane_interval, 30000);
config.person_illegal_lane_interval = m_config["person_illegal_lane_interval"].as< int32_t>();
//nh.param<int32_t>("person_illegal_lane_interval", config.person_illegal_lane_interval, 30000);
config.traffic_jam_mim_speed = m_config["traffic_jam_mim_speed"].as<float>();
//nh.param<float>("traffic_jam_mim_speed", config.traffic_jam_mim_speed, 1.66);
config.delete_obj_interval = m_config["delete_obj_interval"].as< int32_t>();
//nh.param<int32_t>("delete_obj_interval", config.delete_obj_interval, 200);
config.flow_circle_interval = m_config["flow_circle_interval"].as< int32_t>();
//nh.param<int32_t>("flow_circle_interval", config.flow_circle_interval, 60000);
#if defined (_ROS_XISHAN_) || defined(_ROS_HEFEI_R_)
......
......@@ -3,6 +3,7 @@
#include "ros/ros.h"
#include "JfxEvents.h"
#include <map>
#include <yaml-cpp/yaml.h>
//#define _ROS_HEFEI_R_
......@@ -66,4 +67,7 @@ public:
std::map<uint64_t, std::vector<std::string> > m_recordCsvStr;//记录物品信息的字符串队列
std::map<uint64_t, int> m_recordEventState;//记录是否需要保存的标识
std::map<uint64_t, uint64_t> m_recordUpdateTime;//记录更新时间,如果时间长就删除
std::string m_root_dir;//存储统一的根目录路径
YAML::Node m_config;//配置的yaml文件
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment