Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(system_diagnostic_graph): unify units and add file path substitution #5447

18 changes: 11 additions & 7 deletions system/system_diagnostic_graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@ project(system_diagnostic_graph)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(aggregator
ament_auto_add_library(${PROJECT_NAME} SHARED
src/core/config.cpp
src/core/debug.cpp
src/core/graph.cpp
src/core/nodes.cpp
src/core/exprs.cpp
src/core/units.cpp
src/core/modes.cpp
)

ament_auto_add_executable(aggregator
src/main.cpp
)

ament_auto_add_executable(converter
src/tool.cpp
)

install(
PROGRAMS util/debug.py
DESTINATION lib/${PROJECT_NAME}
)
if(BUILD_TESTING)
get_filename_component(RESOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/test/files ABSOLUTE)
ament_auto_add_gtest(gtest_${PROJECT_NAME} test/src/test.cpp)
target_compile_definitions(gtest_${PROJECT_NAME} PRIVATE TEST_RESOURCE_PATH="${RESOURCE_PATH}")
target_include_directories(gtest_${PROJECT_NAME} PRIVATE src)
endif()

ament_auto_package(INSTALL_TO_SHARE config example launch)
25 changes: 15 additions & 10 deletions system/system_diagnostic_graph/example/example_0.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
files:
- { package: system_diagnostic_graph, path: example/example_1.yaml }
- { package: system_diagnostic_graph, path: example/example_2.yaml }
- { path: $(find-pkg-share system_diagnostic_graph)/example/example_1.yaml }
- { path: $(find-pkg-share system_diagnostic_graph)/example/example_2.yaml }

nodes:
- path: /autoware/modes/stop
type: debug-ok
type: ok

- path: /autoware/modes/autonomous
type: and
list:
- { type: link, path: /functions/pose_estimation }
- { type: link, path: /functions/obstacle_detection }
- { type: link, link: /functions/pose_estimation }
- { type: link, link: /functions/obstacle_detection }

- path: /autoware/modes/local
type: and
list:
- { type: link, path: /external/joystick_command }
- { type: link, link: /external/joystick_command }

- path: /autoware/modes/remote
type: and
list:
- { type: link, path: /external/remote_command }
- { type: link, link: /external/remote_command }

- path: /autoware/modes/emergency-stop
type: debug-ok
type: ok

- path: /autoware/modes/comfortable-stop
type: debug-ok
type: and
list:
- { type: link, link: /functions/obstacle_detection }

- path: /autoware/modes/pull-over
type: debug-ok
type: and
list:
- { type: link, link: /functions/pose_estimation }
- { type: link, link: /functions/obstacle_detection }
12 changes: 6 additions & 6 deletions system/system_diagnostic_graph/example/example_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ nodes:
- path: /functions/pose_estimation
type: and
list:
- { type: link, path: /sensing/lidars/top }
- { type: link, link: /sensing/lidars/top }

- path: /functions/obstacle_detection
type: or
list:
- { type: link, path: /sensing/lidars/front }
- { type: link, path: /sensing/radars/front }
- { type: link, link: /sensing/lidars/front }
- { type: link, link: /sensing/radars/front }

- path: /sensing/lidars/top
type: diag
name: "lidar_driver/top: status"
diag: "lidar_driver/top: status"

- path: /sensing/lidars/front
type: diag
name: "lidar_driver/front: status"
diag: "lidar_driver/front: status"

- path: /sensing/radars/front
type: diag
name: "radar_driver/front: status"
diag: "radar_driver/front: status"
4 changes: 2 additions & 2 deletions system/system_diagnostic_graph/example/example_2.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
nodes:
- path: /external/joystick_command
type: diag
name: "external_command_checker: joystick_command"
diag: "external_command_checker: joystick_command"

- path: /external/remote_command
type: diag
name: "external_command_checker: remote_command"
diag: "external_command_checker: remote_command"
1 change: 1 addition & 0 deletions system/system_diagnostic_graph/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<depend>tier4_system_msgs</depend>
<depend>yaml_cpp_vendor</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
Loading