# Repository Guidelines ## Project Structure & Module Organization This repository is a ROS 2 workspace. Keep hand-written code under `src/`; treat top-level `build/`, `install/`, and `log/` as generated output. Core packages include `src/arm_control_msgs` for ROS messages/services, `src/udp_teleop` for arm and vision Python nodes, `src/craic_localization` for localization/navigation Python nodes, and C++ sensor packages such as `src/rf2o_laser_odometry` and `src/ydlidar_ros2_driver`. Launch files live in package `launch/`, runtime parameters in `config/` or `params/`, and RViz assets in `rviz/`. ## Build, Test, and Development Commands Use the workspace script for normal builds: ```bash ./build.sh source install/setup.bash ``` `build.sh` sources ROS 2 Humble and runs `colcon build --symlink-install`. For targeted builds, prefer: ```bash colcon build --packages-select craic_localization udp_teleop colcon build --packages-select arm_control_msgs --cmake-args -DPython_EXECUTABLE=$CONDA_PREFIX/bin/python ``` Run nodes with `ros2 run`, for example: ```bash ros2 run udp_teleop arm_control --ros-args --params-file src/udp_teleop/config/arm_control.yaml ``` ## Coding Style & Naming Conventions Python uses 4-space indentation, `snake_case` modules, and `snake_case` console script names such as `navigate_to_point`. ROS interfaces use `PascalCase` (`MovePose.srv`, `TCPPose.msg`). Launch files should end in `.launch.py`. Follow existing ROS 2 defaults: concise docstrings, parameter-driven behavior, and package-local config files. C++ packages build with C++14 and warnings enabled (`-Wall -Wextra -Wpedantic`); keep headers in `include//` and source in `src/`. ## Testing Guidelines Run package tests before opening a PR: ```bash colcon test --packages-select udp_teleop craic_localization colcon test-result --verbose ``` `udp_teleop/test/` currently contains ROS linter tests for `flake8` and `pep257`. Add new Python tests under `test/` with `test_*.py` names. For C++ packages, enable `BUILD_TESTING`-compatible tests when adding nontrivial logic. ## Commit & Pull Request Guidelines Recent history follows Conventional Commits, often with scopes: `feat(craic_localization): ...`, `chore: ...`, `docs: ...`. Keep subjects imperative and under one line. PRs should describe affected packages, runtime impact, and exact validation commands. Include screenshots or RViz captures when changing visualization, launch behavior, or operator-facing workflows. ## Generated Files & Configuration Do not commit edits inside generated `build/`, `install/`, or `log/` directories. Update source files instead, then rebuild. Keep machine-specific IPs, ports, and calibration values in package YAML files under `config/` or `params/`, and document any hardware assumptions in the PR.