Implement ros2_svdd_monitor: SVDD anomaly detection for proprioceptive sensors#2
Draft
Implement ros2_svdd_monitor: SVDD anomaly detection for proprioceptive sensors#2
Conversation
Co-authored-by: jondave <6209386+jondave@users.noreply.github.com>
Co-authored-by: jondave <6209386+jondave@users.noreply.github.com>
Co-authored-by: jondave <6209386+jondave@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create ROS 2 SVDD monitor package using proprioceptive sensors
Implement ros2_svdd_monitor: SVDD anomaly detection for proprioceptive sensors
Dec 9, 2025
- Introduced a new metadata.yaml file containing detailed information about the dynium_system_filtered rosbag. - Included bagfile information such as version, storage identifier, duration, starting time, and message count. - Documented topics with their respective message counts, types, serialization formats, and QoS profiles. - Specified the relative file paths and details of the associated database file.
- Updated config.yaml to include ROS 2 topic names and adjusted anomaly threshold. - Modified monitor.py to use flexible QoS settings for subscriptions. - Implemented warmup period for anomaly detection to stabilize windows. - Improved logging for detected anomalies with detailed diagnostics.
…ic with auto-thresholding and hysteresis
- Implemented `record_features.py` to record /cmd_vel and /imu topics, compute sliding-window features, and save them to a .npz file. - Created `train_ms_svdd.py` for training Mahalanobis-SVDD using extracted features from .npz or .csv files.
- Introduced `train_ms_svdd.py` for training Mahalanobis-SVDD models using extracted features. - Added `svm_svdd` package containing: - `__init__.py` to define the package structure. - `svm_svdd_model.py` implementing a wrapper for sklearn's OneClassSVM for anomaly detection. - `train_svm_svdd.py` for training the OneClassSVM model and saving artifacts. - `eval_svm_svdd.py` for evaluating the trained model and generating anomaly scores. - Implemented feature loading functions to support .npz, .csv, and .parquet formats. - Ensured compatibility with both direct script execution and package imports.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements a complete ROS 2 Python package for real-time anomaly detection using Support Vector Data Description (SVDD via OneClassSVM) on proprioceptive sensors (/cmd_vel and /imu). Detects anomalies by learning the expected relationship between commanded motion and IMU response.
Package Structure
svdd_model.py), sliding-window feature extraction (features.py), ROS 2 monitor node (monitor.py), training CLI (train.py)Entry Points
train: Offline training from CSV
monitor: Real-time anomaly detection node
Feature Engineering
Extracts 20 features from sliding windows:
Detects wheel slip, motor failures, collisions, sensor degradation.
Example Usage
Changes
src/ros2_svdd_monitor/.devcontainer/from templateConfiguration
All hyperparameters in
config/config.yaml:Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.