Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/ros2_medkit_diagnostic_bridge/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ros2_medkit_diagnostic_bridge
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* Initial rosdistro release
* Bridge node converting standard ROS 2 /diagnostics to FaultManager fault reports
* Severity mapping:

* OK -> PASSED event (fault condition cleared)
* WARN -> WARN severity FAILED event
* ERROR -> ERROR severity FAILED event
* STALE -> CRITICAL severity FAILED event

* Auto-generated fault codes from diagnostic names (UPPER_SNAKE_CASE)
* Custom name_to_code mappings via ROS parameters
* Stateless design: always sends PASSED for OK status (handles restarts)
* Contributors: Michal Faferek
50 changes: 50 additions & 0 deletions src/ros2_medkit_fault_manager/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ros2_medkit_fault_manager
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* Initial rosdistro release
* Central fault management node with ROS 2 services:

* ReportFault - report FAILED/PASSED events with debounce filtering
* GetFaults - query faults with filtering by severity, status, correlation
* ClearFault - clear/acknowledge faults

* Debounce filtering with configurable thresholds:

* FAILED events decrement counter, PASSED events increment
* Configurable confirmation_threshold (default: -1, immediate)
* Optional healing support (healing_enabled, healing_threshold)
* Time-based auto-confirmation (auto_confirm_after_sec)
* CRITICAL severity bypasses debounce

* Dual storage backends:

* SQLite persistent storage with WAL mode (default)
* In-memory storage for testing/lightweight deployments

* Snapshot capture on fault confirmation:

* Topic data captured as JSON with configurable topic resolution
* Priority: fault_specific > patterns > default_topics
* Stored in SQLite with indexed fault_code lookup
* Auto-cleanup on fault clear

* Rosbag capture with ring buffer:

* Configurable duration, post-fault recording, topic selection
* Lazy start mode (start on PREFAILED) or immediate
* Auto-cleanup of bag files, storage limits (max_bag_size_mb)
* GetRosbag service for bag file metadata

* Fault correlation engine:

* Hierarchical mode: root cause to symptom relationships
* Auto-cluster mode: group similar faults within time window
* YAML-based configuration with pattern wildcards
* Muted faults tracking, auto-clear on root cause resolution

* FaultEvent publishing on ~/events topic for SSE streaming
* Wall clock timestamps (compatible with use_sim_time)
* Contributors: Bartosz Burda, Michal Faferek
22 changes: 22 additions & 0 deletions src/ros2_medkit_fault_reporter/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ros2_medkit_fault_reporter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* Initial rosdistro release
* FaultReporter client library with simple API:

* report(fault_code, severity, description) - report FAILED events
* report_passed(fault_code) - report fault condition cleared
* High-severity faults (ERROR, CRITICAL) bypass local filtering

* LocalFilter for per-fault-code threshold/window filtering:

* Configurable threshold (default: 3 reports) and time window (default: 10s)
* Prevents flooding FaultManager with duplicate reports
* PASSED events always forwarded (bypass filtering)

* Configuration via ROS parameters (filter_threshold, filter_window_sec)
* Thread-safe implementation with mutex-protected config access
* Contributors: Bartosz Burda, Michal Faferek
38 changes: 38 additions & 0 deletions src/ros2_medkit_gateway/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ros2_medkit_gateway
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* Initial rosdistro release
* HTTP REST gateway for ros2_medkit diagnostics system
* SOVD-compatible entity discovery with four entity types:

* Areas, Components, Apps, Functions
* HATEOAS links and capabilities in all responses
* Relationship endpoints (subareas, subcomponents, related-apps, hosts)

* Three discovery modes:

* Runtime-only: automatic ROS 2 graph introspection
* Manifest-only: YAML manifest with validation (11 rules)
* Hybrid: manifest as source of truth + runtime linking

* REST API endpoints:

* Fault management: GET/POST/DELETE /api/v1/faults
* Data access: topic sampling via GenericSubscription
* Operations: service calls and action goals via GenericClient
* Configuration: parameter get/set via ROS 2 parameter API
* Snapshots: GET /api/v1/faults/{code}/snapshots
* Rosbag: GET /api/v1/faults/{code}/snapshots/bag

* Server-Sent Events (SSE) at /api/v1/faults/stream:

* Multi-client support with thread-safe event queue
* Keepalive, Last-Event-ID reconnection, configurable max_clients

* JWT-based authentication with configurable policies
* HTTPS/TLS support via OpenSSL and cpp-httplib
* Native C++ ROS 2 serialization via ros2_medkit_serialization (no CLI dependencies)
* Contributors: Bartosz Burda, Michal Faferek
84 changes: 40 additions & 44 deletions src/ros2_medkit_gateway/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,54 +45,18 @@ find_package(OpenSSL REQUIRED)
# This enables the httplib::SSLServer class for HTTPS support
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT)

# Fetch header-only libraries
include(FetchContent)

