-
Notifications
You must be signed in to change notification settings - Fork 1
[#13] Add sensor diagnostics demo #14
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
Merged
+2,471
−1
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dbd6717
feat(sensor-diagnostics): add project skeleton and LiDAR simulator node
bburda b72d5a5
feat(sensor-diagnostics): add IMU, GPS, and camera simulator nodes
bburda 4f567b2
feat(sensor-diagnostics): add anomaly detector node
bburda 8f2e6b3
feat(sensor-diagnostics): add config files and launch system
bburda d0a794e
feat(sensor-diagnostics): add Docker support
bburda da1a3c4
feat(sensor-diagnostics): add demo scripts and documentation
bburda aacda07
docs: update main README with sensor diagnostics demo
bburda fa254ed
ci: add sensor diagnostics demo to CI pipeline
bburda 2c05967
fix(docker): include all ros2_medkit dependencies
bburda ce7a928
fix(docker): resolve build issues for sensor diagnostics demo
bburda a2bd2ae
feat: integrate anomaly detector with fault_manager
bburda 180ebde
feat: implement dual fault reporting paths (legacy + modern)
bburda fc395d4
feat: add fault clearing to restore-normal.sh script
bburda 95735a5
fix: address PR review comments from Copilot
bburda f10b563
fix: async_send_request with callback + correct fault clearing paths
bburda 6e0c47b
fix: address all PR #14 review comments
bburda c606ccb
refactor: remove unused simulated_sensor_base.hpp (YAGNI)
bburda c441941
fix(sensor-demo): Fix fault injection scripts
bburda 8a13e05
docs: note that sensors use ERROR level for all non-OK states
bburda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| cmake_minimum_required(VERSION 3.8) | ||
| project(sensor_diagnostics_demo) | ||
|
|
||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra -Wpedantic) | ||
| endif() | ||
|
|
||
| # Find dependencies | ||
| find_package(ament_cmake REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(std_msgs REQUIRED) | ||
| find_package(sensor_msgs REQUIRED) | ||
| find_package(geometry_msgs REQUIRED) | ||
| find_package(diagnostic_msgs REQUIRED) | ||
| find_package(rcl_interfaces REQUIRED) | ||
| find_package(ros2_medkit_msgs REQUIRED) | ||
|
|
||
| # LiDAR simulator node | ||
| add_executable(lidar_sim_node src/lidar_sim_node.cpp) | ||
| ament_target_dependencies(lidar_sim_node | ||
| rclcpp | ||
| sensor_msgs | ||
| diagnostic_msgs | ||
| rcl_interfaces | ||
| ) | ||
|
|
||
| # IMU simulator node | ||
| add_executable(imu_sim_node src/imu_sim_node.cpp) | ||
| ament_target_dependencies(imu_sim_node | ||
| rclcpp | ||
| sensor_msgs | ||
| diagnostic_msgs | ||
| ) | ||
|
|
||
| # GPS simulator node | ||
| add_executable(gps_sim_node src/gps_sim_node.cpp) | ||
| ament_target_dependencies(gps_sim_node | ||
| rclcpp | ||
| sensor_msgs | ||
| diagnostic_msgs | ||
| ) | ||
|
|
||
| # Camera simulator node | ||
| add_executable(camera_sim_node src/camera_sim_node.cpp) | ||
| ament_target_dependencies(camera_sim_node | ||
| rclcpp | ||
| sensor_msgs | ||
| diagnostic_msgs | ||
| rcl_interfaces | ||
| ) | ||
|
|
||
| # Anomaly detector node | ||
| add_executable(anomaly_detector_node src/anomaly_detector_node.cpp) | ||
| ament_target_dependencies(anomaly_detector_node | ||
| rclcpp | ||
| sensor_msgs | ||
| diagnostic_msgs | ||
| ros2_medkit_msgs | ||
| ) | ||
|
|
||
| # Install executables | ||
| install(TARGETS | ||
| lidar_sim_node | ||
| imu_sim_node | ||
| gps_sim_node | ||
| camera_sim_node | ||
| anomaly_detector_node | ||
| DESTINATION lib/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| # Install launch files | ||
| install(DIRECTORY launch/ | ||
| DESTINATION share/${PROJECT_NAME}/launch | ||
| ) | ||
|
|
||
| # Install config files | ||
| install(DIRECTORY config/ | ||
| DESTINATION share/${PROJECT_NAME}/config | ||
| ) | ||
|
|
||
| if(BUILD_TESTING) | ||
| find_package(ament_lint_auto REQUIRED) | ||
| ament_lint_auto_find_test_dependencies() | ||
| endif() | ||
|
|
||
| ament_package() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Sensor Diagnostics Demo | ||
| # Lightweight ROS 2 image without Gazebo - fast build and startup | ||
| # Image size: ~500MB vs ~4GB for TurtleBot3 demo | ||
| # Startup time: ~5s vs ~60s | ||
|
|
||
| FROM ros:jazzy-ros-base | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV ROS_DISTRO=jazzy | ||
| ENV COLCON_WS=/root/demo_ws | ||
|
|
||
| # Install minimal dependencies (no Gazebo, no simulation packages) | ||
| RUN apt-get update && apt-get install -y \ | ||
| ros-jazzy-ament-lint-auto \ | ||
| ros-jazzy-ament-lint-common \ | ||
| ros-jazzy-ament-cmake-gtest \ | ||
| ros-jazzy-yaml-cpp-vendor \ | ||
| ros-jazzy-example-interfaces \ | ||
| python3-colcon-common-extensions \ | ||
| python3-requests \ | ||
| nlohmann-json3-dev \ | ||
| libcpp-httplib-dev \ | ||
| libsqlite3-dev \ | ||
| git \ | ||
| curl \ | ||
| jq \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Clone ros2_medkit from GitHub (gateway + dependencies) | ||
| WORKDIR ${COLCON_WS}/src | ||
| RUN git clone --depth 1 --recurse-submodules https://github.com/selfpatch/ros2_medkit.git && \ | ||
| mv ros2_medkit/src/ros2_medkit_gateway . && \ | ||
| mv ros2_medkit/src/ros2_medkit_serialization . && \ | ||
| mv ros2_medkit/src/ros2_medkit_msgs . && \ | ||
| mv ros2_medkit/src/ros2_medkit_fault_manager . && \ | ||
| mv ros2_medkit/src/ros2_medkit_fault_reporter . && \ | ||
| mv ros2_medkit/src/ros2_medkit_diagnostic_bridge . && \ | ||
| mv ros2_medkit/src/dynamic_message_introspection/dynmsg . && \ | ||
| rm -rf ros2_medkit | ||
|
|
||
| # Copy demo package | ||
| COPY package.xml CMakeLists.txt ${COLCON_WS}/src/sensor_diagnostics_demo/ | ||
| COPY src/ ${COLCON_WS}/src/sensor_diagnostics_demo/src/ | ||
| COPY config/ ${COLCON_WS}/src/sensor_diagnostics_demo/config/ | ||
| COPY launch/ ${COLCON_WS}/src/sensor_diagnostics_demo/launch/ | ||
|
|
||
| # Build all packages (skip test dependencies that aren't in ros-base) | ||
| WORKDIR ${COLCON_WS} | ||
| RUN bash -c "source /opt/ros/jazzy/setup.bash && \ | ||
| rosdep update && \ | ||
| rosdep install --from-paths src --ignore-src -r -y \ | ||
| --skip-keys='ament_cmake_clang_format ament_cmake_clang_tidy test_msgs example_interfaces sqlite3' && \ | ||
| colcon build --symlink-install --cmake-args -DBUILD_TESTING=OFF" | ||
|
|
||
| # Setup environment | ||
| RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ | ||
| echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc | ||
|
|
||
| # Expose gateway port | ||
| EXPOSE 8080 | ||
|
|
||
| # Default command: launch the demo | ||
| CMD ["bash", "-c", "source /opt/ros/jazzy/setup.bash && source /root/demo_ws/install/setup.bash && ros2 launch sensor_diagnostics_demo demo.launch.py"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.