Repository navigation
feat: Generalise the alert system and add directional arrow support via the @left and @right syntax - #3
Merged
Conversation
@left and @right syntax
Contributor
There was a problem hiding this comment.
Pull request overview
This PR broadens the FRE Information Panel from “bug detection” to a generic alert system, switches the ROS topic to /information_panel/alert, and adds @left / @right directional support with corresponding UI + audio cues.
Changes:
- Refactor frontend parsing, theming, and runtime topic subscription from “bugs” to “alerts” (including new
diseased_planttype). - Add alert audio playback (intro/error + optional left/right cue) and update visuals/icons for directional guidance.
- Update docs/manifest and add
lucide-reactfor arrow icons.
Reviewed changes
Copilot reviewed 11 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/fre_information_panel/web.json | Updates the bridge subscription topic to /information_panel/alert. |
| src/fre_information_panel/src/useDetectedAlerts.ts | Renames and refactors the hook to subscribe to the new alert topic and manage idle clearing. |
| src/fre_information_panel/src/App.tsx | Generalises UI to alerts, parses @left/@right, and renders direction arrows + updated components. |
| src/fre_information_panel/src/alertThemes.ts | Introduces alert themes/keys and detection parsing for the new alert system. |
| src/fre_information_panel/src/AlertEmojiBackground.tsx | Renames and generalises the emoji background to support alert detections. |
| src/fre_information_panel/src/AlertAudioPlayer.tsx | Adds audio playback for alerts, including directional cue support. |
| src/fre_information_panel/public/manifest.webmanifest | Updates manifest description to reflect alerts/notifications. |
| src/fre_information_panel/package.json | Bumps version and adds lucide-react. |
| src/fre_information_panel/package-lock.json | Locks dependency updates including lucide-react. |
| src/fre_information_panel/launch/web.launch.py | Updates launch argument description to reflect alerts. |
| README.md | Updates topic name, expected options, and usage examples for alerts and direction syntax. |
| src/fre_information_panel/src/BugAudioPlayer.tsx | Removes the bug-specific audio player in favour of the alert-based implementation. |
Files not reviewed (1)
- src/fre_information_panel/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+11
to
+15
| - Topic: `/information_panel/alert` | ||
| - Message type: `std_msgs/msg/String` | ||
| - Expected options: `[ "bee", "butterfly", "ladybird" ]` | ||
| - Expected options: `[ "bee", "butterfly", "ladybird", "diseased_plant" ]` | ||
| - Can be passed as `bee,butterfly` when both are detected. | ||
| - Example: `diseased_plant` for diseased plant classification. |
Member
Author
There was a problem hiding this comment.
This is not correct. I will be getting in alerts for diseased_plant and not jute. However, the ROS system underpinning this will have the detections correctly.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nnouncement settings
…aid once at the end compared to with every item.
Test cases:
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee,butterfly,ladybird'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'ladybird@right'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee,butterfly,ladybird@left'}"
* we are making a breaking change with the alert topic so following semver
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.
This pull request completes work on issue #2 and refactors the FRE Information Panel to generalise from bug detection alerts to a broader system of alerts (including plant health and pest detection).
It introduces support for new alert types, adds more audio and visual cues for alerts, and updates the documentation and dependencies accordingly.
Generalisation and Feature Expansion:
/information_panel/alert,diseased_plant, etc.). [1] [2] [3] [4] [5] [6] [7] [8] [9]Audio and Visual Enhancements:
BugAudioPlayertoAlertAudioPlayerto provide audio feedback for alerts, including randomized intro and error tracks, and support for directional cues (left/right). [1] [2] [3]BugEmojiBackgroundtoAlertEmojiBackground, supporting all alert types. [1] [2] [3] [4] [5] [6]UI and Codebase Improvements:
App.tsxto handle generic alerts, support direction parsing and icons, and improve visual presentation for multiple alert types. [1] [2] [3] [4]Dependency and Manifest Updates:
lucide-reactfor icons and updated versioning inpackage.json. [1] [2] [3]These changes lay the foundation for supporting a variety of alerts in the FRE Information Panel, with improved user feedback via sound and visuals.