Skip to content

refactor(cpp): C++ modernization - typedef→using, code quality#133

Draft
vlordier wants to merge 15 commits into
Cosys-Lab:mainfrom
vlordier:openspec/drastic-improvements
Draft

refactor(cpp): C++ modernization - typedef→using, code quality#133
vlordier wants to merge 15 commits into
Cosys-Lab:mainfrom
vlordier:openspec/drastic-improvements

Conversation

@vlordier
Copy link
Copy Markdown

Summary

  • Replace C-style typedef with modern C++ using aliases in UpdatableContainer and GpsSimple
  • Part of broader C++ modernization pass for readability and consistency

Changes

  • AirLib/include/common/UpdatableContainer.hpp: 4× typedefusing
  • AirLib/include/sensors/gps/GpsSimple.hpp: 1× typedefusing

Test plan

  • Compile AirLib — no regressions

vlordier and others added 15 commits April 15, 2026 23:04
Comprehensive openspec specifications reviewed from:
- ML/Autonomy: Modern RL framework, sensor fusion, domain randomization,
  multi-agent RL, training pipeline, benchmarks, dataset export, MLOps
- Physics: Advanced aerodynamics, wind/turbulence, Pacejka tires,
  collision overhaul, material interactions, sensor noise, deformable
  terrain, underwater simulation
- Performance: Zero-copy pipeline, render pooling, multi-vehicle
  scalability, async GPU readback, RPC optimization, fixed timestep
- Engineering: Test suite, error handling, beacon refactor, API safety,
  settings validation, technical debt cleanup
- Architecture: Plugin registry, communication abstraction, event bus,
  sensor pipeline, state management, settings decomposition

Includes tracker.yaml with dependencies and 4-wave implementation roadmap.
Major additions:
- Character system (SPEC-035 to SPEC-043): CharacterPawn foundation,
  locomotion (walk/run/crawl/roll), animation system (dance/gestures),
  Mixed SimMode for characters + vehicles, vehicle enter/exit with
  seat system, hiding/cover system, motorbike vehicle type,
  autonomous pedestrian AI with crowd simulation, skeleton-based
  pose estimation ground truth
- Cosys-specific features (SPEC-044 to SPEC-051): annotation batch
  operations, external world sensor API, recording/playback system,
  detection pipeline enhancement, procedural generation API,
  lighting API, physics query/raycast API, ROS2 complete coverage

Dependency fixes:
- SPEC-022 (fixed timestep) now prerequisite for SPEC-009/010
- SPEC-028 (debt cleanup) now prerequisite for SPEC-023 (tests)
- Removed circular dependency between SPEC-029 and SPEC-030
- Removed false dependency SPEC-032 on SPEC-029
- Upgraded SPEC-022 and SPEC-028 to P0

Roadmap restructured into 8 waves with PR review guidelines
(max 1500 lines, one concern, < 2 weeks, split large specs).
- Add Python CI workflow with lint, typecheck, security audit, and tests
- Add lint workflow with pre-commit, hadolint, and shellcheck
- Add CodeQL security scanning for C++ code
- Add dependencies workflow for automated uv updates
- Add pre-commit configuration with ruff, pyupgrade, hadolint
- Add .dockerignore for cleaner Docker builds

All workflows run on Ubuntu with Python 3.12-3.14 support.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Update pyproject.toml: hatchling backend, Python 3.12+ only
- Add type annotations throughout client.py, types.py, utils.py
- Add explicit __all__ exports in __init__.py
- Remove unused pfm.py module (no longer referenced)
- Add py.typed marker for PEP 561 compliance
- Add comprehensive test suite with 19 passing tests
- Add dev dependencies: pytest, ruff, mypy, pyupgrade

