diff --git a/.gitignore b/.gitignore index c249249..6b8e127 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ best.pt .venv .venv-formatters autonomy/src/autonomy.egg-info +hydrus_software_stack.egg-info diff --git a/hydrus_software_stack.egg-info/PKG-INFO b/hydrus_software_stack.egg-info/PKG-INFO new file mode 100644 index 0000000..93c0108 --- /dev/null +++ b/hydrus_software_stack.egg-info/PKG-INFO @@ -0,0 +1,120 @@ +Metadata-Version: 2.4 +Name: hydrus-software-stack +Version: 0.1.0 +Summary: Autonomous underwater vehicle software stack with computer vision and navigation capabilities +Home-page: https://github.com/your-username/hydrus-software-stack +Author: Cesar +Author-email: cesar@example.com +Project-URL: Bug Reports, https://github.com/your-username/hydrus-software-stack/issues +Project-URL: Source, https://github.com/your-username/hydrus-software-stack +Classifier: Development Status :: 3 - Alpha +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Operating System :: OS Independent +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: opencv-python +Requires-Dist: numpy +Requires-Dist: matplotlib +Requires-Dist: requests +Requires-Dist: colorama +Requires-Dist: pyserial +Requires-Dist: fastapi +Requires-Dist: Flask +Requires-Dist: black>=23.0.0 +Requires-Dist: isort>=5.12.0 +Requires-Dist: flake8>=6.0.0 +Requires-Dist: pre-commit>=3.0.0 +Requires-Dist: mypy>=1.0.0 +Provides-Extra: depth-estimation +Requires-Dist: onnx; extra == "depth-estimation" +Requires-Dist: onnxruntime-gpu; extra == "depth-estimation" +Requires-Dist: onnxscript; extra == "depth-estimation" +Requires-Dist: onnxslim; extra == "depth-estimation" +Requires-Dist: torch; extra == "depth-estimation" +Requires-Dist: torchvision; extra == "depth-estimation" +Requires-Dist: tqdm; extra == "depth-estimation" +Requires-Dist: typer; extra == "depth-estimation" +Provides-Extra: all +Requires-Dist: onnx; extra == "all" +Requires-Dist: onnxruntime-gpu; extra == "all" +Requires-Dist: onnxscript; extra == "all" +Requires-Dist: onnxslim; extra == "all" +Requires-Dist: torch; extra == "all" +Requires-Dist: torchvision; extra == "all" +Requires-Dist: tqdm; extra == "all" +Requires-Dist: typer; extra == "all" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: license-file +Dynamic: project-url +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary + +
+ +

๐ŸŒŠ Hydrus Software Stack

+ +

+ A comprehensive ROS-based toolkit for autonomous underwater vehicles. +
+ Built for RobSub competitions with maintainability and usability at its core. +

+ +

+ Philosophy + ยท + Autonomy Docs + ยท + Issues + ยท + Docker Setup + ยท + GitHub +

+ +Quick start: `./doctor.sh && ./docker/hydrus-docker/hocker` + +[![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)](./run_tests.sh) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +[![ROS](https://img.shields.io/badge/ROS-Melodic-blue.svg)](http://wiki.ros.org/melodic) +[![Docker](https://img.shields.io/badge/Docker-Enabled-blue.svg)](docker/README.md) + +
+ + +To start developing Hydrus +------ + +Hydrus is developed by [Rumarino Team](https://github.com/Rumarino-Team). We welcome both pull requests and issues on [GitHub](https://github.com/Rumarino-Team/hydrus-software-stack). + +* Read our [Philosophy & Contributing Guide](PHILOSOPHY.md) +* Check out the [autonomy system documentation](autonomy/README.md) +* Explore the [Docker deployment options](docker/README.md) +* Join discussions in [GitHub Issues](../../issues) + +Want to contribute? Check our [open issues](../../issues) and follow our [contribution guidelines](PHILOSOPHY.md). + +
+MIT Licensed + +Hydrus is released under the MIT license. Some parts of the software are released under other licenses as specified. + +Any user of this software shall indemnify and hold harmless the Rumarino Team and its members from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses which arise out of, relate to or result from any use of this software by user. + +**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH AND COMPETITION PURPOSES ONLY. THIS IS NOT A PRODUCT. +YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS. +NO WARRANTY EXPRESSED OR IMPLIED.** +
diff --git a/hydrus_software_stack.egg-info/SOURCES.txt b/hydrus_software_stack.egg-info/SOURCES.txt new file mode 100644 index 0000000..c0797ff --- /dev/null +++ b/hydrus_software_stack.egg-info/SOURCES.txt @@ -0,0 +1,45 @@ +LICENSE +README.md +pyproject.toml +setup.py +autonomy/__init__.py +autonomy/arduino_simulator.py +autonomy/setup.py +autonomy/test_controller.py +autonomy/scripts/__init__.py +autonomy/scripts/profiler/__init__.py +autonomy/scripts/profiler/profiling_decorators.py +autonomy/scripts/profiler/profiling_test.py +autonomy/scripts/profiler/ros_profiler.py +autonomy/scripts/profiler/ros_profiler_demo.py +autonomy/scripts/web/__init__.py +autonomy/scripts/web/detection_viewer.py +autonomy/src/__init__.py +autonomy/src/api_server.py +autonomy/src/controllers.py +autonomy/src/custom_types.py +autonomy/src/cv_publishers.py +autonomy/src/mission_planner/__init__.py +autonomy/src/mission_planner/base_mission.py +autonomy/src/mission_planner/gate_mission.py +autonomy/src/mission_planner/gate_mission_tester.py +autonomy/src/mission_planner/gate_tester_visualizer.py +autonomy/src/mission_planner/mission_manager.py +autonomy/src/mission_planner/mission_tree.py +autonomy/src/mission_planner/prequalification_mission.py +autonomy/src/mission_planner/slalom_mission.py +autonomy/src/mission_planner/slalom_visualizer.py +autonomy/src/mission_planner/tagging_mission.py +autonomy/src/mission_planner/tagging_mission_test.py +autonomy/src/mission_planner/task_parameters.py +autonomy/src/mission_planner/test_gate_mission.py +autonomy/src/mission_planner/test_slalom.py +autonomy/src/mission_planner/test_slalom_integration.py +autonomy/src/mission_planner/types.py +hydrus_software_stack.egg-info/PKG-INFO +hydrus_software_stack.egg-info/SOURCES.txt +hydrus_software_stack.egg-info/dependency_links.txt +hydrus_software_stack.egg-info/entry_points.txt +hydrus_software_stack.egg-info/not-zip-safe +hydrus_software_stack.egg-info/requires.txt +hydrus_software_stack.egg-info/top_level.txt \ No newline at end of file diff --git a/hydrus_software_stack.egg-info/dependency_links.txt b/hydrus_software_stack.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/hydrus_software_stack.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/hydrus_software_stack.egg-info/entry_points.txt b/hydrus_software_stack.egg-info/entry_points.txt new file mode 100644 index 0000000..f06db19 --- /dev/null +++ b/hydrus_software_stack.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +hydrus-depth-estimator = autonomy.src.computer_vision.depth_estimation:main diff --git a/hydrus_software_stack.egg-info/not-zip-safe b/hydrus_software_stack.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/hydrus_software_stack.egg-info/not-zip-safe @@ -0,0 +1 @@ + diff --git a/hydrus_software_stack.egg-info/requires.txt b/hydrus_software_stack.egg-info/requires.txt new file mode 100644 index 0000000..3af6dfa --- /dev/null +++ b/hydrus_software_stack.egg-info/requires.txt @@ -0,0 +1,33 @@ +opencv-python +numpy +matplotlib +requests +colorama +pyserial +fastapi +Flask +black>=23.0.0 +isort>=5.12.0 +flake8>=6.0.0 +pre-commit>=3.0.0 +mypy>=1.0.0 + +[all] +onnx +onnxruntime-gpu +onnxscript +onnxslim +torch +torchvision +tqdm +typer + +[depth-estimation] +onnx +onnxruntime-gpu +onnxscript +onnxslim +torch +torchvision +tqdm +typer diff --git a/hydrus_software_stack.egg-info/top_level.txt b/hydrus_software_stack.egg-info/top_level.txt new file mode 100644 index 0000000..342156a --- /dev/null +++ b/hydrus_software_stack.egg-info/top_level.txt @@ -0,0 +1 @@ +autonomy diff --git a/scripts/cli.py b/scripts/cli.py index e5d849b..0b1fc61 100755 --- a/scripts/cli.py +++ b/scripts/cli.py @@ -6,6 +6,7 @@ from .commands.ros import ros_app from .commands.test import test_app from .commands.tmux import tmux_command +from .commands.todo import todo_app app = typer.Typer() @@ -19,6 +20,7 @@ app.add_typer(ros_app, name="ros", help="ROS workspace and utilities management") app.add_typer(test_app, name="test", help="Test suite management and execution") app.add_typer(tmux_command, name="tmux", help="Tmux session management commands") +app.add_typer(todo_app, name="todo", help="TODO and FIXME tracker for code analysis") @app.command() diff --git a/scripts/commands/todo.py b/scripts/commands/todo.py new file mode 100644 index 0000000..196a1c3 --- /dev/null +++ b/scripts/commands/todo.py @@ -0,0 +1,429 @@ +#!/usr/bin/env python3 +""" +TODO and FIXME tracker for the Hydrus Software Stack. + +This module provides functionality to scan the repository for TODO, FIXME, +HACK, NOTE, and XXX comments, generate reports, and optionally link them +to GitHub issues. +""" + +import json +import os +import re +from collections import defaultdict +from pathlib import Path +from typing import Dict, List, Optional, Tuple + +import typer +from rich.console import Console +from rich.table import Table + +# Create the todo subcommand app +todo_app = typer.Typer() + +console = Console() + +# Default file extensions to search +DEFAULT_EXTENSIONS = [ + '.py', '.cpp', '.c', '.h', '.hpp', '.js', '.ts', '.md', '.yaml', '.yml', + '.launch', '.xml', '.sh', '.bash', '.json', '.txt', '.rst' +] + +# Default comment patterns to search for +DEFAULT_PATTERNS = ['TODO', 'FIXME', 'HACK', 'NOTE', 'XXX', 'BUG'] + + +class TodoItem: + """Represents a TODO/FIXME item found in the codebase.""" + + def __init__(self, file_path: str, line_number: int, content: str, + pattern: str, context: str = "", issue_number: Optional[int] = None): + self.file_path = file_path + self.line_number = line_number + self.content = content.strip() + self.pattern = pattern + self.context = context.strip() + self.issue_number = issue_number + + def to_dict(self) -> dict: + """Convert to dictionary for JSON serialization.""" + return { + 'file_path': self.file_path, + 'line_number': self.line_number, + 'content': self.content, + 'pattern': self.pattern, + 'context': self.context, + 'issue_number': self.issue_number + } + + +class TodoTracker: + """Main class for scanning and tracking TODO items.""" + + def __init__(self, root_path: str = ".", + extensions: List[str] = None, + patterns: List[str] = None): + self.root_path = Path(root_path).resolve() + self.extensions = extensions or DEFAULT_EXTENSIONS + self.patterns = patterns or DEFAULT_PATTERNS + self.exclude_dirs = {'.git', '__pycache__', '.venv', 'venv', 'node_modules', + 'build', 'dist', '.pytest_cache', 'hydrus_software_stack.egg-info'} + + def _should_exclude_path(self, path: Path) -> bool: + """Check if a path should be excluded from scanning.""" + for part in path.parts: + if part in self.exclude_dirs or part.startswith('.'): + return True + + # Exclude the todo.py file itself to avoid self-references + if path.name == 'todo.py': + return True + + return False + + def _extract_issue_number(self, content: str) -> Optional[int]: + """Extract GitHub issue number from comment if present.""" + # Look for patterns like #123, issue #123, fixes #123, etc. + issue_patterns = [ + r'#(\d+)', + r'issue\s*#?(\d+)', + r'fixes?\s*#?(\d+)', + r'closes?\s*#?(\d+)', + r'resolves?\s*#?(\d+)' + ] + + for pattern in issue_patterns: + match = re.search(pattern, content, re.IGNORECASE) + if match: + return int(match.group(1)) + return None + + def _scan_file(self, file_path: Path) -> List[TodoItem]: + """Scan a single file for TODO patterns.""" + todos = [] + + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + lines = f.readlines() + + for line_num, line in enumerate(lines, 1): + line_clean = line.strip() + if not line_clean: + continue + + # Check for any of our patterns + for pattern in self.patterns: + # Create case-insensitive pattern matching for comment-style TODO/FIXME + # Look for the pattern preceded by comment markers and optionally followed by a colon + regex_pattern = rf'(?i)(?://|#|\*|