Immortals-Robotics / Tyr

Immortals software for the RoboCup Soccer Small-Size League
GNU General Public License v3.0
3 stars 0 forks source link

Tyr: God of valor and justice

Build C++ format check File name check Typo check

Tyr GUI

Building

Prerequisites

We are actively testing on Windows and macOS, but other systems that meet the requirements should theoretically work fine.

Build

You should be able to generate build scripts and build the project using one of the CMake presets in CMakePresets.json. But as we primarily use Visual Studio Code as our IDEs. The rest of this readme focuses on them.

VS Code

Extensions

We have a set of recommended VS Code extensions in .vscode/extensions.json. You should get a popup to install them when you open the project. If not, be sure to do it manually.

  1. Clone this repo, including its submodules.
  2. Open tyr.code-workspace in VS Code.
  3. Select the desired CMake preset using the CMake: Select Configure Preset command.
    • Use [platform-name]-debug during development
    • Use [platform-name]-release for testing on real robots
  4. Build the project using CMake: Build.

If everything goes well, you should then see the following line in the CMake/Build output:

[build] Build finished with exit code 0

Usage

In the CMake tab, select the desired launch target and run it using the play button at the bottom of the screen.

Coding standard

We use cppbestpractices by Jason Turner as the basis for our standard.

.clang-tidy file contains the current naming convention we use. In addition, file and folder names should be lower_case. C++ files should have a .cpp extension, C files .c, and header files .h.

.clang-format file contains the current formatting style we use.

Both .clang-tidy and .clang-format are supported in most IDEs, and can help validate your code according to the standards, and even make necessary changes to be conformant.

General style

Indentation

Indent with 4 spaces.

Spaces

Add spaces after C-style casts. Do not add spaces within angle brackets for template parameters.

Brace style

Place opening braces on the line after control statements, classes, enums, functions, namespaces, structs, unions, and extern blocks.

Namespace

Use compact namespaces (A::B) when possible.

Include directives

Group include directives into categories and order them as follows:

  1. Corresponding include (file.h for file.cpp) ("...")
  2. System includes (<...>)
  3. Dependency includes (<...>)
  4. Other includes ("...")

Alignment

Naming style

Ensure consistency and readability by following these naming conventions throughout codebase:

Files and folders

Namespace

Types

Functions

Fields

Enums

Variables

Parameters

Constants

Macros

Branching

We use Github flow as our branching strategy. Direct commits to the main branch are disabled, the goal is to keep it stable and usable.

Workflow

  1. Create a new branch from main named dev/your-awesome-dev-task.
  2. Commit changes to your new branch.
  3. Open a pull request when you're done.
  4. After your PR is approved and all checks are passed, merge it into the main branch.
  5. Delete your dev branch.

License

This project is licensed under the terms of the GNU GPLv3.