# Fetch tl::expected (C++11/14/17 compatible std::expected alternative)
# Disable tests and examples to avoid clang-tidy analyzing external code
set(EXPECTED_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(EXPECTED_BUILD_PACKAGE OFF CACHE BOOL "" FORCE)
fetchcontent_declare(
tl_expected
GIT_REPOSITORY https://github.com/TartanLlama/expected.git
GIT_TAG v1.3.1
SYSTEM # Treat as system headers to suppress warnings
EXCLUDE_FROM_ALL # Don't build tests/examples
)
fetchcontent_getproperties(tl_expected)
if(NOT tl_expected_POPULATED)
fetchcontent_populate(tl_expected)
# Only add include directory, don't add_subdirectory to avoid install conflicts
endif()

# Create interface library for tl::expected manually
# Vendored header-only libraries (no network access on ROS build farm)
# tl::expected v1.3.1 (CC0) - https://github.com/TartanLlama/expected
add_library(tl_expected_iface INTERFACE)
target_include_directories(tl_expected_iface SYSTEM INTERFACE
${tl_expected_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src/vendored/tl_expected/include
)
add_library(tl::expected ALIAS tl_expected_iface)

# Fetch jwt-cpp header-only library
# Disable tests and examples to avoid clang-tidy analyzing external code
set(JWT_CPP_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(JWT_CPP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
fetchcontent_declare(
jwt-cpp
GIT_REPOSITORY https://github.com/Thalhammer/jwt-cpp.git
GIT_TAG v0.7.0
SYSTEM # Treat as system headers to suppress warnings
EXCLUDE_FROM_ALL # Don't build tests/examples
)
fetchcontent_getproperties(jwt-cpp)
if(NOT jwt-cpp_POPULATED)
fetchcontent_populate(jwt-cpp)
# Only add include directory, don't add_subdirectory to avoid install conflicts
endif()

# Create interface library for jwt-cpp manually
# jwt-cpp v0.7.0 (MIT) - https://github.com/Thalhammer/jwt-cpp
add_library(jwt_cpp_iface INTERFACE)
target_include_directories(jwt_cpp_iface SYSTEM INTERFACE
${jwt-cpp_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src/vendored/jwt_cpp/include
)
add_library(jwt-cpp::jwt-cpp ALIAS jwt_cpp_iface)

Expand Down Expand Up @@ -217,20 +181,52 @@ if(BUILD_TESTING)
set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../.clang-format")
set(ament_cmake_clang_tidy_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../.clang-tidy")

# Limit clang-tidy to only report issues from our source files (not FetchContent deps)
# Limit clang-tidy to only report issues from our source files (not vendored deps)
set(ament_cmake_clang_tidy_HEADER_FILTER "^${CMAKE_CURRENT_SOURCE_DIR}/(include|src|test)/")

# Exclude linters that don't work well with FetchContent dependencies:
# Exclude linters that don't work well with vendored dependencies:
# - uncrustify/cpplint: conflicts with clang-format
# - copyright/lint_cmake: flags generated/fetched files in install/
# - copyright/clang_format: we configure manually to skip src/vendored/
# - clang_tidy: we configure it manually below with increased timeout
list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_uncrustify
ament_cmake_cpplint
ament_cmake_clang_tidy
ament_cmake_copyright
ament_cmake_clang_format
)
ament_lint_auto_find_test_dependencies()

# Configure copyright check to exclude vendored dependencies
find_package(ament_cmake_copyright REQUIRED)
set(VENDORED_FILES
"src/vendored/jwt_cpp/include/jwt-cpp/base.h"
"src/vendored/jwt_cpp/include/jwt-cpp/jwt.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/boost-json/defaults.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/boost-json/traits.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/danielaparker-jsoncons/defaults.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/kazuho-picojson/defaults.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/kazuho-picojson/traits.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/nlohmann-json/defaults.h"
"src/vendored/jwt_cpp/include/jwt-cpp/traits/nlohmann-json/traits.h"
"src/vendored/jwt_cpp/include/picojson/picojson.h"
"src/vendored/tl_expected/include/tl/expected.hpp"
)
ament_copyright(EXCLUDE ${VENDORED_FILES})

# Configure clang-format to only check our source files (not vendored)
find_package(ament_cmake_clang_format REQUIRED)
file(GLOB_RECURSE _format_files
"include/*.h" "include/*.hpp"
"src/*.cpp" "src/*.h" "src/*.hpp"
"test/*.cpp" "test/*.h" "test/*.hpp"
)
list(FILTER _format_files EXCLUDE REGEX ".*/vendored/.*")
ament_clang_format(${_format_files}
CONFIG_FILE "${ament_cmake_clang_format_CONFIG_FILE}"
)

# Configure clang-tidy manually with increased timeout (1500s instead of default 300s)
# This is needed because the project has many files and clang-tidy analysis takes time
ament_clang_tidy(
Expand Down
3 changes: 2 additions & 1 deletion src/ros2_medkit_gateway/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
<depend>action_msgs</depend>
<depend>nlohmann-json-dev</depend>
<depend>libcpp-httplib-dev</depend>
<!-- jwt-cpp is fetched via CMake FetchContent (header-only, no system package) -->
<!-- jwt-cpp is vendored in src/vendored/jwt_cpp (header-only, no system package) -->
<!-- OpenSSL is found via CMake find_package (system package) -->
<depend>libssl-dev</depend>
<depend>yaml_cpp_vendor</depend>
<depend>ros2_medkit_msgs</depend>
<depend>ros2_medkit_serialization</depend>
Expand Down
21 changes: 21 additions & 0 deletions src/ros2_medkit_gateway/src/vendored/jwt_cpp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Dominik Thalhammer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading