diff --git a/.github/workflows/ci-pre-commit.yaml b/.github/workflows/ci-pre-commit.yaml deleted file mode 100644 index 642bb7fb..00000000 --- a/.github/workflows/ci-pre-commit.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Run Pre-Commit Workflow -# Run pre-commit hooks on a repository -on: - workflow_dispatch: - pull_request: -jobs: - call_reusable_workflow: - uses: vortexntnu/vortex-ci/.github/workflows/reusable-pre-commit.yaml@main - with: - ref: ${{ github.ref }} - python_version: '3.11' diff --git a/.github/workflows/industrial-ci.yml b/.github/workflows/industrial-ci.yml new file mode 100644 index 00000000..32c67bec --- /dev/null +++ b/.github/workflows/industrial-ci.yml @@ -0,0 +1,12 @@ +name: Industrial CI + +on: + push: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' # Runs daily to check for dependency issues or flaking tests +jobs: + call_reusable_workflow: + uses: vortexntnu/vortex-ci/.github/workflows/reusable-industrial-ci.yml@main + with: + upstream_workspace: './ros2.repos' diff --git a/.github/workflows/source-build.yaml b/.github/workflows/source-build.yaml deleted file mode 100644 index 802f5363..00000000 --- a/.github/workflows/source-build.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Source Build -# Build the ROS 2 workspace from source code and run tests -on: - workflow_dispatch: - pull_request: - # Runs daily to check for dependency issues or flaking tests - schedule: - - cron: "0 1 * * *" -jobs: - source-build: - uses: vortexntnu/vortex-ci/.github/workflows/reusable-source-build.yaml@main - with: - ros_distro: 'humble' - os_name: 'ubuntu-22.04' - ref: ${{ github.ref_name }} - vcs_repo_file_url: 'https://raw.githubusercontent.com/vortexntnu/vortex-auv/main/ros2.repos' diff --git a/.github/workflows/update-pre-commit.yaml b/.github/workflows/update-pre-commit.yaml deleted file mode 100644 index 1246b33f..00000000 --- a/.github/workflows/update-pre-commit.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Run Pre-Commit Update Workflow -# Update pre-commit config and create a pull request if changes are detected -on: - workflow_dispatch: - schedule: - - cron: "0 0 1 * *" # Run every month at midnight on the first day of the month -jobs: - call_reusable_workflow: - uses: vortexntnu/vortex-ci/.github/workflows/reusable-update-pre-commit.yaml@main - with: - ref: ${{ github.ref }} - python_version: '3.10' - responsible: 'kluge7' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57c99b9d..4a0d0fa3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: - id: requirements-txt-fixer # Python hooks - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.0 hooks: - id: ruff-format - id: ruff @@ -70,7 +70,7 @@ repos: pass_filenames: true # C++ hooks - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v19.1.3 + rev: v19.1.4 hooks: - id: clang-format args: [--style=file] @@ -80,3 +80,6 @@ repos: hooks: - id: codespell args: ['--write-changes', '--ignore-words-list=theses'] + +ci: + autoupdate_schedule: quarterly diff --git a/mission/gui_auv/auv_gui/auv_gui.py b/mission/gui_auv/auv_gui/auv_gui.py index 9257c691..25ef8a7d 100644 --- a/mission/gui_auv/auv_gui/auv_gui.py +++ b/mission/gui_auv/auv_gui/auv_gui.py @@ -1,7 +1,7 @@ import math import sys from threading import Thread -from typing import List, Optional +from typing import Optional import matplotlib.pyplot as plt import numpy as np @@ -25,7 +25,7 @@ # --- Quaternion to Euler angles --- -def quaternion_to_euler(x: float, y: float, z: float, w: float) -> List[float]: +def quaternion_to_euler(x: float, y: float, z: float, w: float) -> list[float]: """Convert a quaternion to Euler angles (roll, pitch, yaw). Args: @@ -92,14 +92,14 @@ def __init__(self) -> None: ) # Variables to store odometry data - self.xpos_data: List[float] = [] # x position - self.ypos_data: List[float] = [] # y position - self.zpos_data: List[float] = [] # z position + self.xpos_data: list[float] = [] # x position + self.ypos_data: list[float] = [] # y position + self.zpos_data: list[float] = [] # z position - self.w_data: List[float] = [] # w component of the quaternion - self.x_data: List[float] = [] # x component of the quaternion - self.y_data: List[float] = [] # y component of the quaternion - self.z_data: List[float] = [] # z component of the quaternion + self.w_data: list[float] = [] # w component of the quaternion + self.x_data: list[float] = [] # x component of the quaternion + self.y_data: list[float] = [] # y component of the quaternion + self.z_data: list[float] = [] # z component of the quaternion self.roll: Optional[float] = None self.pitch: Optional[float] = None @@ -196,13 +196,13 @@ def __init__(self, gui_node: GuiNode, parent: Optional[QWidget] = None) -> None: self.ax.set_title("Position") # Initialize data lists for 3D plot - self.x_data: List[float] = [] - self.y_data: List[float] = [] - self.z_data: List[float] = [] + self.x_data: list[float] = [] + self.y_data: list[float] = [] + self.z_data: list[float] = [] (self.line,) = self.ax.plot([], [], [], 'b-') def update_plot( - self, x_data: List[float], y_data: List[float], z_data: List[float] + self, x_data: list[float], y_data: list[float], z_data: list[float] ) -> None: """Update the 3D plot with the latest odometry data.""" # Convert lists to numpy arrays to ensure compatibility with the plot functions @@ -238,7 +238,7 @@ def run_ros_node(ros_node: GuiNode, executor: MultiThreadedExecutor) -> None: rclpy.spin(ros_node, executor) -def main(args: Optional[List[str]] = None) -> None: +def main(args: Optional[list[str]] = None) -> None: """The main function to initialize ROS2 and the GUI application.""" rclpy.init(args=args) ros_node = GuiNode()