Skip to content

Commit 549869f

Browse files
Update CODEOWNERS (#3499)
* breaking changes for Ubuntu 20 * Add Andrew to CODEOWNERS * [pre-commit.ci lite] apply automatic fixes * delete rest ubuntu 20 and ubuntu 24 arm runner?? * Fix CI --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent fe44d6a commit 549869f

29 files changed

Lines changed: 83 additions & 126 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# These owners will be the default owners for everything in the repo.
2-
* @itsarune @williamckha @sauravbanna
2+
* @williamckha @sauravbanna @Andrewyx

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
multiplatform-build:
1515
strategy:
1616
matrix:
17-
platform: [ ubuntu-24.04 ]
17+
platform: [ ubuntu-24.04, ubuntu-24.04-arm ]
1818

1919
name: Ubuntu Alternate Builds
2020
runs-on: ${{ matrix.platform }}

environment_setup/setup_software.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ cd "$CURR_DIR" || exit
2020

2121
source util.sh
2222

23-
arch=$(uname -m)
24-
print_status_msg "Detected architecture: ${arch}"
23+
g_arch=$(uname -m) # Global variable. No function should use this name.
24+
print_status_msg "Detected architecture: ${g_arch}"
2525

2626
print_status_msg "Installing Utilities and Dependencies"
2727

@@ -45,6 +45,7 @@ fi
4545
# (sorted alphabetically)
4646
host_software_packages=(
4747
cmake # Needed to build some of our dependencies
48+
clang-format-14 # Used to format C++ code
4849
codespell # Fixes typos
4950
curl
5051
default-jdk # Needed for Bazel to run properly
@@ -144,10 +145,6 @@ if ! sudo /opt/tbotspython/bin/python3 -m pip install --upgrade pip ; then
144145
exit 1
145146
fi
146147

147-
if [[ $(lsb_release -rs) == "20.04" ]]; then
148-
sudo /opt/tbotspython/bin/pip3 install -r ubuntu20_requirements.txt
149-
fi
150-
151148
if [[ $(lsb_release -rs) == "22.04" ]]; then
152149
sudo /opt/tbotspython/bin/pip3 install -r ubuntu22_requirements.txt
153150
fi
@@ -160,15 +157,15 @@ sudo chown -R $USER:$USER /opt/tbotspython
160157

161158
print_status_msg "Done Setting Up Virtual Python Environment"
162159
print_status_msg "Fetching game controller"
163-
install_gamecontroller $arch
160+
install_gamecontroller $g_arch
164161

165162
print_status_msg "Setting up TIGERS AutoRef"
166163

167164
print_status_msg "Installing TIGERS dependency: Java 21"
168-
install_java $arch
165+
install_java $g_arch
169166

170167
print_status_msg "Compiling TIGERS AutoRef"
171-
install_autoref $arch
168+
install_autoref $g_arch
172169

173170
sudo chmod +x "$CURR_DIR/../src/software/autoref/run_autoref.sh"
174171
sudo cp "$CURR_DIR/../src/software/autoref/DIV_B.txt" "/opt/tbotspython/autoReferee/config/geometry/DIV_B.txt"
@@ -178,20 +175,20 @@ print_status_msg "Finished setting up AutoRef"
178175
# Install Bazel
179176
print_status_msg "Installing Bazel"
180177

181-
install_bazel $arch
178+
install_bazel $g_arch
182179

183180
print_status_msg "Done Installing Bazel"
184181

185182
print_status_msg "Install clang-format"
186-
install_clang_format $arch
183+
install_clang_format $g_arch
187184
print_status_msg "Done installing clang-format"
188185

189186
print_status_msg "Setting up cross compiler for robot software"
190-
install_cross_compiler $arch
187+
install_cross_compiler $g_arch
191188
print_status_msg "Done setting up cross compiler for robot software"
192189

193190
print_status_msg "Setting Up Python Development Headers"
194-
install_python_dev_cross_compile_headers $arch
191+
install_python_dev_cross_compile_headers $g_arch
195192
print_status_msg "Done Setting Up Python Development Headers"
196193

197194
print_status_msg "Setting Up PlatformIO"

environment_setup/ubuntu20_requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

environment_setup/util.sh

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,7 @@ install_bazel() {
2020
}
2121

2222
install_clang_format() {
23-
download=https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/clang+llvm-19.1.7-aarch64-linux-gnu.tar.xz
24-
clang_folder=clang+llvm-19.1.7-aarch64-linux-gnu
25-
26-
if is_x86 $1; then
27-
download=https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/LLVM-19.1.7-Linux-X64.tar.xz
28-
clang_folder=LLVM-19.1.7-Linux-X64
29-
fi
30-
31-
wget $download -O /tmp/tbots_download_cache/clang.tar.xz
32-
33-
# Temporarily need more space to extract the clang tarball
34-
mkdir -p ~/.tbots
35-
tar -xf /tmp/tbots_download_cache/clang.tar.xz -C ~/.tbots/
36-
37-
clang_format_path=~/.tbots/$clang_folder/bin/clang-format
38-
sudo cp $clang_format_path /opt/tbotspython/bin/clang-format
39-
rm -rf ~/.tbots
23+
ln -s /usr/bin/clang-format-14 /opt/tbotspython/bin/clang-format
4024
}
4125

4226
install_cross_compiler() {
@@ -52,34 +36,14 @@ install_cross_compiler() {
5236
}
5337

5438
install_gamecontroller () {
55-
# TODO(#3335): Whenever we deprecate Ubuntu 20.04, we can just grab the latest version of the SSL game controller
56-
# binary from the releases page. This is a workaround since the latest version of the game controller is compiled
57-
# with a newer GLIBC version than what is available on Ubuntu 20.04.
58-
go_arch=arm64
39+
arch=arm64
5940
if is_x86 $1; then
60-
go_arch=amd64
41+
arch=amd64
6142
fi
62-
sudo wget -N https://go.dev/dl/go1.23.0.linux-${go_arch}.tar.gz -O /tmp/tbots_download_cache/go.tar.gz
63-
tar -C /tmp/tbots_download_cache -xf /tmp/tbots_download_cache/go.tar.gz
64-
export PATH=$PATH:/tmp/tbots_download_cache/go/bin
65-
sudo wget -N https://github.com/RoboCup-SSL/ssl-game-controller/archive/refs/tags/v3.12.3.zip -O /tmp/tbots_download_cache/ssl-game-controller.zip
66-
unzip -q -o -d /tmp/tbots_download_cache/ /tmp/tbots_download_cache/ssl-game-controller.zip
67-
cd /tmp/tbots_download_cache/ssl-game-controller-3.12.3
68-
69-
# Installing nvm
70-
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
71-
export NVM_DIR="$HOME/.nvm"
72-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
73-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
74-
nvm install 20
7543

76-
make install
77-
go build cmd/ssl-game-controller/main.go
78-
sudo mv main /opt/tbotspython/gamecontroller
44+
wget https://github.com/RoboCup-SSL/ssl-game-controller/releases/download/v3.16.1/ssl-game-controller_v3.16.1_linux_${arch} -O /tmp/tbots_download_cache/gamecontroller
45+
sudo mv /tmp/tbots_download_cache/gamecontroller /opt/tbotspython/gamecontroller
7946
sudo chmod +x /opt/tbotspython/gamecontroller
80-
81-
cd -
82-
sudo rm -rf /tmp/tbots_download_cache/ssl-game-controller-3.12.3 /tmp/tbots_download_cache/go /tmp/tbots_download_cache/go.tar.gz /tmp/tbots_download_cache/ssl-game-controller.zip
8347
}
8448

8549
install_java () {

src/proto/message_translation/tbots_geometry.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ std::unique_ptr<TbotsProto::Polygon> createPolygonProto(const Polygon& polygon)
3636
auto polygon_msg = std::make_unique<TbotsProto::Polygon>();
3737
const auto& points = polygon.getPoints();
3838

39-
std::for_each(points.begin(), points.end(), [&](const Point& point)
39+
std::for_each(points.begin(), points.end(),
40+
[&](const Point& point)
4041
{ *(polygon_msg->add_points()) = *createPointProto(point); });
4142

4243
return polygon_msg;

src/proto/message_translation/tbots_protobuf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ std::unique_ptr<TbotsProto::Team> createTeam(const Team& team)
4949
auto team_msg = std::make_unique<TbotsProto::Team>();
5050
const auto& robots = team.getAllRobots();
5151

52-
std::for_each(robots.begin(), robots.end(), [&](const Robot& robot)
52+
std::for_each(robots.begin(), robots.end(),
53+
[&](const Robot& robot)
5354
{ *(team_msg->add_team_robots()) = *createRobot(robot); });
5455

5556
auto goalie_id = team.getGoalieId();

src/software/ai/ai.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ std::unique_ptr<TbotsProto::PrimitiveSet> Ai::getPrimitives(const WorldPtr& worl
7878
std::unique_ptr<TbotsProto::PrimitiveSet> primitive_set;
7979
if (static_cast<bool>(override_play))
8080
{
81-
primitive_set = override_play->get(
82-
world_ptr, inter_play_communication, [this](InterPlayCommunication comm)
83-
{ inter_play_communication = std::move(comm); });
81+
primitive_set = override_play->get(world_ptr, inter_play_communication,
82+
[this](InterPlayCommunication comm) {
83+
inter_play_communication = std::move(comm);
84+
});
8485
}
8586
else
8687
{
87-
primitive_set = current_play->get(
88-
world_ptr, inter_play_communication, [this](InterPlayCommunication comm)
89-
{ inter_play_communication = std::move(comm); });
88+
primitive_set = current_play->get(world_ptr, inter_play_communication,
89+
[this](InterPlayCommunication comm) {
90+
inter_play_communication = std::move(comm);
91+
});
9092
}
9193

9294
FrameMarkEnd(TracyConstants::AI_FRAME_MARKER);

src/software/ai/evaluation/defender_assignment.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ std::vector<DefenderAssignment> getAllDefenderAssignments(
111111
assignments.end());
112112

113113
// Sort the potential assignments by coverage rating in descending order
114-
std::sort(assignments.begin(), assignments.end(), [](const auto &a, const auto &b)
114+
std::sort(assignments.begin(), assignments.end(),
115+
[](const auto &a, const auto &b)
115116
{ return a.coverage_rating > b.coverage_rating; });
116117

117118
return assignments;
@@ -179,7 +180,8 @@ std::vector<std::vector<GoalLane>> groupGoalLanesByDensity(
179180
}
180181

181182
// Sort goal lanes by angle to the goal in increasing order
182-
std::sort(goal_lanes.begin(), goal_lanes.end(), [](const auto &a, const auto &b)
183+
std::sort(goal_lanes.begin(), goal_lanes.end(),
184+
[](const auto &a, const auto &b)
183185
{ return a.angle_to_goal < b.angle_to_goal; });
184186

185187
std::vector<std::vector<GoalLane>> groups;

src/software/ai/evaluation/enemy_threat.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ std::optional<std::pair<int, std::optional<Robot>>> getNumPassesToRobot(
147147
// Remove any receivers from the unvisited robots, since they have
148148
// now been visited
149149
unvisited_robots.erase(remove_if(unvisited_robots.begin(), unvisited_robots.end(),
150-
[&](auto x)
151-
{
150+
[&](auto x) {
152151
return find(all_receivers.begin(),
153152
all_receivers.end(),
154153
x) != all_receivers.end();

0 commit comments

Comments
 (0)