Skip to content

Commit 47d45b8

Browse files
itsarunewilliamckhapre-commit-ci-lite[bot]arunwmostrenko
authored
Preliminary support for Ubuntu 24 and Ubuntu 24 ARM (UBC-Thunderbots#3316)
* Update to python 3.10.0 and bazel 5.4.0 * No need to import `typing` for collections as of python 3.9 * Update black formatter to 24.4.2 * Run fix_formatting.sh * Remove PyOpenGL-accelerate dependency * Install latest pip in setup_software.sh * Install latest pip in setup_software.sh * Testing * Testing * Remove testing * Bump pyqtgraph to 0.13.3 * Update setup_software.sh * Try fixing precommit * Try fixing precommit * Try fixing precommit * Replace black/autoflake with ruff * Remove black binary * Remove git attribute * Remove unused check_formatting_ci.sh * Run fix_formatting.sh * Add simulated/field test fixtures to conftest.py * Address UBC-Thunderbots#3251 * Python code cleanup and fix Thunderscope * Enable pydocstyle rules in ruff * Add compile pip requirements to pre-commit * Formatting and fix pre-commit * Fix pre-commit * Fix pre-commit * Fix pre-commit and fsm_diagram_generator.py * Update docstrings * Formatting * Fix type errors * Nuke jetson_nano/display :( * Switch to pyqtdarktheme * Bump pytqtgraph to 0.13.7 * If build fails, download autoref from Google Drive mirror * Fix setup_software.sh * If build fails, download autoref from releases in github fork * Remove Qt deps from ER Force Simulator and improve code quality * Remove Qt from bazel and setup_software.sh * Misc code quality changes * Rename formatting_scripts to scripts * Fix docstring * FIx docstring * [pre-commit.ci lite] apply automatic fixes * Add ASCII diagram to robotmesh.cpp * Fix pyqtdarktheme dep missing * Misc changes * Nits * Use python dataclasses, remove unused stuff, nits * [pre-commit.ci lite] apply automatic fixes * Use dataclass * Update setup_software for Ubuntu 24 ARM Start migrating to python3.12 * fixup installation issues * Working on pybind11 compilation * downgrade pybind11 slightly * thunderscope is running, but slowly + autoref problems * play around with newer protobuf version * Fix python protobuf slowness * update ssl protos * resolve some build issues * Seems to compile correctly on x86 Ubuntu 2020 * fix a whole bunch of issues and leave a bunch more * Wip add support for new Tigers Autoref * Remove auto_continue from old gamecontroller proto message * Wip update autoref wrapper with new autoref * [pre-commit.ci lite] apply automatic fixes * Fixup last little niggly issues with game controller and autoref migration * fixing up formatting * migrate to gcc 10 and upgrade boost * improve jetson toolchain * work on nano build * fix jetson nano * fix ensurepip for ubuntu 24 * update linux gcc extlibs paths * not yet compiling, adding arm64 support * update cross compile toolchain names * wip * wip * [pre-commit.ci lite] apply automatic fixes * update setup software for pyqt6 * install nvm * works on William (not William's) computer * update g3log and some docs * update tbots_protobuf_test * [pre-commit.ci lite] apply automatic fixes * update github 24 arm machine * hopefully fix platform io in CI * wip toolchain resolution issue * fixup github builds mayhaps * cleanup PR and fixup tests * address PR comments * cleanup documentation * [pre-commit.ci lite] apply automatic fixes * fixup clang format for ARM builds --------- Co-authored-by: williamckha <[email protected]> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: arun <[email protected]> Co-authored-by: wmostrenko <[email protected]>
1 parent 85cf8a9 commit 47d45b8

File tree

77 files changed

+1109
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1109
-601
lines changed

.github/workflows/main.yml

+26-17
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
ubuntu22-tests:
15-
name: Ubuntu 22.04 Build
16-
runs-on: ubuntu-22.04
14+
multiplatform-build:
15+
strategy:
16+
matrix:
17+
platform: [ ubuntu-22.04, ubuntu-24.04 ]
18+
19+
name: Ubuntu Alternate Builds
20+
runs-on: ${{ matrix.platform }}
1721
steps:
1822
# checks-out the repository under $GITHUB_WORKSPACE
1923
- uses: actions/checkout@v4
@@ -25,22 +29,24 @@ jobs:
2529
- name: Software Build Test
2630
run: |
2731
cd src
28-
bazel build --show_timestamps \
29-
-- //... -//software:unix_full_system \
30-
-//software/simulated_tests/... \
31-
-//software/ai/hl/... \
32-
-//software/field_tests/... \
33-
-//software/embedded/... \
32+
bazel build --show_timestamps --copt=-O3 \
33+
-- //... -//software:unix_full_system \
34+
-//software/simulated_tests/... \
35+
-//software/ai/hl/... \
36+
-//software/field_tests/... \
37+
-//software/embedded/... \
38+
-//cc_toolchain/...
3439
3540
- name: Jetson Nano Build Test
3641
run: |
3742
cd src
38-
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO
43+
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot
3944
4045
- name: Raspberry Pi Build Test
4146
run: |
4247
cd src
43-
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI
48+
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot
49+
4450
4551
software-tests:
4652
name: Software Tests
@@ -61,7 +67,8 @@ jobs:
6167
-//software/simulated_tests/... \
6268
-//software/ai/hl/... \
6369
-//software/field_tests/... \
64-
-//software/ai/navigator/...
70+
-//software/ai/navigator/... \
71+
-//cc_toolchain/...
6572
6673
robot-tests:
6774
name: Robot Software Tests
@@ -90,12 +97,14 @@ jobs:
9097
- name: Jetson Nano Build
9198
run: |
9299
cd src
93-
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO
100+
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot
101+
94102
95103
- name: Raspberry Pi Build
96104
run: |
97105
cd src
98-
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI
106+
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot
107+
99108
100109
simulated-gameplay-tests:
101110
name: Simulated Gameplay Tests
@@ -112,9 +121,9 @@ jobs:
112121
run: |
113122
cd src
114123
bazel test --copt=-O3 --flaky_test_attempts=3 --show_timestamps \
115-
//software:unix_full_system \
116-
//software/simulated_tests/... \
117-
//software/ai/hl/... \
124+
//software:unix_full_system \
125+
//software/simulated_tests/... \
126+
//software/ai/hl/... \
118127
//software/ai/navigator/...
119128
120129
- name: Upload simulated test proto logs

docs/getting-started-wsl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If you are not using Windows 11 and would prefer not to upgrade, you can follow
3939
3. Now, let's install Ubuntu.
4040
- Download the WSL2 kernel from [here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel).
4141
- Open a PowerShell window and run command `wsl --set-default-version 2` to use WSL2 by default.
42-
- Install Ubuntu 20.04 LTS or Ubuntu 22.04 LTS from the Microsoft Store.
42+
- Install Ubuntu 20.04 LTS, Ubuntu 22.04 LTS or Ubuntu 24.04 LTS from the Microsoft Store.
4343
- Open the Ubuntu app in the Start menu. It will open a command prompt and ask you to create a new UNIX username and password for your WSL2 Ubuntu installation.
4444
4545
### X Server Setup

docs/getting-started.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ These instructions assume you have a basic understanding of Linux and the comman
6666

6767
### Operating systems
6868

69-
We currently only support Linux, specifically Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. You are welcome to use a different version or distribution of Linux, but may need to make some tweaks in order for things to work.
69+
We currently only support Linux, specifically Ubuntu.
7070

71-
You can use Ubuntu 20.04 LTS and Ubuntu 22.04 LTS inside Windows through Windows Subsystem for Linux, by following [this guide](./getting-started-wsl.md). **Running and developing Thunderbots on Windows is experimental and not officially supported.**
71+
If you have a X86_64 machine, we support Ubuntu 20.04 LTS, Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.
72+
73+
If you have a ARM64 (also known as AARCH64) machine, we support Ubuntu 24.04 LTS.
74+
75+
You are welcome to use a different version or distribution of Linux, but may need to make some tweaks in order for things to work.
76+
77+
You can use Ubuntu 20.04 LTS, Ubuntu 22.04 LTS or Ubuntu 24.04 LTS inside Windows through Windows Subsystem for Linux, by following [this guide](./getting-started-wsl.md). **Running and developing Thunderbots on Windows is experimental and not officially supported.**
7278

7379
### Getting the Code
7480

@@ -344,15 +350,15 @@ Tracy also samples call stacks. If the profiled binary is run with root permissi
344350

345351
## Building for the robot
346352

347-
To build for the robot computer, build the target with the `--cpu=jetson_nano` flag and the toolchain will automatically build using the ARM toolchain. For example, `bazel build --cpu=jetson_nano //software/geom/...`.
353+
To build for the robot computer, build the target with the `--platforms=//cc_toolchain:robot` flag and the toolchain will automatically build using the ARM toolchain. For example, `bazel build --platforms=//cc_toolchain:robot //software/geom/...`.
348354

349355
## Deploying Robot Software to the robot
350356

351357
We use Ansible to automatically update software running on the robot. [More info here.](useful-robot-commands.md#flashing-the-robots-compute-module)
352358

353359
To update binaries on a working robot, you can run:
354360

355-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
361+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
356362

357363
Where `<platform>` is the robot platform you are deploying to (`PI` or `NANO`), and `<robot_ip>` is the IP address of the robot you are deploying to. The `robot_password` is the password used to login to the `robot` user on the robot.
358364

docs/robot-software-architecture.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020

2121
For a more detailed look at how Ansible works, [see the RFC](https://docs.google.com/document/d/1hN3Us2Vjr8z6ihqUVp_3L7rrjKc-EZ-l2hZJc31gNOc/edit)
2222

23-
Example command: `bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
23+
Example command: `bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
24+
* <platform>: `PI` or `NANO` depending on the computer on the robot
25+
* <robot_ip>: IP address of the robot
26+
* <robot_password>: Password of the robot
2427

2528
More commands available [here](useful-robot-commands.md#off-robot-commands)
2629

docs/useful-robot-commands.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ The IP address of the robots on the tbots network is `192.168.0.20<robot_id>` so
8686

8787
Individual miscellaneous tasks (ex reboot, shutdown, rtt test) can be run through the `misc.yml` playbook by specifying the corresponding tag.
8888

89-
To view a list of supported arguments, run
90-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano -- -h`
89+
To view a list of supported arguments, run:
90+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot -h`
9191

9292
If desired, the `-ho`, `--hosts` argument can be replaced with `-p`, `--port`, defining a port to listen to for Announcements from hosts.
9393

@@ -101,7 +101,7 @@ This will stop the current Systemd services, replace and restart them. Binaries
101101

102102
<b>This will trigger motor calibration meaning the wheels may spin. Please elevate the robot so the wheels are not touching the ground for proper calibration.</b>
103103

104-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
104+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>`
105105
* \<platform\> is the host platform on the robot (either `PI` or `NANO`)
106106
* <robot_ip> is the IP address of the robot
107107
* <robot_password> is the password of the `robot` user account
@@ -119,11 +119,11 @@ Example: Flashing robots 1, 4, and 7 that have a Raspberry Pi
119119

120120
## Flashing the powerboard
121121

122-
This will flash powerloop, the current firmware in `software/power/`, onto the power board. It will prompt the user into setting the powerboard into bootloader mode by holding the boot button (left if looking from the back of the robot) and pressing the reset button (right if looking from the back of the robot), then releasing the reset button first, then the boot button. Once the board is flashed, pressing the reset button after to use the new firmware.
122+
This will flash powerloop, the current firmware in `software/power/`, onto the power board. It will prompt the user into setting the powerboard into bootloader mode by holding the boot button (left if looking from the back of the robot) and pressing the reset button (right if looking from the back of the robot), then releasing the reset button first, then the boot button. Once the board is flashed, pressing the reset button after to use the new firmware.
123123

124124
Looking from the back of the robot the reset and boot buttons are on right side of the battery holder on the lowest board with the reset being on the left and the boot on the right. <b>Warning it may kick/chip when pressed.</b>
125125

126-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano -- --playbook deploy_powerboard.yml --hosts <robot_ip> --ssh_pass <robot_password>`
126+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot -- --playbook deploy_powerboard.yml --hosts <robot_ip> --ssh_pass <robot_password>`
127127

128128
## Setting up the embedded host
129129

@@ -133,11 +133,11 @@ This section refers to setting up the computer on the robot for the first time.
133133

134134
### Jetson Nano
135135

136-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano --//software/embedded:host_platform=NANO -- --playbook setup_nano.yml --hosts <robot_ip> --ssh_pass <robot_password>`
136+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=NANO -- --playbook setup_nano.yml --hosts <robot_ip> --ssh_pass <robot_password>`
137137

138138
### Raspberry Pi
139139

140-
`bazel run //software/embedded/ansible:run_ansible --cpu=jetson_nano --//software/embedded:host_platform=PI -- --playbook setup_raspberry_pi.yml --hosts <robot_ip> --ssh_pass <robot_password>`
140+
`bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=PI -- --playbook setup_raspberry_pi.yml --hosts <robot_ip> --ssh_pass <robot_password>`
141141

142142
## Robot Diagnostics
143143

@@ -164,7 +164,7 @@ Runs the robot auto test fixture on a robot through Ansible, which tests the mot
164164

165165
From Software/src:
166166

167-
`bazel run //software/embedded/ansible:run_ansible --//software/embedded:host_platform=<platform> --cpu=jetson_nano -- --playbook robot_auto_test_playbook.yml --hosts <robot_ip> --ssh_pass <robot_password>`
167+
`bazel run //software/embedded/ansible:run_ansible --//software/embedded:host_platform=<platform> --platforms=//cc_toolchain:robot -- --playbook robot_auto_test_playbook.yml --hosts <robot_ip> --ssh_pass <robot_password>`
168168
* replace the \<platform\> with the target platform for the robot (either `PI` or `NANO`)
169169
* replace the \<robot_ip\> with the actual ip address of the jetson nano for the ssh connection.
170170
* replace the <robot_password> with the actual password for the jetson nano for the ssh connection.

0 commit comments

Comments
 (0)