Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
E
event_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
event_src
Commits
3a167d5a
Commit
3a167d5a
authored
Feb 23, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交配置修改
parent
c35f5a19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
36 deletions
+93
-36
EventsRos.cpp
EventsRos.cpp
+88
-36
EventsRos.h
EventsRos.h
+5
-0
No files found.
EventsRos.cpp
View file @
3a167d5a
...
...
@@ -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_)
...
...
EventsRos.h
View file @
3a167d5a
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment