Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary support for Ubuntu 24 and Ubuntu 24 ARM #3316

Merged
merged 116 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
08912ff
Update to python 3.10.0 and bazel 5.4.0
williamckha Jul 26, 2024
733efd0
No need to import `typing` for collections as of python 3.9
williamckha Jul 26, 2024
99e0b07
Update black formatter to 24.4.2
williamckha Jul 26, 2024
ea33bf4
Run fix_formatting.sh
williamckha Jul 26, 2024
b60cfa9
Remove PyOpenGL-accelerate dependency
williamckha Jul 26, 2024
0323d6f
Install latest pip in setup_software.sh
williamckha Jul 26, 2024
ea8fa61
Install latest pip in setup_software.sh
williamckha Jul 26, 2024
5e790e8
Merge branch 'update_python' of https://github.com/williamckha/Softwa…
williamckha Jul 26, 2024
55702a2
Testing
williamckha Jul 26, 2024
3886778
Testing
williamckha Jul 27, 2024
73e99a1
Remove testing
williamckha Jul 27, 2024
2d81e19
Bump pyqtgraph to 0.13.3
williamckha Jul 27, 2024
c9aeae5
Update setup_software.sh
williamckha Jul 27, 2024
c422469
Try fixing precommit
williamckha Jul 27, 2024
a923ada
Try fixing precommit
williamckha Jul 27, 2024
638758a
Try fixing precommit
williamckha Jul 27, 2024
5367a5f
Replace black/autoflake with ruff
williamckha Jul 27, 2024
257d9c0
Remove black binary
williamckha Jul 27, 2024
bd1820b
Remove git attribute
williamckha Jul 27, 2024
b516bd0
Remove unused check_formatting_ci.sh
williamckha Jul 27, 2024
94ec259
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Jul 27, 2024
252ab62
Run fix_formatting.sh
williamckha Jul 27, 2024
a50ad35
Add simulated/field test fixtures to conftest.py
williamckha Jul 27, 2024
d3cb13f
Address #3251
williamckha Jul 27, 2024
5c46ed8
Python code cleanup and fix Thunderscope
williamckha Jul 28, 2024
90417ce
Enable pydocstyle rules in ruff
williamckha Jul 28, 2024
c7736b1
Add compile pip requirements to pre-commit
williamckha Jul 29, 2024
70a7d5e
Formatting and fix pre-commit
williamckha Jul 29, 2024
08730b5
Fix pre-commit
williamckha Jul 29, 2024
3e60d21
Fix pre-commit
williamckha Jul 29, 2024
c9af943
Fix pre-commit and fsm_diagram_generator.py
williamckha Jul 29, 2024
5fe6548
Update docstrings
williamckha Jul 29, 2024
d3ddd54
Formatting
williamckha Jul 29, 2024
ab45866
Fix type errors
williamckha Jul 30, 2024
d66e6ce
Nuke jetson_nano/display :(
williamckha Jul 30, 2024
7032bf7
Switch to pyqtdarktheme
williamckha Jul 30, 2024
e2d8327
Bump pytqtgraph to 0.13.7
williamckha Jul 30, 2024
237f06d
If build fails, download autoref from Google Drive mirror
williamckha Jul 31, 2024
1c7cee6
Fix setup_software.sh
williamckha Jul 31, 2024
3c1c89a
Merge branch 'update_python' into thunderscope_facelift
williamckha Jul 31, 2024
39c77f9
If build fails, download autoref from releases in github fork
williamckha Jul 31, 2024
82e83e6
Merge branch 'update_python' of https://github.com/williamckha/Softwa…
williamckha Jul 31, 2024
f535662
Merge branch 'update_python' into thunderscope_facelift
williamckha Jul 31, 2024
eaef53d
Remove Qt deps from ER Force Simulator and improve code quality
williamckha Aug 2, 2024
cec1750
Remove Qt from bazel and setup_software.sh
williamckha Aug 2, 2024
3150a9f
Misc code quality changes
williamckha Aug 2, 2024
e693e66
Rename formatting_scripts to scripts
williamckha Aug 3, 2024
35c6364
Fix docstring
williamckha Aug 3, 2024
3ab0649
Merge branch 'thunderscope_facelift' into update_python
williamckha Aug 4, 2024
d638fa7
FIx docstring
williamckha Aug 4, 2024
f45341f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 4, 2024
097fd72
Add ASCII diagram to robotmesh.cpp
williamckha Aug 4, 2024
e05f82b
Fix pyqtdarktheme dep missing
williamckha Aug 4, 2024
f0497ac
Merge branch 'update_python' of https://github.com/williamckha/Softwa…
williamckha Aug 4, 2024
e88b61d
Misc changes
williamckha Aug 4, 2024
56cdb81
Nits
williamckha Aug 5, 2024
fb3dc84
Use python dataclasses, remove unused stuff, nits
williamckha Aug 5, 2024
a3973b7
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 5, 2024
b5d3e2a
Merge branch 'update_python' into simulator
williamckha Aug 6, 2024
9f8b834
Use dataclass
williamckha Aug 6, 2024
2cc8536
Merge branch 'update_python' of https://github.com/williamckha/Softwa…
williamckha Aug 6, 2024
47fd066
Update setup_software for Ubuntu 24 ARM
itsarune Aug 12, 2024
85065cb
fixup installation issues
itsarune Aug 12, 2024
dbe3908
Working on pybind11 compilation
itsarune Aug 13, 2024
e3d6c18
downgrade pybind11 slightly
Aug 14, 2024
c86562d
thunderscope is running, but slowly + autoref problems
itsarune Aug 15, 2024
817594b
play around with newer protobuf version
itsarune Aug 17, 2024
17dc32b
Fix python protobuf slowness
itsarune Aug 18, 2024
151ee12
update ssl protos
itsarune Aug 20, 2024
56952b5
resolve some build issues
itsarune Aug 24, 2024
6afdb1c
Merge branch 'master' of github.com:UBC-Thunderbots/Software into aru…
itsarune Aug 24, 2024
244c6ed
Seems to compile correctly on x86 Ubuntu 2020
itsarune Aug 24, 2024
4406178
fix a whole bunch of issues and leave a bunch more
itsarune Aug 31, 2024
ae4ca7a
Wip add support for new Tigers Autoref
itsarune Sep 2, 2024
d8b2ee4
Remove auto_continue from old gamecontroller proto message
itsarune Sep 2, 2024
ab7bb94
Wip update autoref wrapper with new autoref
itsarune Sep 2, 2024
7be6ed2
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Sep 7, 2024
dbf67db
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 7, 2024
3b61fa7
Fixup last little niggly issues with game controller and autoref migr…
itsarune Sep 14, 2024
8696eee
fixing up formatting
itsarune Sep 14, 2024
e879bf7
migrate to gcc 10 and upgrade boost
itsarune Sep 14, 2024
29ee055
improve jetson toolchain
itsarune Sep 14, 2024
1eae725
work on nano build
itsarune Sep 20, 2024
94c04ab
fix jetson nano
itsarune Sep 20, 2024
299fefe
fix ensurepip for ubuntu 24
itsarune Sep 20, 2024
746b240
update linux gcc extlibs paths
itsarune Sep 21, 2024
ce5afca
not yet compiling, adding arm64 support
itsarune Sep 21, 2024
5898535
update cross compile toolchain names
itsarune Sep 21, 2024
bb47e11
wip
itsarune Sep 21, 2024
1bea6a8
wip
itsarune Sep 21, 2024
049ed5c
wip
itsarune Sep 21, 2024
e433720
Merge branch 'arun_ubu24' of github.com:itsarune/Software into arun_u…
itsarune Sep 21, 2024
297bb20
Merge branch 'master' of github.com:UBC-Thunderbots/Software into aru…
itsarune Sep 21, 2024
4584972
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 21, 2024
1939a0c
Merge branch 'simulator' of github.com:williamckha/Software into arun…
itsarune Sep 21, 2024
fb437ed
Merge branch 'arun_ubu24' of github.com:itsarune/Software into arun_u…
itsarune Sep 21, 2024
9ed63d1
update setup software for pyqt6
wmostrenko Sep 21, 2024
afc9668
install nvm
itsarune Sep 21, 2024
7cd0afa
works on William (not William's) computer
wmostrenko Sep 21, 2024
4980df3
update g3log and some docs
itsarune Oct 2, 2024
4f0d968
Merge branch 'master' of github.com:UBC-Thunderbots/Software into aru…
itsarune Oct 2, 2024
a21a3b4
update tbots_protobuf_test
itsarune Oct 2, 2024
690d461
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 2, 2024
f150827
update github 24 arm machine
itsarune Oct 2, 2024
7e8a37d
Merge branch 'arun_ubu24' of github.com:itsarune/Software into arun_u…
itsarune Oct 2, 2024
89c0ea1
hopefully fix platform io in CI
itsarune Oct 3, 2024
e20e651
Merge branch 'master' of github.com:UBC-Thunderbots/Software into aru…
itsarune Oct 7, 2024
820eaed
Merge branch 'arun_ubu24' of github.com:itsarune/Software into arun_u…
itsarune Oct 7, 2024
d94f24f
wip toolchain resolution issue
itsarune Oct 7, 2024
f1d40c7
fixup github builds mayhaps
itsarune Oct 9, 2024
21b5745
cleanup PR and fixup tests
itsarune Oct 12, 2024
b03b0f7
address PR comments
itsarune Oct 12, 2024
fca5083
cleanup documentation
itsarune Oct 12, 2024
ca6a847
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 12, 2024
17af67d
fixup clang format for ARM builds
itsarune Oct 12, 2024
d59cd83
Merge branch 'arun_ubu24' of github.com:itsarune/Software into arun_u…
itsarune Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ concurrency:
cancel-in-progress: true

jobs:
ubuntu22-tests:
name: Ubuntu 22.04 Build
runs-on: ubuntu-22.04
multiplatform-build:
strategy:
matrix:
platform: [ ubuntu-22.04, ubuntu-24.04 ]

name: Ubuntu Alternate Builds
runs-on: ${{ matrix.platform }}
steps:
# checks-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
Expand All @@ -25,22 +29,24 @@ jobs:
- name: Software Build Test
run: |
cd src
bazel build --show_timestamps \
-- //... -//software:unix_full_system \
-//software/simulated_tests/... \
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/embedded/... \
bazel build --show_timestamps --copt=-O3 \
-- //... -//software:unix_full_system \
-//software/simulated_tests/... \
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/embedded/... \
-//cc_toolchain/...

- name: Jetson Nano Build Test
run: |
cd src
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot

- name: Raspberry Pi Build Test
run: |
cd src
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot


software-tests:
name: Software Tests
Expand All @@ -61,7 +67,8 @@ jobs:
-//software/simulated_tests/... \
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/ai/navigator/...
-//software/ai/navigator/... \
-//cc_toolchain/...

robot-tests:
name: Robot Software Tests
Expand Down Expand Up @@ -90,12 +97,14 @@ jobs:
- name: Jetson Nano Build
run: |
cd src
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot


- name: Raspberry Pi Build
run: |
cd src
bazel build --cpu=jetson_nano //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot


simulated-gameplay-tests:
name: Simulated Gameplay Tests
Expand All @@ -112,9 +121,9 @@ jobs:
run: |
cd src
bazel test --copt=-O3 --flaky_test_attempts=3 --show_timestamps \
//software:unix_full_system \
//software/simulated_tests/... \
//software/ai/hl/... \
//software:unix_full_system \
//software/simulated_tests/... \
//software/ai/hl/... \
//software/ai/navigator/...

- name: Upload simulated test proto logs
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-wsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you are not using Windows 11 and would prefer not to upgrade, you can follow
3. Now, let's install Ubuntu.
- Download the WSL2 kernel from [here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel).
- Open a PowerShell window and run command `wsl --set-default-version 2` to use WSL2 by default.
- Install Ubuntu 20.04 LTS or Ubuntu 22.04 LTS from the Microsoft Store.
- Install Ubuntu 20.04 LTS, Ubuntu 22.04 LTS or Ubuntu 24.04 LTS from the Microsoft Store.
- 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.

### X Server Setup
Expand Down
14 changes: 10 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ These instructions assume you have a basic understanding of Linux and the comman

### Operating systems

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.
We currently only support Linux, specifically Ubuntu.

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.**
If you have a X86_64 machine, we support Ubuntu 20.04 LTS, Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.

If you have a ARM64 (also known as AARCH64) machine, we support Ubuntu 24.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.

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.**

### Getting the Code

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

## Building for the robot

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/...`.
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/...`.

## Deploying Robot Software to the robot

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

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

`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>`
`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>`

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.

Expand Down
5 changes: 4 additions & 1 deletion docs/robot-software-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

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

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>`
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>`
* <platform>: `PI` or `NANO` depending on the computer on the robot
* <robot_ip>: IP address of the robot
* <robot_password>: Password of the robot

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

Expand Down
16 changes: 8 additions & 8 deletions docs/useful-robot-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ The IP address of the robots on the tbots network is `192.168.0.20<robot_id>` so

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

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

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

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

<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>

`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>`
`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>`
* \<platform\> is the host platform on the robot (either `PI` or `NANO`)
* <robot_ip> is the IP address of the robot
* <robot_password> is the password of the `robot` user account
Expand All @@ -119,11 +119,11 @@ Example: Flashing robots 1, 4, and 7 that have a Raspberry Pi

## Flashing the powerboard

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.
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.

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>

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

## Setting up the embedded host

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

### Jetson Nano

`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>`
`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>`

### Raspberry Pi

`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>`
`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>`

## Robot Diagnostics

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

From Software/src:

`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>`
`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>`
* replace the \<platform\> with the target platform for the robot (either `PI` or `NANO`)
* replace the \<robot_ip\> with the actual ip address of the jetson nano for the ssh connection.
* replace the <robot_password> with the actual password for the jetson nano for the ssh connection.
Expand Down
Loading
Loading