From 6fc7e9fe852a4d6e11385d69cbdbfadccebf9b12 Mon Sep 17 00:00:00 2001 From: jvogt23 Date: Sun, 2 Feb 2025 21:11:41 -0500 Subject: [PATCH 1/7] Add penalty button --- soccer/src/soccer/ui/main_window.cpp | 8 ++ soccer/src/soccer/ui/main_window.hpp | 2 + .../src/soccer/ui/qt/.~lock.kickoff_blue.svg# | 1 + soccer/src/soccer/ui/qt/MainWindow.ui | 92 ++++++++++++------- soccer/src/soccer/ui/qt/main_icons.qrc | 2 + soccer/src/soccer/ui/qt/penalty_blue.svg | 80 ++++++++++++++++ soccer/src/soccer/ui/qt/penalty_yellow.svg | 80 ++++++++++++++++ 7 files changed, 231 insertions(+), 34 deletions(-) create mode 100644 soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# create mode 100644 soccer/src/soccer/ui/qt/penalty_blue.svg create mode 100644 soccer/src/soccer/ui/qt/penalty_yellow.svg diff --git a/soccer/src/soccer/ui/main_window.cpp b/soccer/src/soccer/ui/main_window.cpp index 3b2a59a9d36..39dac69563d 100644 --- a/soccer/src/soccer/ui/main_window.cpp +++ b/soccer/src/soccer/ui/main_window.cpp @@ -1158,6 +1158,14 @@ void MainWindow::on_fastYellow_clicked() { send_quick_command(PlayState::ready_free_kick(!context_->blue_team)); } +void MainWindow::on_fastPenaltyBlue_clicked() { + send_quick_command(PlayState::ready_penalty(context_->blue_team)); +} + +void MainWindow::on_fastPenaltyYellow_clicked() { + send_quick_command(PlayState::ready_penalty(!context_->blue_team)); +} + bool MainWindow::live() { return !_playbackRate; } void MainWindow::updateDebugLayers(const LogFrame& frame) { // Check if any debug layers have been added diff --git a/soccer/src/soccer/ui/main_window.hpp b/soccer/src/soccer/ui/main_window.hpp index cb708dd6111..61cf24a6c40 100644 --- a/soccer/src/soccer/ui/main_window.hpp +++ b/soccer/src/soccer/ui/main_window.hpp @@ -163,6 +163,8 @@ private Q_SLOTS: void on_fastKickoffYellow_clicked(); void on_fastBlue_clicked(); void on_fastYellow_clicked(); + void on_fastPenaltyBlue_clicked(); + void on_fastPenaltyYellow_clicked(); // Robot Position Dropdowns and Reset Buttons void on_robotPosition_0_currentIndexChanged(int value); diff --git a/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# b/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# new file mode 100644 index 00000000000..84ad02e0148 --- /dev/null +++ b/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# @@ -0,0 +1 @@ +,JAMES_FRAMEWORK/james,james_framework,02.02.2025 20:42,file:///C:/Users/james/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/soccer/src/soccer/ui/qt/MainWindow.ui b/soccer/src/soccer/ui/qt/MainWindow.ui index 7f63b4c2db3..3acf257e945 100644 --- a/soccer/src/soccer/ui/qt/MainWindow.ui +++ b/soccer/src/soccer/ui/qt/MainWindow.ui @@ -20,7 +20,7 @@ RoboJackets - Soccer - + :/icons/SoccerBall.png:/icons/SoccerBall.png @@ -73,7 +73,7 @@ Halt - + :/icons/halt.svg:/icons/halt.svg @@ -115,7 +115,7 @@ Stop - + :/icons/stop.svg:/icons/stop.svg @@ -157,7 +157,7 @@ Ready - + :/icons/ready.svg:/icons/ready.svg @@ -196,7 +196,7 @@ Force Start - + :/icons/force_start.svg:/icons/force_start.svg @@ -263,6 +263,47 @@ + + + + + + + :/icons/penalty_blue.svg:/icons/penalty_blue.svg + + + + 24 + 24 + + + + true + + + + + + + + + + + :/icons/penalty_yellow.svg:/icons/penalty_yellow.svg + + + + 24 + 24 + + + + true + + + + + @@ -274,7 +315,7 @@ - + :/icons/kickoff_blue.svg:/icons/kickoff_blue.svg @@ -297,7 +338,7 @@ - + :/icons/kickoff_yellow.svg:/icons/kickoff_yellow.svg @@ -324,7 +365,7 @@ - + :/icons/direct_blue.svg:/icons/direct_blue.svg @@ -347,7 +388,7 @@ - + :/icons/direct_yellow.svg:/icons/direct_yellow.svg @@ -519,7 +560,7 @@ Play log backwards quickly - + :/icons/rewind.svg:/icons/rewind.svg @@ -555,7 +596,7 @@ Play log backwards - + :/icons/prev-frame.svg:/icons/prev-frame.svg @@ -597,7 +638,7 @@ background-color: red - + :/icons/pause.svg:/icons/pause.svg @@ -636,7 +677,7 @@ - + :/icons/next-frame.svg:/icons/next-frame.svg @@ -672,7 +713,7 @@ Play log forwards quickly - + :/icons/play.svg:/icons/play.svg @@ -708,7 +749,7 @@ Show live feed - + :/icons/live.svg:/icons/live.svg @@ -1813,7 +1854,6 @@ - Joystick @@ -1975,7 +2015,7 @@ 671 - + 11 @@ -2058,7 +2098,6 @@ - @@ -2129,7 +2168,6 @@ - @@ -2200,7 +2238,6 @@ - @@ -2271,7 +2308,6 @@ - @@ -2342,7 +2378,6 @@ - @@ -2413,7 +2448,6 @@ - @@ -2484,7 +2518,6 @@ - @@ -2555,7 +2588,6 @@ - @@ -2626,7 +2658,6 @@ - @@ -2697,7 +2728,6 @@ - @@ -2768,7 +2798,6 @@ - @@ -2839,7 +2868,6 @@ - @@ -2910,7 +2938,6 @@ - @@ -2981,7 +3008,6 @@ - @@ -3052,7 +3078,6 @@ - @@ -3123,7 +3148,6 @@ - @@ -3140,7 +3164,7 @@ 0 0 1331 - 24 + 25 diff --git a/soccer/src/soccer/ui/qt/main_icons.qrc b/soccer/src/soccer/ui/qt/main_icons.qrc index 5a300de1762..f1088ecf2c6 100644 --- a/soccer/src/soccer/ui/qt/main_icons.qrc +++ b/soccer/src/soccer/ui/qt/main_icons.qrc @@ -5,6 +5,8 @@ force_start.svg kickoff_blue.svg kickoff_yellow.svg + penalty_blue.svg + penalty_yellow.svg direct_blue.svg direct_yellow.svg indirect_blue.svg diff --git a/soccer/src/soccer/ui/qt/penalty_blue.svg b/soccer/src/soccer/ui/qt/penalty_blue.svg new file mode 100644 index 00000000000..6b3f1122622 --- /dev/null +++ b/soccer/src/soccer/ui/qt/penalty_blue.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + P + + diff --git a/soccer/src/soccer/ui/qt/penalty_yellow.svg b/soccer/src/soccer/ui/qt/penalty_yellow.svg new file mode 100644 index 00000000000..8e72b5e7af6 --- /dev/null +++ b/soccer/src/soccer/ui/qt/penalty_yellow.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + P + + From 40530a9a3868d03d382471f920b3cb8fc1f81bbb Mon Sep 17 00:00:00 2001 From: jvogt23 Date: Sun, 16 Feb 2025 20:05:10 -0500 Subject: [PATCH 2/7] I think this file is unnecessary --- soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# | 1 - 1 file changed, 1 deletion(-) delete mode 100644 soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# diff --git a/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# b/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# deleted file mode 100644 index 84ad02e0148..00000000000 --- a/soccer/src/soccer/ui/qt/.~lock.kickoff_blue.svg# +++ /dev/null @@ -1 +0,0 @@ -,JAMES_FRAMEWORK/james,james_framework,02.02.2025 20:42,file:///C:/Users/james/AppData/Roaming/LibreOffice/4; \ No newline at end of file From 4602306d8b6d8ca1ef1a7ee57f8d2d250d509412 Mon Sep 17 00:00:00 2001 From: jvogt23 <91633361+jvogt23@users.noreply.github.com> Date: Sun, 16 Feb 2025 20:52:56 -0500 Subject: [PATCH 3/7] Update MainWindow.ui to remove WSL localhost refs --- soccer/src/soccer/ui/qt/MainWindow.ui | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/soccer/src/soccer/ui/qt/MainWindow.ui b/soccer/src/soccer/ui/qt/MainWindow.ui index 3acf257e945..8b1a3a22d86 100644 --- a/soccer/src/soccer/ui/qt/MainWindow.ui +++ b/soccer/src/soccer/ui/qt/MainWindow.ui @@ -20,7 +20,7 @@ RoboJackets - Soccer - + :/icons/SoccerBall.png:/icons/SoccerBall.png @@ -73,7 +73,7 @@ Halt - + :/icons/halt.svg:/icons/halt.svg @@ -115,7 +115,7 @@ Stop - + :/icons/stop.svg:/icons/stop.svg @@ -157,7 +157,7 @@ Ready - + :/icons/ready.svg:/icons/ready.svg @@ -196,7 +196,7 @@ Force Start - + :/icons/force_start.svg:/icons/force_start.svg @@ -268,7 +268,7 @@ - + :/icons/penalty_blue.svg:/icons/penalty_blue.svg @@ -288,7 +288,7 @@ - + :/icons/penalty_yellow.svg:/icons/penalty_yellow.svg @@ -315,7 +315,7 @@ - + :/icons/kickoff_blue.svg:/icons/kickoff_blue.svg @@ -338,7 +338,7 @@ - + :/icons/kickoff_yellow.svg:/icons/kickoff_yellow.svg @@ -365,7 +365,7 @@ - + :/icons/direct_blue.svg:/icons/direct_blue.svg @@ -388,7 +388,7 @@ - + :/icons/direct_yellow.svg:/icons/direct_yellow.svg @@ -560,7 +560,7 @@ Play log backwards quickly - + :/icons/rewind.svg:/icons/rewind.svg @@ -596,7 +596,7 @@ Play log backwards - + :/icons/prev-frame.svg:/icons/prev-frame.svg @@ -638,7 +638,7 @@ background-color: red - + :/icons/pause.svg:/icons/pause.svg @@ -677,7 +677,7 @@ - + :/icons/next-frame.svg:/icons/next-frame.svg @@ -713,7 +713,7 @@ Play log forwards quickly - + :/icons/play.svg:/icons/play.svg @@ -749,7 +749,7 @@ Show live feed - + :/icons/live.svg:/icons/live.svg From 44d9967bd65d300852f66b2df78c3e0c983a44b3 Mon Sep 17 00:00:00 2001 From: jvogt23 Date: Sun, 23 Feb 2025 21:03:17 -0500 Subject: [PATCH 4/7] autoref working yo --- Dockerfile.dev | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dockerfile.dev b/Dockerfile.dev index cc264dc872e..62e03139457 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -10,6 +10,12 @@ ENV DISPLAY=:1 ARG TARGETARCH ENV TARGETARCH=${TARGETARCH} +RUN if [ -z TARGETARCH] then \ + echo "****************************** ERROR ******************************"; \ + echo "No target architecture was given. TARGETARCH is a required argument."; \ + exit 1; \ + fi + # Update the package list and install necessary packages, including the missing ones RUN apt-get update && \ apt-get install -y \ @@ -68,6 +74,14 @@ RUN git clone https://github.com/robotics-erlangen/framework.git /root/framework cmake .. && \ make simulator-cli +# Clone, build ER-Force's autoref +RUN git clone https://github.com/robotics-erlangen/autoref.git /root/autoref && \ + cd /root/autoref && \ + git submodule update --init && \ + mkdir build && cd build && \ + cmake .. && \ + make + # Use bash to source the ROS2 setup file and run make perf RUN bash -c "source /opt/ros/humble/setup.bash && \ cd /root/robocup-software && \ From a409ef00c573779b140bdcc230315094b9f44a68 Mon Sep 17 00:00:00 2001 From: sanatd33 Date: Sun, 23 Feb 2025 21:49:51 -0500 Subject: [PATCH 5/7] proper penalty configuration --- soccer/src/soccer/game_state.hpp | 2 +- soccer/src/soccer/ui/main_window.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/soccer/src/soccer/game_state.hpp b/soccer/src/soccer/game_state.hpp index 439b09ee2da..9df64ed6096 100644 --- a/soccer/src/soccer/game_state.hpp +++ b/soccer/src/soccer/game_state.hpp @@ -142,7 +142,7 @@ struct PlayState { } static PlayState playing() { return PlayState(State::Playing, Restart::None, false, {}); } static PlayState penalty_playing(bool ours) { - return PlayState(State::PenaltyPlaying, Restart::Penalty, ours, {}); + return PlayState(State::PenaltyPlaying, Restart::None, ours, {}); } bool operator==(const PlayState& other) const { diff --git a/soccer/src/soccer/ui/main_window.cpp b/soccer/src/soccer/ui/main_window.cpp index 39dac69563d..ae6efaff6cd 100644 --- a/soccer/src/soccer/ui/main_window.cpp +++ b/soccer/src/soccer/ui/main_window.cpp @@ -1141,13 +1141,15 @@ void MainWindow::on_fastReady_clicked() { void MainWindow::on_fastForceStart_clicked() { send_quick_command(PlayState::playing()); } void MainWindow::on_fastKickoffBlue_clicked() { - send_quick_command(PlayState::setup_kickoff(context_->blue_team)); - queued_command_ = PlayState::ready_kickoff(context_->blue_team); + PlayState setup_kickoff_state = PlayState::setup_kickoff(context_->blue_team); + send_quick_command(setup_kickoff_state); + queued_command_ = setup_kickoff_state.advanced_from_normal_start(); } void MainWindow::on_fastKickoffYellow_clicked() { - send_quick_command(PlayState::setup_kickoff(!context_->blue_team)); - queued_command_ = PlayState::ready_kickoff(context_->blue_team); + PlayState setup_kickoff_state = PlayState::setup_kickoff(!context_->blue_team); + send_quick_command(setup_kickoff_state); + queued_command_ = setup_kickoff_state.advanced_from_normal_start(); } void MainWindow::on_fastBlue_clicked() { @@ -1159,11 +1161,15 @@ void MainWindow::on_fastYellow_clicked() { } void MainWindow::on_fastPenaltyBlue_clicked() { - send_quick_command(PlayState::ready_penalty(context_->blue_team)); + PlayState setup_penalty_state = PlayState::setup_penalty(context_->blue_team); + send_quick_command(setup_penalty_state); + queued_command_ = setup_penalty_state.advanced_from_normal_start(); } void MainWindow::on_fastPenaltyYellow_clicked() { - send_quick_command(PlayState::ready_penalty(!context_->blue_team)); + PlayState setup_penalty_state = PlayState::setup_penalty(!context_->blue_team); + send_quick_command(setup_penalty_state); + queued_command_ = setup_penalty_state.advanced_from_normal_start(); } bool MainWindow::live() { return !_playbackRate; } From c1248985632de24827e6892c704027030758a63f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2025 21:54:38 -0500 Subject: [PATCH 6/7] Fix Code Style On internal-ref-fix (#2351) automated style fixes Co-authored-by: sid-parikh --- soccer/src/soccer/ui/main_window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/soccer/src/soccer/ui/main_window.cpp b/soccer/src/soccer/ui/main_window.cpp index ae6efaff6cd..1ddb5049a42 100644 --- a/soccer/src/soccer/ui/main_window.cpp +++ b/soccer/src/soccer/ui/main_window.cpp @@ -1141,13 +1141,13 @@ void MainWindow::on_fastReady_clicked() { void MainWindow::on_fastForceStart_clicked() { send_quick_command(PlayState::playing()); } void MainWindow::on_fastKickoffBlue_clicked() { - PlayState setup_kickoff_state = PlayState::setup_kickoff(context_->blue_team); + PlayState setup_kickoff_state = PlayState::setup_kickoff(context_->blue_team); send_quick_command(setup_kickoff_state); queued_command_ = setup_kickoff_state.advanced_from_normal_start(); } void MainWindow::on_fastKickoffYellow_clicked() { - PlayState setup_kickoff_state = PlayState::setup_kickoff(!context_->blue_team); + PlayState setup_kickoff_state = PlayState::setup_kickoff(!context_->blue_team); send_quick_command(setup_kickoff_state); queued_command_ = setup_kickoff_state.advanced_from_normal_start(); } @@ -1161,13 +1161,13 @@ void MainWindow::on_fastYellow_clicked() { } void MainWindow::on_fastPenaltyBlue_clicked() { - PlayState setup_penalty_state = PlayState::setup_penalty(context_->blue_team); + PlayState setup_penalty_state = PlayState::setup_penalty(context_->blue_team); send_quick_command(setup_penalty_state); queued_command_ = setup_penalty_state.advanced_from_normal_start(); } void MainWindow::on_fastPenaltyYellow_clicked() { - PlayState setup_penalty_state = PlayState::setup_penalty(!context_->blue_team); + PlayState setup_penalty_state = PlayState::setup_penalty(!context_->blue_team); send_quick_command(setup_penalty_state); queued_command_ = setup_penalty_state.advanced_from_normal_start(); } From 73a9c2042a5b593f5690fd27b0b3ed9529ea270e Mon Sep 17 00:00:00 2001 From: jvogt23 <91633361+jvogt23@users.noreply.github.com> Date: Sun, 23 Feb 2025 22:02:48 -0500 Subject: [PATCH 7/7] Remove dockerfile stuff, needs to be in its own branch --- Dockerfile.dev | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 62e03139457..cc264dc872e 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -10,12 +10,6 @@ ENV DISPLAY=:1 ARG TARGETARCH ENV TARGETARCH=${TARGETARCH} -RUN if [ -z TARGETARCH] then \ - echo "****************************** ERROR ******************************"; \ - echo "No target architecture was given. TARGETARCH is a required argument."; \ - exit 1; \ - fi - # Update the package list and install necessary packages, including the missing ones RUN apt-get update && \ apt-get install -y \ @@ -74,14 +68,6 @@ RUN git clone https://github.com/robotics-erlangen/framework.git /root/framework cmake .. && \ make simulator-cli -# Clone, build ER-Force's autoref -RUN git clone https://github.com/robotics-erlangen/autoref.git /root/autoref && \ - cd /root/autoref && \ - git submodule update --init && \ - mkdir build && cd build && \ - cmake .. && \ - make - # Use bash to source the ROS2 setup file and run make perf RUN bash -c "source /opt/ros/humble/setup.bash && \ cd /root/robocup-software && \