Add emergency UI widgets: EmergencyAlert, KillSwitch, SurfaceButton#1
Open
niclassvardal-boop wants to merge 1 commit intomainfrom
Open
Add emergency UI widgets: EmergencyAlert, KillSwitch, SurfaceButton#1niclassvardal-boop wants to merge 1 commit intomainfrom
niclassvardal-boop wants to merge 1 commit intomainfrom
Conversation
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.
Step 2: To do in Qt Designer
1. Add a
QGroupBoxfor emergency buttonsEmergencyPanelQVBoxLayout)2. Add a
QTextEditfor logsLogPanelreadOnly = True3. (optional) Add a
QPushButtonto trigger the alertTestAlertButton4. Ensure there’s a
QWidgetnamedMainTabStep 3: Regenerate the Python UI Class
After saving the
.uifile, run:This updates the Python class with references to the promoted widgets.
Step 4: Import Custom Classes Before setupUi()
In your main GUI node (
gui_ros_node.py), make sure you import:Then load the UI:
Qt will automatically instantiate the promoted widgets.
What you’ll do in Python
You’ve already written the logic — just make sure it’s modular and safe:
Add this to gui_ros_node > MyGuiNode > init:
Add this to gui_ros_node > MyGuiNode(Node):
Emergency buttons
Log panel
Emergency alert
Todo
The KillSwitch and SurfaceButton widgets are fully integrated into the GUI layout, but they are not yet connected to any drone commands. Their callbacks currently log events to the GUI (LogPanel) for testing purposes only.
Implementing the actual kill and surface commands — such as publishing to ROS topics or triggering service calls — is a separate task and need to be handled in the future