Skip to content

Commit 7e27714

Browse files
Update "Getting Started" and software architecture docs (UBC-Thunderbots#3313)
* Docs update * Update getting-started-wsl.md * Update getting-started-wsl.md * Update PR template * Getting Started changes * Update wsl instructions * Update docs * Address comments * Remove scripts for installing CLion and VS Code * Add markdown table of contents generator to lint_and_format.sh * Rename command-line to command line when it is a noun * Various nits * Remove references to World from Thunderloop * Update README * Lots of changes to software-architecture-and-design.md * Remove includes in primitive_executor.h * [pre-commit.ci lite] apply automatic fixes * Revert "Remove includes in primitive_executor.h" This reverts commit f127f5c. --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent e35ff59 commit 7e27714

25 files changed

Lines changed: 765 additions & 709 deletions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!---
2-
This file outlines a list of common things that should be addressed when opening a PR. It's built from previous issues we've seen in a lot of pull requests. If you notice something that's being noted in a lot of PR's, it should probably be added here to help save people time in the future.
3-
-->
2+
This file outlines a list of common things that should be addressed when opening a PR. It's built from previous issues we've seen in a lot of pull requests. If you notice something that's being noted in a lot of PRs, it should probably be added here to help save people time in the future.
43
5-
## Please fill out the following before requesting review on this PR
4+
Please fill out the following before requesting review on this PR!
5+
-->
66

77
### Description
88

@@ -19,13 +19,14 @@ This file outlines a list of common things that should be addressed when opening
1919
### Resolved Issues
2020

2121
<!--
22-
Link any issues that this PR resolved. Ex. `resolves #1, #2, and #5` (note that they MUST be specified like this so Github can automatically close them then this PR merges)
22+
Link any issues that this PR resolved. Ex. `resolves #1, closes #2, fixes #5` (note that they MUST be specified like this so Github can automatically close them then this PR merges)
2323
-->
2424

2525
### Length Justification and Key Files to Review
2626

27-
<!-- If this pull request is longer then **500** lines (additions + deletions), please justify here why we *cannot* break this up into multiple pull requests
28-
and list the key files that contain the main idea of your PR -->
27+
<!--
28+
If this pull request is longer then **500** lines (additions + deletions), please justify here why we *cannot* break this up into multiple pull requests and list the key files that contain the main content of your PR
29+
-->
2930

3031
### Review Checklist
3132

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
# Software
1+
<picture>
2+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/tbots_logo_dark.png">
3+
<img alt="Thunderbots Logo" src="docs/images/tbots_logo_light.png" width="300px">
4+
</picture>
5+
6+
---
27

38
[![Tbots CI](https://github.com/UBC-Thunderbots/Software/actions/workflows/main.yml/badge.svg)](https://github.com/UBC-Thunderbots/Software/actions?query=workflow%3A%22Tbots+CI%22+branch%3Amaster)
49

5-
Our main software and firmware repository. To get started, please see [Getting Started](docs/getting-started.md). Please thoroughly read this guide, along with our [style guide](docs/code-style-guide.md), before making *any* contributions.
10+
**Welcome to our main software and firmware repository!**
11+
Our team is building software that controls our fleet of autonomous soccer-playing robots competing in the [RoboCup Small Size League](https://ssl.robocup.org/).
12+
13+
- To get started with building and setting up our software, please see [Getting Started](docs/getting-started.md). Please thoroughly read this guide, along with our [style guide](docs/code-style-guide.md), before making *any* contributions.
614

7-
For an explanation of our software layout and architecture, check out [software architecture and design](docs/software-architecture-and-design.md).
15+
- Check out our [software architecture and design](docs/software-architecture-and-design.md) docs for an overview of how our software works and explanations of key systems and components.
816

9-
Want to learn more about the RoboCup Small Size League? (teams, rules, etc.) Check out the [Official RoboCup SSL Website](https://ssl.robocup.org/).
17+
- Want to learn more about the RoboCup Small Size League? (teams, rules, etc.) Check out the [Official RoboCup SSL Website](https://ssl.robocup.org/).
1018

11-
Want to edit these docs? If you're planning on editing diagrams, read the guide on [editing the docs](docs/editing-the-docs.md).
19+
- Want to edit these docs? If you're planning on editing diagrams, read the guide on [editing the docs](docs/editing-the-docs.md).

docs/code-style-guide.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# Code Style Guide
22

3-
## Table of Contents
4-
* [Names and Variables](#names-and-variables)
5-
* [Comments](#comments)
6-
* [Headers](#headers)
7-
* [Includes](#includes)
8-
* [Namespaces](#namespaces)
9-
* [Exceptions](#exceptions)
10-
* [Tests](#tests)
11-
* [Getter And Setter Functions](#getter-and-setter-functions)
12-
* [Static Creators](#static-creators)
13-
* [Spelling](#spelling)
14-
* [Miscellaneous](#miscellaneous)
15-
* [Protobuf](#protobuf)
16-
3+
### Table of Contents
4+
5+
<!--TOC-->
6+
7+
- [Table of Contents](#table-of-contents)
8+
- [Names and Variables](#names-and-variables)
9+
- [Comments](#comments)
10+
- [Headers](#headers)
11+
- [Includes](#includes)
12+
- [Namespaces](#namespaces)
13+
- [Exceptions](#exceptions)
14+
- [Tests](#tests)
15+
- [Getter And Setter Functions](#getter-and-setter-functions)
16+
- [Static Creators](#static-creators)
17+
- [Spelling](#spelling)
18+
- [Miscellaneous](#miscellaneous)
19+
- [Protobuf](#protobuf)
20+
21+
<!--TOC-->
1722

1823
Our C++ coding style is based off of [Google's C++ Style Guide](https://google.github.io/styleguide/cppguide.html). We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to enforce most of the nit-picky parts of the style, such as brackets and alignment, so this document highlights the important rules to follow that clang-format cannot enforce.
1924

docs/getting-started-wsl.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,42 @@
22

33
## Table of Contents
44

5-
* [Table Of Contents](#table-of-contents)
6-
* [Introduction](#introduction)
7-
* [WSLg Setup (Windows 11 - Recommended)](#wslg-setup-(windows-11---recommended))
8-
* [WSL2 Setup (windows 10)](#wsl2-setup-(windows-10))
9-
* [X Server Setup](#x-server-setup)
5+
<!--TOC-->
106

7+
- [Table of Contents](#table-of-contents)
8+
- [Introduction](#introduction)
9+
- [WSLg Setup (Windows 11/10 - Recommended)](#wslg-setup-windows-1110---recommended)
10+
- [WSL2 Setup (Windows 10)](#wsl2-setup-windows-10)
11+
- [X Server Setup](#x-server-setup)
12+
- [Networking Issues](#networking-issues)
13+
- [USB Issues](#usb-issues)
14+
15+
<!--TOC-->
1116

1217
## Introduction
1318

1419
Windows has a Windows Subsystem for Linux component that can be used to develop and run code for Linux on Windows. WSL1 was a Windows component that implemented Linux kernel interfaces, and didn't work great with Thunderbots software. WSL2 runs a full-fledged Linux kernel in a VM, and works great with Thunderbots software with the exception that we need to use software rendering instead of GPU-accelerated rendering for our AI. WSLg is WSL2 but with built-in support for running GUI applications (e.g. Thunderscope).
1520

16-
**Support for WSL is experimental. Because we use software rendering, the experience will also be degraded on computers with weak or old CPUs.**
17-
18-
**Note that this will not work with legacy robots. Due to the lack of USB support in WSL2, we are unable to use the USB dongle used to communicate with them.**
21+
> [!WARNING]
22+
> **Support for WSL is experimental. Performance will be degraded, features may not work properly, and the developer experience will be worse overall.**
1923
20-
## WSLg Setup (Windows 11 - Recommended)
21-
1. Installing WSLg is more straight forward than WSL2. For up to date documentation, please follow the [official documentation for setting up WSLg](https://github.com/microsoft/wslg#installing-wslg).
24+
## WSLg Setup (Windows 11/10 - Recommended)
25+
1. Installing WSLg is more straight forward than WSL2 and is the recommended way to run Linux GUI applications in Windows. For up to date documentation, please follow the [official documentation for setting up WSLg](https://github.com/microsoft/wslg#installing-wslg).
2226
2. Once you have completed all of the above, complete the [Software Setup](./getting-started.md).
2327

2428

2529
## WSL2 Setup (Windows 10)
26-
If you are not using Windows 11 and would prefer not to upgrade, you can follow the following steps. Note that this setup is more complex than the [WSLg](#wslg-setup-(windows-11---recommended)) setup as it does not support GUI applications out of the box.
30+
If you are not using Windows 11 or the latest version of Windows 10 and would prefer not to upgrade, you can follow the following steps. Note that this setup is more complex than the [WSLg](#wslg-setup-(windows-11---recommended)) setup as it does not support GUI applications out of the box.
2731
1. You'll need to be on build 19041 or later to use WSL2. If you have updated to Windows 10 version 2004 or newer, you will be able to use WSL2.
2832
2. When you have ensured that your Windows version supports WSL2, do the following to enable it.
2933
- Enable WSL by opening an Administrator PowerShell window and running command
30-
```
31-
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
32-
```
34+
```
35+
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
36+
```
3337
- Enable the 'Virtual Machine Platform' component by Administrator PowerShell window and running command
34-
```
35-
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
36-
37-
```
38+
```
39+
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
40+
```
3841
- Reboot your machine.
3942
3. Now, let's install Ubuntu.
4043
- Download the WSL2 kernel from [here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel).
@@ -62,3 +65,26 @@ If you are not using Windows 11 and would prefer not to upgrade, you can follow
6265
7. Verify that your system is configured correctly by running `glxgears -info` on the Linux command line. You should see a window pop up with spinning gears and the line `GL_RENDERER = llvmpipe (LLVM 9.0, 256 bits)` at the top of the output.
6366
6467
Once you have completed all of the above, complete the [Software Setup](./getting-started.md).
68+
69+
## Networking Issues
70+
71+
Networking compatibility with WSL is limited but it can be improved by enabling [mirrored mode](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking). There are still many unresolved issues with mirrored mode enabled (no vision, no robot status, etc.) but robot diagnostics should work and you should be able to control robots on the network.
72+
73+
Create a `.wslconfig` file in your `%UserProfile%` directory (typically your home directory, `cd ~`) and copy the following into the config file:
74+
75+
```
76+
[wsl2]
77+
networkingMode = mirrored
78+
```
79+
80+
This will enable [mirrored mode networking for WSL](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking). This mode “mirrors” the networking interfaces you have on Windows onto Linux, which improves networking capabilities and compatibility.
81+
82+
When selecting a network interface to use, choose `eth...`/`en...` or similar. There probably won’t be a `wlan` interface since WSL only sees the virtual network interface `eth...`.
83+
84+
## USB Issues
85+
86+
WSL does not natively support connecting USB devices, which is necessary for some tasks like flashing firmware onto our robots or using a physical e-stop. You will need to install a piece of open-source software called `usbipd-win` to support USB connectivity.
87+
88+
Please follow the [official documentation on installing `usbipd-win`](https://github.com/dorssel/usbipd-win?tab=readme-ov-file#how-to-install).
89+
90+
Note that connected devices are not automatically shared with `usbipd`, so you will have to manually share the device with `usbipd` and attach/detach the device to a `usbipd` client whenever you plug/unplug it (or between reboots). See the [official documentation for details on usage](https://github.com/dorssel/usbipd-win?tab=readme-ov-file#how-to-install).

0 commit comments

Comments
 (0)