Breaks compatibility with Python <3.12.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Pin all apt package versions for reproducible builds
- Pin pip package versions (pip==24.0, cosysairsim==3.3.1)
- Replace sudo with gosu in Dockerfile_binary
- Add --no-install-recommends to reduce image size
- Add proper apt cache cleanup (rm -rf /var/lib/apt/lists/*)
- Use COPY instead of ADD for local files (Dockerfile-ROS)
- Fix variable expansion quotes (Dockerfile-ROS2)
- Update pre-commit hadolint ignore rules

All Dockerfiles now pass hadolint validation.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Extract AirSimSettings_structs.hpp from AirSimSettings.hpp
  - Separate struct definitions from main settings class
  - Improves compilation times and code organization
- Modernize FileSystem.hpp with std::filesystem
  - Replace custom path handling with std::filesystem
  - Reduce code from 416 to 277 lines
- Update PID controller headers with modern C++ features
  - Use std::array instead of raw arrays
  - Use std::optional for optional parameters
- Add SimJoyStick.cpp implementation
- Update Unreal project files for 5.5 compatibility
- Add C++17 standard enforcement in CMakeLists.txt

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Apply ruff formatting to all example scripts
- Fix mixed indentation (spaces/tabs) in multi_agent_drone.py
- Use double quotes consistently (PEP 8)
- Use f-strings instead of % formatting where appropriate
- Remove trailing whitespace and blank lines
- Fix W293, E101, E711, E722, B007, F841 warnings

Car examples: 19 files formatted
Computer vision examples: 13 files formatted
Environment examples: 7 files formatted
Multirotor examples: 36 files formatted
Segmentation examples: 6 files formatted

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Format detection, eventcamera_sim, imitation_learning examples
- Format reinforcement_learning/airgym package
- Fix F401 unused imports in airgym/envs/__init__.py
- Fix B905 missing strict= in zip() for wav_reader.py
- Update mkdocs.yml configuration
- Fix ros2 package.xml: update maintainer, add URLs

All Python scripts now pass ruff validation.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add 20 PR specifications for planned improvements
  - C++ modernization (std::optional, std::filesystem, smart pointers)
  - Python modernization (type annotations, explicit imports)
  - CI/CD improvements (Python CI, pre-commit, Docker, security)
  - Code quality (typedef→using, mutable defaults fix)
  - ROS2 cleanup and documentation modernization
- Add AGENTS.md with development tools documentation
- Add GitHub skills for openspec workflow automation
- Add Claude Code skills and commands
- Add OpenCode skills and commands
- Add uv.lock for reproducible Python dependencies

Specification system tracks planned changes across the codebase.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Replace 'todo' comment with proper documentation in client.py
- Implement write_lidarData_to_disk() in drone_lidar.py
  - Save point cloud data to ASCII file format
  - Use tempfile for automatic file naming
  - Add docstring explaining functionality

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
mkdocs.yml:
- Add dark/light mode toggle with system preference detection
- Add site_author and repo_name metadata
- Add social links (GitHub, PyPI)
- Add comprehensive markdown_extensions (admonition, pymdownx, etc.)
- Add content.code features (copy, annotation)
- Add search features (suggest, highlight)
- Add navigation improvements (sections, expand, top button)
- Fix edit_uri path

.gitignore:
- Add Python virtual environments (.venv, venv, ENV, env)
- Add uv package manager files (uv.lock, .python-version)
- Add pytest cache and coverage files
- Add mypy cache files
- Add ruff cache files
- Add type stub files (*.pyi)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Remove commented-out debug code in JSonDataLog.cs
- Replace string format with interpolated strings in Px4DataLog.cs
- Use fully qualified System.Diagnostics.Debug namespace
- Simplify debug logging statements
- Remove dead code blocks

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add warnings module import
- Replace logging.warning with warnings.warn for deprecated APIs:
  - simSetLightIntensity
  - moveByAngleZAsync
  - moveByAngleThrottleAsync
- Use DeprecationWarning with stacklevel=2 for proper traceback
- Ensures deprecation warnings are shown to users by default

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Remove logging module (no longer used after deprecation warning fixes)
- All deprecated API warnings now use warnings.warn instead

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Replace C-style typedef with modern C++ using aliases in
UpdatableContainer and GpsSimple for consistency with the rest
of the codebase improvements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant