Skip to content

Commit 64e2ab3

Browse files
authored
feat(system_diagnostic_graph): unify units and add file path substitution (#5447)
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
1 parent 75f7357 commit 64e2ab3

32 files changed

+848
-1033
lines changed

system/system_diagnostic_graph/CMakeLists.txt

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@ project(system_diagnostic_graph)
44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

7-
ament_auto_add_executable(aggregator
7+
ament_auto_add_library(${PROJECT_NAME} SHARED
88
src/core/config.cpp
99
src/core/debug.cpp
1010
src/core/graph.cpp
11-
src/core/nodes.cpp
12-
src/core/exprs.cpp
11+
src/core/units.cpp
1312
src/core/modes.cpp
13+
)
14+
15+
ament_auto_add_executable(aggregator
1416
src/main.cpp
1517
)
1618

1719
ament_auto_add_executable(converter
1820
src/tool.cpp
1921
)
2022

21-
install(
22-
PROGRAMS util/debug.py
23-
DESTINATION lib/${PROJECT_NAME}
24-
)
23+
if(BUILD_TESTING)
24+
get_filename_component(RESOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/test/files ABSOLUTE)
25+
ament_auto_add_gtest(gtest_${PROJECT_NAME} test/src/test.cpp)
26+
target_compile_definitions(gtest_${PROJECT_NAME} PRIVATE TEST_RESOURCE_PATH="${RESOURCE_PATH}")
27+
target_include_directories(gtest_${PROJECT_NAME} PRIVATE src)
28+
endif()
2529

2630
ament_auto_package(INSTALL_TO_SHARE config example launch)
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
files:
2-
- { package: system_diagnostic_graph, path: example/example_1.yaml }
3-
- { package: system_diagnostic_graph, path: example/example_2.yaml }
2+
- { path: $(find-pkg-share system_diagnostic_graph)/example/example_1.yaml }
3+
- { path: $(find-pkg-share system_diagnostic_graph)/example/example_2.yaml }
44

55
nodes:
66
- path: /autoware/modes/stop
7-
type: debug-ok
7+
type: ok
88

99
- path: /autoware/modes/autonomous
1010
type: and
1111
list:
12-
- { type: link, path: /functions/pose_estimation }
13-
- { type: link, path: /functions/obstacle_detection }
12+
- { type: link, link: /functions/pose_estimation }
13+
- { type: link, link: /functions/obstacle_detection }
1414

1515
- path: /autoware/modes/local
1616
type: and
1717
list:
18-
- { type: link, path: /external/joystick_command }
18+
- { type: link, link: /external/joystick_command }
1919

2020
- path: /autoware/modes/remote
2121
type: and
2222
list:
23-
- { type: link, path: /external/remote_command }
23+
- { type: link, link: /external/remote_command }
2424

2525
- path: /autoware/modes/emergency-stop
26-
type: debug-ok
26+
type: ok
2727

2828
- path: /autoware/modes/comfortable-stop
29-
type: debug-ok
29+
type: and
30+
list:
31+
- { type: link, link: /functions/obstacle_detection }
3032

3133
- path: /autoware/modes/pull-over
32-
type: debug-ok
34+
type: and
35+
list:
36+
- { type: link, link: /functions/pose_estimation }
37+
- { type: link, link: /functions/obstacle_detection }

system/system_diagnostic_graph/example/example_1.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ nodes:
22
- path: /functions/pose_estimation
33
type: and
44
list:
5-
- { type: link, path: /sensing/lidars/top }
5+
- { type: link, link: /sensing/lidars/top }
66

77
- path: /functions/obstacle_detection
88
type: or
99
list:
10-
- { type: link, path: /sensing/lidars/front }
11-
- { type: link, path: /sensing/radars/front }
10+
- { type: link, link: /sensing/lidars/front }
11+
- { type: link, link: /sensing/radars/front }
1212

1313
- path: /sensing/lidars/top
1414
type: diag
15-
name: "lidar_driver/top: status"
15+
diag: "lidar_driver/top: status"
1616

1717
- path: /sensing/lidars/front
1818
type: diag
19-
name: "lidar_driver/front: status"
19+
diag: "lidar_driver/front: status"
2020

2121
- path: /sensing/radars/front
2222
type: diag
23-
name: "radar_driver/front: status"
23+
diag: "radar_driver/front: status"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
nodes:
22
- path: /external/joystick_command
33
type: diag
4-
name: "external_command_checker: joystick_command"
4+
diag: "external_command_checker: joystick_command"
55

66
- path: /external/remote_command
77
type: diag
8-
name: "external_command_checker: remote_command"
8+
diag: "external_command_checker: remote_command"

system/system_diagnostic_graph/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<depend>tier4_system_msgs</depend>
1616
<depend>yaml_cpp_vendor</depend>
1717

18+
<test_depend>ament_cmake_gtest</test_depend>
1819
<test_depend>ament_lint_auto</test_depend>
1920
<test_depend>autoware_lint_common</test_depend>
2021

0 commit comments

Comments
 (0)