From 56203d1c13a89307c4ca5ee0af76868d4edd91aa Mon Sep 17 00:00:00 2001 From: Nicolai Ommer Date: Tue, 18 Mar 2025 19:54:54 +0100 Subject: [PATCH 01/35] Update ubuntu and macos runners (#189) --- .github/workflows/build.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3ec7f355..728e2d91 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ] steps: - uses: actions/checkout@v4 - name: "Update dependencies" @@ -27,15 +27,26 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-12, macos-13 ] + os: [ macos-13, macos-14 ] steps: - uses: actions/checkout@v4 - name: "Install dependencies" run: brew tap robotology/formulae && brew install cmake pkg-config qt@5 - name: "Build" - # for some reason qt5 is not correctly in the path and this will break whenever the location of it changes - # 5.15.11 is for macos-12 and 5.15.12 is for macos-13 - run: PATH=/usr/local/Cellar/qt@5/5.15.11/lib/cmake/Qt5:/usr/local/Cellar/qt@5/5.15.12/lib/cmake/Qt5:$PATH && make + run: | + # For macOS 13 + export PATH="/usr/local/opt/qt@5/bin:$PATH" + export LDFLAGS="-L/usr/local/opt/qt@5/lib" + export CPPFLAGS="-I/usr/local/opt/qt@5/include" + export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" + + # For macOS 14 + export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" + export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" + export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" + export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig" + + make # Windows build does not work currently, see https://github.com/RoboCup-SSL/grSim/issues/183 # build-windows: From 78a109b21fd7dcdd006ec8b70d3d94962ab57053 Mon Sep 17 00:00:00 2001 From: KIMURA Kazunori Date: Sun, 22 Mar 2026 21:44:42 +0900 Subject: [PATCH 02/35] Update field size for 2026 Corresponding rule update: robocup-ssl/ssl-rules#103 - Split variable Field_Margin, making it possible to set both `Field_Margin_Goal_Line` and `Field_Margin_Touch_Line` separately. - Set DivA_Field_Margin_Goal_line to 0.6m, set the others to 0.3m - Replace usage of `ConfigWidget::Field_Margin()` to corresponding one (`ConfigWidget::Field_Margin_Touch_Line()` or `ConfigWidget::Field_Margin_Goal_Line()`) - Update goal side walls to extend to the outside wall --- include/configwidget.h | 3 ++- src/configwidget.cpp | 6 ++++-- src/glwidget.cpp | 8 ++++---- src/mainwindow.cpp | 6 ++++-- src/sslworld.cpp | 43 +++++++++++++++++++++++++++++++----------- 5 files changed, 46 insertions(+), 20 deletions(-) diff --git a/include/configwidget.h b/include/configwidget.h index df7cece2..12d3f320 100644 --- a/include/configwidget.h +++ b/include/configwidget.h @@ -157,7 +157,8 @@ class ConfigWidget : public VarTreeView DEF_FIELD_VALUE(double,Double,Field_Penalty_Width) DEF_FIELD_VALUE(double,Double,Field_Penalty_Depth) DEF_FIELD_VALUE(double,Double,Field_Penalty_Point) - DEF_FIELD_VALUE(double,Double,Field_Margin) + DEF_FIELD_VALUE(double,Double,Field_Margin_Touch_Line) + DEF_FIELD_VALUE(double,Double,Field_Margin_Goal_Line) DEF_FIELD_VALUE(double,Double,Field_Referee_Margin) DEF_FIELD_VALUE(double,Double,Wall_Thickness) DEF_FIELD_VALUE(double,Double,Goal_Thickness) diff --git a/src/configwidget.cpp b/src/configwidget.cpp index c88d732e..c3c9b2dc 100644 --- a/src/configwidget.cpp +++ b/src/configwidget.cpp @@ -64,7 +64,8 @@ ConfigWidget::ConfigWidget() { ADD_VALUE(div_a_vars, Double, DivA_Field_Penalty_Width,3.60,"Penalty width") ADD_VALUE(div_a_vars, Double, DivA_Field_Penalty_Depth,1.80,"Penalty depth") ADD_VALUE(div_a_vars, Double, DivA_Field_Penalty_Point,8.00,"Penalty point") - ADD_VALUE(div_a_vars, Double, DivA_Field_Margin,0.3,"Margin") + ADD_VALUE(div_a_vars, Double, DivA_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") + ADD_VALUE(div_a_vars, Double, DivA_Field_Margin_Goal_Line,0.6,"Margin behind the goal lines") ADD_VALUE(div_a_vars, Double, DivA_Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(div_a_vars, Double, DivA_Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(div_a_vars, Double, DivA_Goal_Thickness,0.020,"Goal thickness") @@ -80,7 +81,8 @@ ConfigWidget::ConfigWidget() { ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Width,2.00,"Penalty width") ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Depth,1.0,"Penalty depth") ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Point,6.00,"Penalty point") - ADD_VALUE(div_b_vars, Double, DivB_Field_Margin,0.30,"Margin") + ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") + ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") ADD_VALUE(div_b_vars, Double, DivB_Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(div_b_vars, Double, DivB_Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(div_b_vars, Double, DivB_Goal_Thickness,0.020,"Goal thickness") diff --git a/src/glwidget.cpp b/src/glwidget.cpp index 46af025d..4ef3d6d4 100644 --- a/src/glwidget.cpp +++ b/src/glwidget.cpp @@ -415,17 +415,17 @@ void GLWidget::changeCameraMode() cammode = static_cast(static_cast(cammode)%(static_cast(CameraMode::MAX_ACTIVE_MODE_FOR_CHANGEMODE)+1)); if (cammode==CameraMode::BIRDS_EYE_FROM_TOUCH_LINE) - ssl->g->setViewpoint(0,-(cfg->Field_Width()+cfg->Field_Margin()*2.0f)/2.0f,3,90,-45,0); + ssl->g->setViewpoint(0,-(cfg->Field_Width()+cfg->Field_Margin_Touch_Line()*2.0f)/2.0f,3,90,-45,0); else if (cammode==CameraMode::CURRENT_ROBOT_VIEW) ssl->g->getViewpoint(xyz,hpr); else if (cammode==CameraMode::TOP_VIEW) ssl->g->setViewpoint(0,0,5,0,-90,0); else if (cammode==CameraMode::BIRDS_EYE_FROM_OPPOSITE_TOUCH_LINE) - ssl->g->setViewpoint(0, (cfg->Field_Width()+cfg->Field_Margin()*2.0f)/2.0f,3,270,-45,0); + ssl->g->setViewpoint(0, (cfg->Field_Width()+cfg->Field_Margin_Touch_Line()*2.0f)/2.0f,3,270,-45,0); else if (cammode==CameraMode::BIRDS_EYE_FROM_BLUE) - ssl->g->setViewpoint(-(cfg->Field_Length()+cfg->Field_Margin()*2.0f)/2.0f,0,3,0,-45,0); + ssl->g->setViewpoint(-(cfg->Field_Length()+cfg->Field_Margin_Goal_Line()*2.0f)/2.0f,0,3,0,-45,0); else if (cammode==CameraMode::BIRDS_EYE_FROM_YELLOW) - ssl->g->setViewpoint((cfg->Field_Length()+cfg->Field_Margin()*2.0f)/2.0f,0,3,180,-45,0); + ssl->g->setViewpoint((cfg->Field_Length()+cfg->Field_Margin_Goal_Line()*2.0f)/2.0f,0,3,180,-45,0); } void GLWidget::putBall(dReal x,dReal y) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0460c905..9a16b9a4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -234,7 +234,8 @@ MainWindow::MainWindow(QWidget *parent) QObject::connect(configwidget->v_DivA_Field_Penalty_Width.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivA_Field_Penalty_Depth.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivA_Field_Penalty_Point.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); - QObject::connect(configwidget->v_DivA_Field_Margin.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); + QObject::connect(configwidget->v_DivA_Field_Margin_Touch_Line.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); + QObject::connect(configwidget->v_DivA_Field_Margin_Goal_Line.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivA_Field_Referee_Margin.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivA_Wall_Thickness.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivA_Goal_Thickness.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); @@ -250,7 +251,8 @@ MainWindow::MainWindow(QWidget *parent) QObject::connect(configwidget->v_DivB_Field_Penalty_Width.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivB_Field_Penalty_Depth.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivB_Field_Penalty_Point.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); - QObject::connect(configwidget->v_DivB_Field_Margin.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); + QObject::connect(configwidget->v_DivB_Field_Margin_Touch_Line.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); + QObject::connect(configwidget->v_DivB_Field_Margin_Goal_Line.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivB_Field_Referee_Margin.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivB_Wall_Thickness.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); QObject::connect(configwidget->v_DivB_Goal_Thickness.get(), SIGNAL(wasEdited(VarPtr)), this, SLOT(restartSimulator())); diff --git a/src/sslworld.cpp b/src/sslworld.cpp index ab14858f..09a99df3 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -144,7 +144,7 @@ SSLWorld::SSLWorld(QGLWidget* parent, ConfigWidget* _cfg, RobotsFormation *form1 last_dt = -1; g = new CGraphics(parent); g->setSphereQuality(1); - g->setViewpoint(0,-(cfg->Field_Width()+cfg->Field_Margin()*2.0f)/2.0f,3,90,-45,0); + g->setViewpoint(0,-(cfg->Field_Width()+cfg->Field_Margin_Touch_Line()*2.0f)/2.0f,3,90,-45,0); p = new PWorld(0.05,9.81f,g,cfg->Robots_Count()); ball = new PBall (0,0,0.5,cfg->BallRadius(),cfg->BallMass(), 1,0.7,0); @@ -157,15 +157,22 @@ SSLWorld::SSLWorld(QGLWidget* parent, ConfigWidget* _cfg, RobotsFormation *form1 // Bounding walls const double thick = cfg->Wall_Thickness(); - const double increment = cfg->Field_Margin() + cfg->Field_Referee_Margin() + thick / 2; - const double pos_x = cfg->Field_Length() / 2.0 + increment; - const double pos_y = cfg->Field_Width() / 2.0 + increment; + const double increment_x = cfg->Field_Margin_Goal_Line() + cfg->Field_Referee_Margin() + thick / 2; + const double increment_y = cfg->Field_Margin_Touch_Line() + cfg->Field_Referee_Margin() + thick / 2; + const double pos_x = cfg->Field_Length() / 2.0 + increment_x; + const double pos_y = cfg->Field_Width() / 2.0 + increment_y; const double pos_z = 0.0; const double siz_x = 2.0 * pos_x; const double siz_y = 2.0 * pos_y; const double siz_z = 0.4; const double tone = 1.0; + // Bounding walls placement + // |-----[0]---- + // | | + // [3] [2] + // | | + // -----[1]----| walls[0] = new PFixedBox(thick/2, pos_y, pos_z, siz_x, thick, siz_z, tone, tone, tone); @@ -182,17 +189,24 @@ SSLWorld::SSLWorld(QGLWidget* parent, ConfigWidget* _cfg, RobotsFormation *form1 thick, siz_y, siz_z, tone, tone, tone); - // Goal walls + // Goal walls, side walls extend to the outside wall const double gthick = cfg->Goal_Thickness(); const double gpos_x = (cfg->Field_Length() + gthick) / 2.0 + cfg->Goal_Depth(); const double gpos_y = (cfg->Goal_Width() + gthick) / 2.0; const double gpos_z = cfg->Goal_Height() / 2.0; - const double gsiz_x = cfg->Goal_Depth() + gthick; + const double gsiz_x = cfg->Field_Margin_Goal_Line(); const double gsiz_y = cfg->Goal_Width(); const double gsiz_z = cfg->Goal_Height(); - const double gpos2_x = (cfg->Field_Length() + gsiz_x) / 2.0; - + const double gpos2_x = (cfg->Field_Length() + cfg->Field_Margin_Goal_Line() + cfg->Field_Line_Width()) / 2.0; + + // Yellow side + // (margin) │ + // ─[6]┬────│ + // │ │ + // [4] │ outside of wall + // │ │ + // ─[5]┴────| walls[4] = new PFixedBox(gpos_x, 0.0, gpos_z, gthick, gsiz_y, gsiz_z, tone, tone, tone); @@ -205,6 +219,13 @@ SSLWorld::SSLWorld(QGLWidget* parent, ConfigWidget* _cfg, RobotsFormation *form1 gsiz_x, gthick, gsiz_z, tone, tone, tone); + // Blue side + // │(margin) + // │────┬[9]─ + // │ │ + // outside of wall │ [7] + // │ │ + // |────┴[8]─ walls[7] = new PFixedBox(-gpos_x, 0.0, gpos_z, gthick, gsiz_y, gsiz_z, tone, tone, tone); @@ -1011,7 +1032,7 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { // Field general info field->set_field_length(CONVUNIT(cfg->Field_Length())); field->set_field_width(CONVUNIT(cfg->Field_Width())); - field->set_boundary_width(CONVUNIT(cfg->Field_Margin())); + field->set_boundary_width(CONVUNIT(cfg->Field_Margin_Touch_Line())); field->set_goal_width(CONVUNIT(cfg->Goal_Width())); field->set_goal_depth(CONVUNIT(cfg->Goal_Depth())); @@ -1204,7 +1225,7 @@ void RobotsFormation::setAll(const dReal* xx, const dReal *yy) RobotsFormation::RobotsFormation(E_FORMATION type, ConfigWidget* _cfg) : cfg(_cfg) { switch (type) { case FORMATION_OUTSIDE: { - double yv = -(_cfg->Field_Width() / 2 + _cfg->Field_Margin() / 2); + double yv = -(_cfg->Field_Width() / 2 + _cfg->Field_Margin_Touch_Line() / 2); dReal teamPosX[MAX_ROBOT_COUNT] = {0.40, 0.80, 1.20, 1.60, 2.00, 2.40, 2.80, 3.20, 3.60, 4.00, 4.40, 4.80, 0.40, 0.80, 1.20, 1.60}; @@ -1233,7 +1254,7 @@ RobotsFormation::RobotsFormation(E_FORMATION type, ConfigWidget* _cfg) : cfg(_cf break; } case FORMATION_OUTSIDE_FIELD: { - double yv = -(_cfg->Field_Width() / 2 + _cfg->Field_Margin() + _cfg->Field_Referee_Margin() + 0.5); + double yv = -(_cfg->Field_Width() / 2 + _cfg->Field_Margin_Touch_Line() + _cfg->Field_Referee_Margin() + 0.5); dReal teamPosX[MAX_ROBOT_COUNT] = { 0.40, 0.80, 1.20, 1.60, 2.00, 2.40, 2.80, 3.20, 3.60, 4.00, 4.40, 4.80, 0.40, 0.80, 1.20, 1.60}; From 12ad118e6a82fa16a3b308417dc232a5a52cd5c5 Mon Sep 17 00:00:00 2001 From: KIMURA Kazunori Date: Mon, 23 Mar 2026 01:18:27 +0900 Subject: [PATCH 03/35] Correct parent of the values (div_a_vars -> div_b_vars) --- src/configwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configwidget.cpp b/src/configwidget.cpp index c3c9b2dc..ff732cf8 100644 --- a/src/configwidget.cpp +++ b/src/configwidget.cpp @@ -81,8 +81,8 @@ ConfigWidget::ConfigWidget() { ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Width,2.00,"Penalty width") ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Depth,1.0,"Penalty depth") ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Point,6.00,"Penalty point") - ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") - ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") + ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") + ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") ADD_VALUE(div_b_vars, Double, DivB_Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(div_b_vars, Double, DivB_Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(div_b_vars, Double, DivB_Goal_Thickness,0.020,"Goal thickness") From 832ff272e8eadb50660b1f64fc57749cb6e0285d Mon Sep 17 00:00:00 2001 From: KIMURA Kazunori Date: Tue, 24 Mar 2026 02:01:18 +0900 Subject: [PATCH 04/35] Fix goal wall size calculation, include a margin for the referee --- src/sslworld.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 09a99df3..b20390c6 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -195,10 +195,10 @@ SSLWorld::SSLWorld(QGLWidget* parent, ConfigWidget* _cfg, RobotsFormation *form1 const double gpos_x = (cfg->Field_Length() + gthick) / 2.0 + cfg->Goal_Depth(); const double gpos_y = (cfg->Goal_Width() + gthick) / 2.0; const double gpos_z = cfg->Goal_Height() / 2.0; - const double gsiz_x = cfg->Field_Margin_Goal_Line(); + const double gsiz_x = cfg->Field_Margin_Goal_Line() + cfg->Field_Referee_Margin(); const double gsiz_y = cfg->Goal_Width(); const double gsiz_z = cfg->Goal_Height(); - const double gpos2_x = (cfg->Field_Length() + cfg->Field_Margin_Goal_Line() + cfg->Field_Line_Width()) / 2.0; + const double gpos2_x = (cfg->Field_Length() + gsiz_x) / 2.0; // Yellow side // (margin) │ From ef494e1e5574c94ce736cc11c159b9a7f9fd2d56 Mon Sep 17 00:00:00 2001 From: KIMURA Kazunori Date: Tue, 24 Mar 2026 02:04:46 +0900 Subject: [PATCH 05/35] Add `boundary_width_goal_line` to message `SSL_GeometryFieldSize` and set `cfg->Field_Margin_Goal_Line()` on `generatePacket()` fef: robocup-ssl/ssl-vision#234 --- src/proto/ssl_vision_geometry.proto | 2 ++ src/sslworld.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/proto/ssl_vision_geometry.proto b/src/proto/ssl_vision_geometry.proto index 440fd1e1..ac78738d 100644 --- a/src/proto/ssl_vision_geometry.proto +++ b/src/proto/ssl_vision_geometry.proto @@ -49,6 +49,8 @@ message SSL_GeometryFieldSize { required int32 goal_width = 3; required int32 goal_depth = 4; required int32 boundary_width = 5; + // Boundary width at the goal lines (distance from goal line centers to boundary walls) in mm + optional int32 boundary_width_goal_line = 16; repeated SSL_FieldLineSegment field_lines = 6; repeated SSL_FieldCircularArc field_arcs = 7; optional int32 penalty_area_depth = 8; diff --git a/src/sslworld.cpp b/src/sslworld.cpp index b20390c6..2612c7be 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -1033,6 +1033,7 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { field->set_field_length(CONVUNIT(cfg->Field_Length())); field->set_field_width(CONVUNIT(cfg->Field_Width())); field->set_boundary_width(CONVUNIT(cfg->Field_Margin_Touch_Line())); + field->set_boundary_width_goal_line(CONVUNIT(cfg->Field_Margin_Goal_Line())); field->set_goal_width(CONVUNIT(cfg->Goal_Width())); field->set_goal_depth(CONVUNIT(cfg->Goal_Depth())); From 82dc66a907bf11d3fc0e81991c701639509d329b Mon Sep 17 00:00:00 2001 From: KIMURA Kazunori Date: Tue, 24 Mar 2026 02:07:19 +0900 Subject: [PATCH 06/35] Add `goal_substitution_area_width` to message `SSL_GeometryFieldSize` Add field value `Field_Goal_Substitution_Area_Width` - Div.A: 0.3m - Div.B: 0.0m (non available) set the value on `generatePacket()` ref: fef: robocup-ssl/ssl-vision#234 --- include/configwidget.h | 1 + src/configwidget.cpp | 2 ++ src/proto/ssl_vision_geometry.proto | 2 ++ src/sslworld.cpp | 1 + 4 files changed, 6 insertions(+) diff --git a/include/configwidget.h b/include/configwidget.h index 12d3f320..433fe69a 100644 --- a/include/configwidget.h +++ b/include/configwidget.h @@ -159,6 +159,7 @@ class ConfigWidget : public VarTreeView DEF_FIELD_VALUE(double,Double,Field_Penalty_Point) DEF_FIELD_VALUE(double,Double,Field_Margin_Touch_Line) DEF_FIELD_VALUE(double,Double,Field_Margin_Goal_Line) + DEF_FIELD_VALUE(double,Double,Field_Goal_Substitution_Area_Width) DEF_FIELD_VALUE(double,Double,Field_Referee_Margin) DEF_FIELD_VALUE(double,Double,Wall_Thickness) DEF_FIELD_VALUE(double,Double,Goal_Thickness) diff --git a/src/configwidget.cpp b/src/configwidget.cpp index ff732cf8..749d63b7 100644 --- a/src/configwidget.cpp +++ b/src/configwidget.cpp @@ -66,6 +66,7 @@ ConfigWidget::ConfigWidget() { ADD_VALUE(div_a_vars, Double, DivA_Field_Penalty_Point,8.00,"Penalty point") ADD_VALUE(div_a_vars, Double, DivA_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") ADD_VALUE(div_a_vars, Double, DivA_Field_Margin_Goal_Line,0.6,"Margin behind the goal lines") + ADD_VALUE(div_a_vars, Double, DivA_Field_Goal_Substitution_Area_Width,0.3,"Substitution area width behind the goal lines") ADD_VALUE(div_a_vars, Double, DivA_Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(div_a_vars, Double, DivA_Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(div_a_vars, Double, DivA_Goal_Thickness,0.020,"Goal thickness") @@ -83,6 +84,7 @@ ConfigWidget::ConfigWidget() { ADD_VALUE(div_b_vars, Double, DivB_Field_Penalty_Point,6.00,"Penalty point") ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") + ADD_VALUE(div_b_vars, Double, DivB_Field_Goal_Substitution_Area_Width,0.0,"Substitution area width behind the goal lines") ADD_VALUE(div_b_vars, Double, DivB_Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(div_b_vars, Double, DivB_Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(div_b_vars, Double, DivB_Goal_Thickness,0.020,"Goal thickness") diff --git a/src/proto/ssl_vision_geometry.proto b/src/proto/ssl_vision_geometry.proto index ac78738d..d53efcdf 100644 --- a/src/proto/ssl_vision_geometry.proto +++ b/src/proto/ssl_vision_geometry.proto @@ -55,6 +55,8 @@ message SSL_GeometryFieldSize { repeated SSL_FieldCircularArc field_arcs = 7; optional int32 penalty_area_depth = 8; optional int32 penalty_area_width = 9; + // Width of the goal substitution area (distance from boundary walls that count as "inside the substitution area") in mm + optional int32 goal_substitution_area_width = 17; } message SSL_GeometryCameraCalibration { diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 2612c7be..83c76d08 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -1036,6 +1036,7 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { field->set_boundary_width_goal_line(CONVUNIT(cfg->Field_Margin_Goal_Line())); field->set_goal_width(CONVUNIT(cfg->Goal_Width())); field->set_goal_depth(CONVUNIT(cfg->Goal_Depth())); + field->set_goal_substitution_area_width(CONVUNIT(cfg->Field_Goal_Substitution_Area_Width())); // Field lines and arcs addFieldLinesArcs(field); From fe2bd2915a46f9f11ea6cb48dc426b8047952073 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 17:42:29 +0000 Subject: [PATCH 07/35] Update actions/checkout action to v6 --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 728e2d91..f24c704c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: matrix: os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: "Update dependencies" run: sudo apt-get update - name: "Install dependencies" @@ -29,7 +29,7 @@ jobs: matrix: os: [ macos-13, macos-14 ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: "Install dependencies" run: brew tap robotology/formulae && brew install cmake pkg-config qt@5 - name: "Build" From 7e8d995129ef17907098dffafbe528de50d471cc Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:15:29 +0100 Subject: [PATCH 08/35] Use vcpkg to resolve all packages. Also did some more cleanup to the cmake setup. Removed all custom build and find scripts in favor of vcpkg. Cleaned up cmake presets. --- .gitignore | 6 +- CMakeLists.txt | 109 +++------------------ CMakePresets.json | 123 +++++++++++++++--------- clients/qt/CMakeLists.txt | 19 +--- cmake/Utils.cmake | 22 ----- cmake/modules/BuildODE.cmake | 34 ------- cmake/modules/BuildProtobuf.cmake | 87 ----------------- cmake/modules/EnvHelper.cmake | 31 ------ cmake/modules/FindODE.cmake | 62 ------------ cmake/modules/FindOrBuildProtobuf.cmake | 11 --- cmake/modules/FindVarTypes.cmake | 37 ------- ports/vartypes/portfile.cmake | 17 ++++ ports/vartypes/vcpkg.json | 17 ++++ vcpkg-configuration.json | 6 ++ vcpkg.json | 6 +- 15 files changed, 140 insertions(+), 447 deletions(-) delete mode 100644 cmake/Utils.cmake delete mode 100644 cmake/modules/BuildODE.cmake delete mode 100644 cmake/modules/BuildProtobuf.cmake delete mode 100644 cmake/modules/EnvHelper.cmake delete mode 100644 cmake/modules/FindODE.cmake delete mode 100644 cmake/modules/FindOrBuildProtobuf.cmake delete mode 100644 cmake/modules/FindVarTypes.cmake create mode 100644 ports/vartypes/portfile.cmake create mode 100644 ports/vartypes/vcpkg.json create mode 100644 vcpkg-configuration.json diff --git a/.gitignore b/.gitignore index 2f15451b..f9c87035 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ .DS_STORE -build*/* -dist/* -bin*/* *.user *.swp Thumbs.db .idea/* *.iml -cmake-build-debug -cmake-build-release +out diff --git a/CMakeLists.txt b/CMakeLists.txt index f9ffc9e6..32b8ec48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.5) - +cmake_minimum_required(VERSION 3.25) ## Project branding, version and package mantainer project(grSim) @@ -7,13 +6,11 @@ set(VERSION "1.0.0a2") #set(VENDOR "Parsian") set(MAINTAINER "Mani Monajjemi ") - # some utils and helper vars string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER) -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) -include(${PROJECT_SOURCE_DIR}/cmake/Utils.cmake) -standard_config() -standard_paths(${PROJECT_SOURCE_DIR} bin lib) + +set(CMAKE_AUTOMOC YES) +set(CMAKE_INCLUDE_CURRENT_DIR YES) # policy regarding how to handle generated stuff, OLD behavior would ignore generated files # (which includes the generated protobuf cpp files) @@ -21,18 +18,6 @@ if (POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -# policy regarding when to rebuild stuff when external projects downloaded with URL changes -if (POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif() - -include(GNUInstallDirs) - -set(app ${CMAKE_PROJECT_NAME}) -# create the target before the sources list is known so that we can call -# add_dependencies( external_proj) -add_executable(${app} "") - # definitions for knowing the OS from the code if(MSVC) add_definitions(-DHAVE_MSVC) @@ -51,14 +36,14 @@ if(UNIX) endif() # set explicitly the c++ standard to use -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) # add src dir to included directories include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${PROJECT_SOURCE_DIR}/include/net) include_directories(${PROJECT_SOURCE_DIR}/include/physics) - ## Handling depenendcies # we will append all libs to this var @@ -66,90 +51,25 @@ set(libs) # OpenGL find_package(OpenGL REQUIRED) -include_directories(${OPENGL_INCLUDE_DIR}) -list(APPEND libs ${OPENGL_LIBRARIES}) +list(APPEND libs OpenGL::GL) #find_package(GLUT REQUIRED) #include_directories(${GLUT_INCLUDE_DIR}) # Qt -if(APPLE AND EXISTS /usr/local/opt/qt) - # Homebrew installs Qt5 (up to at least 5.9.1) in - # /usr/local/qt5, ensure it can be found by CMake since - # it is not in the default /usr/local prefix. - list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt") -endif() find_package(Qt5 COMPONENTS Core Widgets OpenGL Network REQUIRED) list(APPEND libs Qt5::Core Qt5::Widgets Qt5::OpenGL Qt5::Network) # ODE -if(BUILD_ODE) - include(BuildODE) - add_dependencies(${app} ode_external) -else() - if(WIN32) - find_package(ODE CONFIG) - set(ODE_LIB_NAME ODE::ODE) - else() - find_package(ODE) - set(ODE_LIB_NAME ode::ode) - endif() - - if(ODE_FOUND) - list(APPEND libs ${ODE_LIB_NAME}) - else() - # if ODE could not be found just build it - include(BuildODE) - add_dependencies(${app} ode_external) - endif() -endif() +find_package(ode CONFIG REQUIRED) +list(APPEND libs ODE::ODE) # VarTypes -find_package(VarTypes) - -if(NOT VARTYPES_FOUND) - include(ExternalProject) - - set(VARTYPES_CMAKE_ARGS "-DVARTYPES_BUILD_STATIC=ON;-DCMAKE_INSTALL_PREFIX=") - if(NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "") - set(VARTYPES_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE};${VARTYPES_CMAKE_ARGS}") - endif() - - ExternalProject_Add(vartypes_external - GIT_REPOSITORY https://github.com/jpfeltracco/vartypes - GIT_TAG origin/jpfeltracco/build_static - CMAKE_ARGS "${VARTYPES_CMAKE_ARGS}" - STEP_TARGETS install - ) - set(VARTYPES_LIB_SUBPATH "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}vartypes${CMAKE_STATIC_LIBRARY_SUFFIX}") - - # the byproducts are available after the install step - ExternalProject_Add_Step(vartypes_external out - DEPENDEES install - BYPRODUCTS - "/${VARTYPES_LIB_SUBPATH}" - ) - - add_dependencies(${app} vartypes_external) - - ExternalProject_Get_Property(vartypes_external install_dir) - add_dependencies(${app} vartypes_external) - - set(VARTYPES_INCLUDE_DIRS "${install_dir}/include") - set(VARTYPES_LIBRARIES "${install_dir}/${VARTYPES_LIB_SUBPATH}") -endif() - -target_include_directories(${app} PRIVATE ${VARTYPES_INCLUDE_DIRS}) -list(APPEND libs ${VARTYPES_LIBRARIES}) +find_package(vartypes CONFIG REQUIRED) +list(APPEND libs vartypes::vartypes) # Protobuf -include(FindOrBuildProtobuf) - -if(TARGET protobuf_external) - add_dependencies(${app} protobuf_external) -endif() - -include_directories(${Protobuf_INCLUDE_DIRS}) -list(APPEND libs ${Protobuf_LIBRARIES}) +find_package(protobuf CONFIG REQUIRED) +list(APPEND libs protobuf::libprotobuf) set (Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIR}) protobuf_generate_cpp(PROTO_CPP PROTO_H @@ -240,7 +160,8 @@ set(srcs file(GLOB CONFIG_FILES "config/*.ini") set_source_files_properties(${CONFIG_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "config") -target_sources(${app} PRIVATE ${srcs}) +set(app ${CMAKE_PROJECT_NAME}) +add_executable(${app} ${srcs}) install(TARGETS ${app} DESTINATION bin) target_link_libraries(${app} ${libs}) diff --git a/CMakePresets.json b/CMakePresets.json index de8ed6dd..c9e16c4b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,45 +1,80 @@ { - "version": 6, - "configurePresets": [ - { - "name": "windows-default", - "displayName": "Windows x64 Release", - "generator": "Ninja", - "binaryDir": "${sourceDir}/out/build/${presetName}", - "architecture": { - "value": "x64", - "strategy": "external" - }, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" - } - }, - { - "name": "ninja-multi-vcpkg", - "displayName": "Windows x64 Release vcpkg", - "generator": "Ninja Multi-Config", - "binaryDir": "${sourceDir}/out/build/${presetName}", - "architecture": { - "value": "x64", - "strategy": "external" - }, - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "type": "FILEPATH", - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - }, - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" - } - } - ], - "buildPresets": [ - { - "name": "ninja-multi-vcpkg", - "configurePreset": "ninja-multi-vcpkg", - "displayName": "Build ninja-multi-vcpkg", - "description": "Build ninja-multi-vcpkg Configurations" - } - ] -} + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}" + }, + { + "name": "windows-base", + "inherits": "base", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "windows-vs-22", + "description": "Target Windows (64-bit) for Visual Studio 2022", + "inherits": "windows-base", + "generator": "Visual Studio 17 2022", + "architecture": { + "value": "x64" + } + }, + { + "name": "windows-vs-22-clang", + "description": "Target Windows (64-bit) with the Visual Studio development environment using clang-cl toolset.", + "inherits": "windows-vs-22", + "toolset": "ClangCL" + }, + { + "name": "windows-ninja-base", + "inherits": "windows-base", + "hidden": true, + "generator": "Ninja", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe" + } + }, + { + "name": "windows-debug", + "inherits": "windows-ninja-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "windows-release", + "inherits": "windows-ninja-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "windows-debug", + "configurePreset": "windows-debug" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + } + ] +} \ No newline at end of file diff --git a/clients/qt/CMakeLists.txt b/clients/qt/CMakeLists.txt index a543a721..58c4a01a 100644 --- a/clients/qt/CMakeLists.txt +++ b/clients/qt/CMakeLists.txt @@ -1,7 +1,4 @@ -cmake_minimum_required(VERSION 2.8) - set(CMAKE_AUTOMOC ON) - set(CMAKE_INCLUDE_CURRENT_DIR ON) # policy regarding how to handle generated stuff, OLD behavior would ignore generated files @@ -10,24 +7,13 @@ if (POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -# policy regarding when to rebuild stuff when external projects downloaded with URL changes -if (POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif() - set(libs) find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED) list(APPEND libs Qt5::Core Qt5::Widgets Qt5::Network) -# if find_package was already executed and we already included BuildProtobuf find_package fails, -# so we only want to do execute find_package if protobuf was not found yet -if(NOT Protobuf_FOUND) - include(FindOrBuildProtobuf) -endif() - -include_directories(${Protobuf_INCLUDE_DIRS}) -list(APPEND libs ${Protobuf_LIBRARIES}) +find_package(protobuf CONFIG REQUIRED) +list(APPEND libs protobuf::libprotobuf) protobuf_generate_cpp(PROTO_CPP PROTO_H ../../src/proto/grSim_Replacement.proto @@ -50,4 +36,3 @@ if(TARGET protobuf_external) endif() target_link_libraries(${app} ${libs}) - diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake deleted file mode 100644 index 868bacd3..00000000 --- a/cmake/Utils.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# Some utilities -#TODO: comment/document - -macro(standard_paths ARG0 ARG1 ARG2) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ARG0}/${ARG1}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ARG0}/${ARG2}) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ARG0}/${ARG2}) - foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - endforeach() - set(CMAKE_DEBUG_POSTFIX d) - set(CMAKE_MINSIZEREL_POSTFIX min) -endmacro() - -macro(standard_config) - set(CMAKE_AUTOMOC YES) - set(CMAKE_INCLUDE_CURRENT_DIR YES) -endmacro() - diff --git a/cmake/modules/BuildODE.cmake b/cmake/modules/BuildODE.cmake deleted file mode 100644 index 41aa54f7..00000000 --- a/cmake/modules/BuildODE.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# build ODE, because some versions of it cause grSim to segfault somewhere -# could be because in some packages the double precision is turned off -include(ExternalProject) - -ExternalProject_Add(ode_external - GIT_REPOSITORY https://bitbucket.org/odedevs/ode.git - GIT_TAG 0.16.4 - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX:PATH= - -DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} - -DCMAKE_C_COMPILER:PATH=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER:PATH=${CMAKE_CXX_COMPILER} - -DCMAKE_MAKE_PROGRAM:PATH=${CMAKE_MAKE_PROGRAM} - # necessary, because it does not build the static libs if this is ON - -DBUILD_SHARED_LIBS=OFF - # if this is OFF grSim just dies instantly and INSTALL.md says it should be ON - -DODE_DOUBLE_PRECISION=ON - -DCMAKE_INSTALL_PREFIX= - STEP_TARGETS install -) - -set(ODE_LIB_SUBPATH "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ode${CMAKE_STATIC_LIBRARY_SUFFIX}") - -# the byproducts are available after the install step -ExternalProject_Add_Step(ode_external out - DEPENDEES install - BYPRODUCTS - "/${ODE_LIB_SUBPATH}" -) - -ExternalProject_Get_Property(ode_external install_dir) -set(ODE_LIBRARY "${install_dir}/${ODE_LIB_SUBPATH}") -list(APPEND libs ${ODE_LIBRARY}) -target_include_directories(${app} PRIVATE "${install_dir}/include") diff --git a/cmake/modules/BuildProtobuf.cmake b/cmake/modules/BuildProtobuf.cmake deleted file mode 100644 index dcc584b3..00000000 --- a/cmake/modules/BuildProtobuf.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# *************************************************************************** -# * Copyright 2017 Michael Eischer * -# * Robotics Erlangen e.V. * -# * http://www.robotics-erlangen.de/ * -# * info@robotics-erlangen.de * -# * * -# * This program is free software: you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation, either version 3 of the License, or * -# * any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program. If not, see . * -# *************************************************************************** - -include(ExternalProject) - -set(PROTOBUF_CMAKE_ARGS ) - -ExternalProject_Add(protobuf_external - # URL is the same as in the ER-Force framework, - # because ER-Force needs it and has an incentive to keep the link stable - URL http://www.robotics-erlangen.de/downloads/libraries/protobuf-cpp-3.6.1.tar.gz - URL_HASH SHA256=b3732e471a9bb7950f090fd0457ebd2536a9ba0891b7f3785919c654fe2a2529 - SOURCE_SUBDIR cmake - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX:PATH= - -DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} - -DCMAKE_C_COMPILER:PATH=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER:PATH=${CMAKE_CXX_COMPILER} - -DCMAKE_MAKE_PROGRAM:PATH=${CMAKE_MAKE_PROGRAM} - # the tests fail to build :-( - -Dprotobuf_BUILD_TESTS:BOOL=OFF - STEP_TARGETS install -) - -set(PROTOBUF_SUBPATH "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}") -set(LIBPROTOC_SUBPATH "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}") -set(PROTOC_SUBPATH "bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") - -# the byproducts are available after the install step -ExternalProject_Add_Step(protobuf_external out - DEPENDEES install - BYPRODUCTS - "/${PROTOBUF_SUBPATH}" - "/${LIBPROTOC_SUBPATH}" - "/${PROTOC_SUBPATH}" -) - -ExternalProject_Get_Property(protobuf_external install_dir) -set_target_properties(protobuf_external PROPERTIES EXCLUDE_FROM_ALL true) - -# override all necessary variables originally set by find_package -# if FORCE is not set cmake does not allow us to override the variables, for some unknown reason -set(Protobuf_FOUND true CACHE BOOL "" FORCE) -set(Protobuf_VERSION "3.6.1" CACHE STRING "" FORCE) -set(Protobuf_INCLUDE_DIR "${install_dir}/include" CACHE PATH "" FORCE) -set(Protobuf_INCLUDE_DIRS "${Protobuf_INCLUDE_DIR}" CACHE PATH "" FORCE) -set(Protobuf_LIBRARY "${install_dir}/${PROTOBUF_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_LIBRARIES "${Protobuf_LIBRARY}" CACHE PATH "" FORCE) -set(Protobuf_LIBRARY_DEBUG "${install_dir}/${PROTOBUF_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_LIBRARY_RELEASE "${install_dir}/${PROTOBUF_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_LITE_LIBRARY_DEBUG "${install_dir}/${PROTOBUF_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_LITE_LIBRARY_RELEASE "${install_dir}/${PROTOBUF_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_PROTOC_EXECUTABLE "${install_dir}/${PROTOC_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_PROTOC_LIBRARY_DEBUG "${install_dir}/${LIBPROTOC_SUBPATH}" CACHE PATH "" FORCE) -set(Protobuf_PROTOC_LIBRARY_RELEASE "${install_dir}/${LIBPROTOC_SUBPATH}" CACHE PATH "" FORCE) -# this is a dependency for the protobuf_generate_cpp custom command -# if this is not set the generate command sometimes get executed before protoc is compiled -set(protobuf_generate_DEPENDENCIES protobuf_external CACHE STRING "" FORCE) - -# compatibility with cmake 3.10 -if(NOT TARGET protobuf::protoc) - # avoid error if target was already created for an older version - add_executable(protobuf::protoc IMPORTED) -endif() -# override the protobuf::protoc path used by the protobuf_generate_cpp macro -set_target_properties(protobuf::protoc PROPERTIES - IMPORTED_LOCATION "${Protobuf_PROTOC_EXECUTABLE}" -) - -message(STATUS "Building protobuf ${Protobuf_VERSION}") diff --git a/cmake/modules/EnvHelper.cmake b/cmake/modules/EnvHelper.cmake deleted file mode 100644 index f5339c5f..00000000 --- a/cmake/modules/EnvHelper.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# *************************************************************************** -# * Copyright 2017 Michael Eischer * -# * Robotics Erlangen e.V. * -# * http://www.robotics-erlangen.de/ * -# * info@robotics-erlangen.de * -# * * -# * This program is free software: you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation, either version 3 of the License, or * -# * any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program. If not, see . * -# *************************************************************************** - -macro(sanitize_env) - # remove "." from path to avoid searching the build_dir/bin folder - set(ORIG_PATH $ENV{PATH}) - set(MOD_PATH $ENV{PATH}) - list(REMOVE_ITEM MOD_PATH .) - set(ENV{PATH} ${MOD_PATH}) -endmacro() - -macro(restore_env) - set(ENV{PATH} ${ORIG_PATH}) -endmacro() diff --git a/cmake/modules/FindODE.cmake b/cmake/modules/FindODE.cmake deleted file mode 100644 index e11f477c..00000000 --- a/cmake/modules/FindODE.cmake +++ /dev/null @@ -1,62 +0,0 @@ -find_package(PkgConfig QUIET) - -foreach(pc_lib ode-double ode) - pkg_check_modules(pc_ode QUIET "${pc_lib}") - if(pc_ode_FOUND) - if(pc_ode_VERSION VERSION_LESS "0.13") - if (pc_ode_CFLAGS MATCHES "-D(dSINGLE|dDOUBLE)") - set(pc_ode_precision "${CMAKE_MATCH_1}") - endif() - else() - pkg_get_variable(pc_ode_precision "${pc_lib}" precision) - endif() - - break() - endif() -endforeach() - -find_library(ODE_LIBRARIES - NAMES "${pc_ode_LIBRARIES}" - HINTS "${pc_ode_LIBRARY_DIRS}" -) - -find_path(ODE_INCLUDE_DIR - NAMES ode/ode.h - HINTS "${pc_ode_INCLUDEDIR}" -) - -set(ODE_VERSION "${pc_ode_VERSION}") -set(ODE_PRECISION "${pc_ode_precision}") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ODE - REQUIRED_VARS ODE_LIBRARIES ODE_INCLUDE_DIR ODE_PRECISION - VERSION_VAR ODE_VERSION -) - -mark_as_advanced(ODE_LIBRARIES ODE_INCLUDE_DIR ODE_PRECISION) - -if(ODE_LIBRARIES AND NOT TARGET ode::ode) - add_library(ode::ode UNKNOWN IMPORTED) - set_target_properties(ode::ode PROPERTIES - IMPORTED_LOCATION "${ODE_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIR}") - - if(ODE_VERSION VERSION_LESS "0.13") - if(ODE_PRECISION STREQUAL "dSINGLE") - set_target_properties(ode::ode PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "dSINGLE") - elseif(ODE_PRECISION STREQUAL "dDOUBLE") - set_target_properties(ode::ode PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "dDOUBLE") - endif() - else() - if(ODE_PRECISION STREQUAL "dSINGLE") - set_target_properties(ode::ode PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "dIDESINGLE") - elseif(ODE_PRECISION STREQUAL "dDOUBLE") - set_target_properties(ode::ode PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "dIDEDOUBLE") - endif() - endif() -endif() diff --git a/cmake/modules/FindOrBuildProtobuf.cmake b/cmake/modules/FindOrBuildProtobuf.cmake deleted file mode 100644 index 4db92e07..00000000 --- a/cmake/modules/FindOrBuildProtobuf.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# sanitize environment before find_package, because otherwise it also looks in the directory created for the ExternalProject -include(EnvHelper) -sanitize_env() -find_package(Protobuf 3.3.0) -restore_env() - -# protobuf versions >= 3.21 are incompatible with how the project is setup and cause weird errors -# so we build protobuf ourselves -if(NOT Protobuf_FOUND OR Protobuf_VERSION VERSION_GREATER_EQUAL 3.21) - include(BuildProtobuf) -endif() diff --git a/cmake/modules/FindVarTypes.cmake b/cmake/modules/FindVarTypes.cmake deleted file mode 100644 index 11a0b33d..00000000 --- a/cmake/modules/FindVarTypes.cmake +++ /dev/null @@ -1,37 +0,0 @@ -find_path( - VARTYPES_INCLUDE_DIRS - NAMES - vartypes/VarTypes.h - HINTS - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{ProgramFiles}/vartypes/include -) - -find_library( - VARTYPES_LIBRARY - NAMES - vartypes - HINTS - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramFiles}/vartypes/lib -) - -set(VARTYPES_LIBRARIES ${VARTYPES_LIBRARY}) - -find_package_handle_standard_args( - VARTYPES - DEFAULT_MSG - VARTYPES_INCLUDE_DIRS - VARTYPES_LIBRARIES -) - -mark_as_advanced( - VARTYPES_INCLUDE_DIRS - VARTYPES_LIBRARIES - VARTYPES_LIBRARY -) - diff --git a/ports/vartypes/portfile.cmake b/ports/vartypes/portfile.cmake new file mode 100644 index 00000000..852e7491 --- /dev/null +++ b/ports/vartypes/portfile.cmake @@ -0,0 +1,17 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lordhippo/vartypes + REF cdfdb8ab68c1ceab6f8a2350244777de3c945be9 + SHA512 2ffb2d2990d89783c1025e9fe40b10a30e473666ba79156c46fc379655a33941acd95ce6c0739144d549b05d2df3d9d13bc6b3801de32032942bf72699d92148 + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_EXAMPLE=OFF) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME "vartypes") + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vartypes" RENAME copyright) diff --git a/ports/vartypes/vcpkg.json b/ports/vartypes/vcpkg.json new file mode 100644 index 00000000..dca14658 --- /dev/null +++ b/ports/vartypes/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "vartypes", + "version-string": "0.9.0", + "description": "A feature-rich, object-oriented framework for managing variables in C++ / Qt5.", + "dependencies": [ + "qt5-base", + "boost-serialization", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 00000000..3b3d32a1 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json", + "overlay-ports": [ + "./ports" + ] +} \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index 89c2f3c8..01d464f2 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,9 +1,9 @@ { - "name": "grsim", - "version-string": "0.0.1", "dependencies": [ "qt5-base", "ode", - "protobuf" + "protobuf", + "opengl", + "vartypes" ] } From 4dc392e23494a787b9ad659febb0bacba8eb525c Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:16:29 +0100 Subject: [PATCH 09/35] Revert "Disable broken Windows pipeline" This reverts commit d14caf2420029a431b8685d9fcc8cecd18d0249a. --- .github/workflows/build.yaml | 49 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f24c704c..aeceaa53 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,28 +48,27 @@ jobs: make -# Windows build does not work currently, see https://github.com/RoboCup-SSL/grSim/issues/183 -# build-windows: -# runs-on: windows-latest -# steps: -# - uses: actions/checkout@v4 -# -# - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies -# uses: lukka/run-vcpkg@v11 -# with: -# vcpkgGitCommitId: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50 -# vcpkgDirectory: c:/vcpkg # folder must reside in c:\ otherwise qt wont install due to long path errors -# -# - name: Run CMake and run vcpkg to build packages -# uses: lukka/run-cmake@v10 -# with: -# # this preset is needed to actually install the vcpkg dependencies -# configurePreset: "ninja-multi-vcpkg" -# configPresetAdditionalArgs: "[-DVCPKG_TARGET_TRIPLET=x64-windows]" -# buildPreset: "ninja-multi-vcpkg" -# buildPresetAdditionalArgs: "['--config Release']" -# env: -# # [OPTIONAL] Define the vcpkg's triplet you want to enforce, otherwise the default one -# # for the hosting system will be automatically choosen (x64 is the default on all -# # platforms, e.g. `x64-osx`). -# VCPKG_DEFAULT_TRIPLET: "x64-windows" + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50 + vcpkgDirectory: c:/vcpkg # folder must reside in c:\ otherwise qt wont install due to long path errors + + - name: Run CMake and run vcpkg to build packages + uses: lukka/run-cmake@v10 + with: + # this preset is needed to actually install the vcpkg dependencies + configurePreset: "ninja-multi-vcpkg" + configPresetAdditionalArgs: "[-DVCPKG_TARGET_TRIPLET=x64-windows]" + buildPreset: "ninja-multi-vcpkg" + buildPresetAdditionalArgs: "['--config Release']" + env: + # [OPTIONAL] Define the vcpkg's triplet you want to enforce, otherwise the default one + # for the hosting system will be automatically choosen (x64 is the default on all + # platforms, e.g. `x64-osx`). + VCPKG_DEFAULT_TRIPLET: "x64-windows" From 2708cbccdb1bab3d598b7db5f1b2ccc2f22fe881 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:23:07 +0100 Subject: [PATCH 10/35] Fix the CI script. --- .github/workflows/build.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index aeceaa53..95acd565 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,8 @@ on: branches: - master pull_request: + workflow_dispatch: + jobs: build-linux: runs-on: ${{ matrix.os }} @@ -63,12 +65,5 @@ jobs: uses: lukka/run-cmake@v10 with: # this preset is needed to actually install the vcpkg dependencies - configurePreset: "ninja-multi-vcpkg" - configPresetAdditionalArgs: "[-DVCPKG_TARGET_TRIPLET=x64-windows]" - buildPreset: "ninja-multi-vcpkg" - buildPresetAdditionalArgs: "['--config Release']" - env: - # [OPTIONAL] Define the vcpkg's triplet you want to enforce, otherwise the default one - # for the hosting system will be automatically choosen (x64 is the default on all - # platforms, e.g. `x64-osx`). - VCPKG_DEFAULT_TRIPLET: "x64-windows" + configurePreset: "windows-release" + buildPreset: "windows-release" From 8905e6848e25f1eec1bbc689170b5484377d3e19 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:31:11 +0100 Subject: [PATCH 11/35] Fixing linux and mac CI jobs. --- .github/workflows/build.yaml | 48 ++++++++++++++---------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 95acd565..f9aa6511 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,12 +16,14 @@ jobs: os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ] steps: - uses: actions/checkout@v6 - - name: "Update dependencies" - run: sudo apt-get update - - name: "Install dependencies" - run: sudo apt-get install -y build-essential cmake pkg-config qtbase5-dev libqt5opengl5-dev libgl1-mesa-dev libglu1-mesa-dev libprotobuf-dev protobuf-compiler libode-dev libboost-dev - - name: "Build" - run: make + - uses: lukka/get-cmake@latest + - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies + uses: lukka/run-vcpkg@v11 + - name: Run CMake and run vcpkg to build packages + uses: lukka/run-cmake@v10 + with: + configurePreset: "linux-debug" + buildPreset: "linux-debug" build-macos: runs-on: ${{ matrix.os }} @@ -32,38 +34,24 @@ jobs: os: [ macos-13, macos-14 ] steps: - uses: actions/checkout@v6 - - name: "Install dependencies" - run: brew tap robotology/formulae && brew install cmake pkg-config qt@5 - - name: "Build" - run: | - # For macOS 13 - export PATH="/usr/local/opt/qt@5/bin:$PATH" - export LDFLAGS="-L/usr/local/opt/qt@5/lib" - export CPPFLAGS="-I/usr/local/opt/qt@5/include" - export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" - - # For macOS 14 - export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" - export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" - export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" - export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig" - - make + - uses: lukka/get-cmake@latest + - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies + uses: lukka/run-vcpkg@v11 + - name: Run CMake and run vcpkg to build packages + uses: lukka/run-cmake@v10 + with: + configurePreset: "macos-debug" + buildPreset: "macos-debug" build-windows: runs-on: windows-latest steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v6 + - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50 - vcpkgDirectory: c:/vcpkg # folder must reside in c:\ otherwise qt wont install due to long path errors - - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: - # this preset is needed to actually install the vcpkg dependencies configurePreset: "windows-release" buildPreset: "windows-release" From 4d9ce2e7f09dc2a1398d1f78eb0b9620d423b744 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:35:01 +0100 Subject: [PATCH 12/35] Add the vcpkg commit sha back. --- .github/workflows/build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f9aa6511..017511f3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,8 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -37,6 +39,8 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -50,6 +54,8 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: From 026322a524ad9c896ec0af264a1c05bfcb9b8cab Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 20:45:39 +0100 Subject: [PATCH 13/35] Add mac and linux cmake presets. --- CMakePresets.json | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index c9e16c4b..5387db11 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,6 +23,56 @@ "rhs": "Windows" } }, + { + "name": "linux-base", + "inherits": "base", + "hidden": true, + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "macos-base", + "inherits": "base", + "hidden": true, + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name": "macos-debug", + "inherits": "macos-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "macos-release", + "inherits": "macos-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux-debug", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-release", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, { "name": "windows-vs-22", "description": "Target Windows (64-bit) for Visual Studio 2022", @@ -68,6 +118,22 @@ } ], "buildPresets": [ + { + "name": "linux-debug", + "configurePreset": "linux-debug" + }, + { + "name": "linux-release", + "configurePreset": "linux-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, { "name": "windows-debug", "configurePreset": "windows-debug" From 25a0a1565e99f193853cd66707b1458ae589ff9a Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 21:58:55 +0100 Subject: [PATCH 14/35] Install necessary mac and linux system packages. --- .github/workflows/build.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 017511f3..f4910d83 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,10 @@ jobs: os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ] steps: - uses: actions/checkout@v6 + - name: Install system packages + uses: ConorMacBride/install-package@v1 + with: + apt: '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 @@ -36,6 +40,10 @@ jobs: os: [ macos-13, macos-14 ] steps: - uses: actions/checkout@v6 + - name: Install system packages + uses: ConorMacBride/install-package@v1 + with: + brew: pkg-config - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 From 9c65226a11b7f0d70db5b24a2bc475f185fb9b58 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 21:59:45 +0100 Subject: [PATCH 15/35] Fixed a syntax error in CI script. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f4910d83..d270e420 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,7 +19,7 @@ jobs: - name: Install system packages uses: ConorMacBride/install-package@v1 with: - apt: '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev + apt: ^libxcb.*-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 From 2f1b6223d29f59cc042fa0fb17b6d186b81fed8d Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 22:16:43 +0100 Subject: [PATCH 16/35] Install python 3.11 for meson to work. Also add latest ubuntu and mac to build targets. --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d270e420..6154124e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,6 +44,9 @@ jobs: uses: ConorMacBride/install-package@v1 with: brew: pkg-config + - uses: actions/setup-python@v5 + with: + python-version: '3.11' - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 From 2a56d9295c849b4e69097ee97f4d8a9cee9355bb Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Mon, 4 Mar 2024 22:40:59 +0100 Subject: [PATCH 17/35] Use a vartype commit that fixes the pch issue. --- ports/vartypes/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/vartypes/portfile.cmake b/ports/vartypes/portfile.cmake index 852e7491..e101c578 100644 --- a/ports/vartypes/portfile.cmake +++ b/ports/vartypes/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lordhippo/vartypes - REF cdfdb8ab68c1ceab6f8a2350244777de3c945be9 - SHA512 2ffb2d2990d89783c1025e9fe40b10a30e473666ba79156c46fc379655a33941acd95ce6c0739144d549b05d2df3d9d13bc6b3801de32032942bf72699d92148 + REF a55280872b4b39269acbd4c3faa6160e64f576d5 + SHA512 03696c06aff60020aa2b868b6b60c98dfc43347578194e914be1954907bd63615d1e259ffaad148f47204aa953762821d85231c37edc51f97fd48a753e8de905 HEAD_REF master ) From 9664bae0bab5d4269394980c97a11d8f70328617 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 00:17:48 +0100 Subject: [PATCH 18/35] Fixed installation and packaging. --- CMakeLists.txt | 8 ++++---- CMakePresets.json | 8 +++++++- clients/qt/CMakeLists.txt | 6 ++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32b8ec48..78c86e6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,9 +162,9 @@ set_source_files_properties(${CONFIG_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION set(app ${CMAKE_PROJECT_NAME}) add_executable(${app} ${srcs}) -install(TARGETS ${app} DESTINATION bin) target_link_libraries(${app} ${libs}) +install(TARGETS ${app} DESTINATION bin) if(APPLE AND CMAKE_MACOSX_BUNDLE) # use CMAKE_MACOSX_BUNDLE if you want to build a mac bundle set(MACOSX_BUNDLE_ICON_FILE "${PROJECT_SOURCE_DIR}/resources/icons/grsim.icns") @@ -181,7 +181,7 @@ if(APPLE AND CMAKE_MACOSX_BUNDLE) elseif(WIN32 AND CMAKE_WIN32_EXECUTABLE) # use CMAKE_WIN32_EXECUTABLE if you want to build a windows exe install(DIRECTORY config DESTINATION .) - install(DIRECTORY bin DESTINATION . + install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin FILES_MATCHING PATTERN "*.dll") set(CPACK_PACKAGE_EXECUTABLES ${app} ${app}) else() @@ -208,9 +208,9 @@ if(UNIX) endif() elseif(WIN32) set(ARCH "win32") - set(CPACK_GENERATOR ZIP NSIS) + set(CPACK_GENERATOR ZIP) endif() -set(CPACK_OUTPUT_FILE_PREFIX ${PROJECT_SOURCE_DIR}/dist) +set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_BINARY_DIR}/dist) set(CPACK_PACKAGE_CONTACT ${MAINTAINER}) if(VENDOR) set(CPACK_PACKAGE_VENDOR ${VENDOR}) diff --git a/CMakePresets.json b/CMakePresets.json index 5387db11..70e96c46 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -11,7 +11,10 @@ "hidden": true, "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "binaryDir": "${sourceDir}/out/build/${presetName}", - "installDir": "${sourceDir}/out/install/${presetName}" + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/out/build/${presetName}/bin" + } }, { "name": "windows-base", @@ -21,6 +24,9 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" + }, + "cacheVariables": { + "CMAKE_WIN32_EXECUTABLE": "ON" } }, { diff --git a/clients/qt/CMakeLists.txt b/clients/qt/CMakeLists.txt index 58c4a01a..d7b68915 100644 --- a/clients/qt/CMakeLists.txt +++ b/clients/qt/CMakeLists.txt @@ -31,8 +31,6 @@ add_executable(${app} MACOSX_BUNDLE mainwindow.h ) -if(TARGET protobuf_external) - add_dependencies(${app} protobuf_external) -endif() - target_link_libraries(${app} ${libs}) + +install(TARGETS ${app} DESTINATION bin) From 19d85246ebb9d03cdd6dc7440cbd1e179f3d1ae0 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 00:21:54 +0100 Subject: [PATCH 19/35] Add windows auto-release. --- .github/workflows/build.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6154124e..c309040f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,8 @@ name: Build on: push: + tags: + - 'v*' branches: - master pull_request: @@ -72,3 +74,11 @@ jobs: with: configurePreset: "windows-release" buildPreset: "windows-release" + - name: Release + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: true + files: "out/windows-release/dist/*.zip" + fail_on_unmatched_files: true + generate_release_notes: true From aa222a1de1a87c7cba85e157f783c9debfabdaa5 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 00:31:29 +0100 Subject: [PATCH 20/35] Add the missing package step and preset. --- .github/workflows/build.yaml | 1 + CMakePresets.json | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c309040f..3dfb2e97 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -74,6 +74,7 @@ jobs: with: configurePreset: "windows-release" buildPreset: "windows-release" + packagePreset: "windows-release" - name: Release uses: softprops/action-gh-release@v0.1.15 if: startsWith(github.ref, 'refs/tags/v') diff --git a/CMakePresets.json b/CMakePresets.json index 70e96c46..15957a2b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -148,5 +148,11 @@ "name": "windows-release", "configurePreset": "windows-release" } + ], + "packagePresets": [ + { + "name": "windows-release", + "configurePreset": "windows-release" + } ] } \ No newline at end of file From 09656278571f55d6285f0b4ecb8969d99e2f3836 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 01:05:25 +0100 Subject: [PATCH 21/35] Remove the unnecessary CMP0071. This only affects how automoc handles generated files. We don't moc proto-generated files. --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78c86e6a..8618438b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,12 +12,6 @@ string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER) set(CMAKE_AUTOMOC YES) set(CMAKE_INCLUDE_CURRENT_DIR YES) -# policy regarding how to handle generated stuff, OLD behavior would ignore generated files -# (which includes the generated protobuf cpp files) -if (POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) -endif() - # definitions for knowing the OS from the code if(MSVC) add_definitions(-DHAVE_MSVC) From 23bdc689bf65e9e8eab7cf1f7e2f340345b97e99 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 01:16:19 +0100 Subject: [PATCH 22/35] Remove older linux and mac CI targets. Also add a todo to update the install file. --- .github/workflows/build.yaml | 4 ++-- INSTALL.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3dfb2e97..0e8805c9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ] + os: [ ubuntu-latest ] steps: - uses: actions/checkout@v6 - name: Install system packages @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-13, macos-14 ] + os: [ macos-latest ] steps: - uses: actions/checkout@v6 - name: Install system packages diff --git a/INSTALL.md b/INSTALL.md index e7ee47f5..3ec2a0f5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -46,6 +46,8 @@ The container can be run in two flavors: ## Building and installing from the source code +TODO: Replace all these with a simplified vcpkg build. + ### Installing Dependencies #### Arch Linux From 40a57748252f21e7375d93b8ecb6d0a3f9314d72 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 08:51:12 +0100 Subject: [PATCH 23/35] Fixed windows release path in CI. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0e8805c9..4a0f2871 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -80,6 +80,6 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') with: draft: true - files: "out/windows-release/dist/*.zip" + files: "out/build/windows-release/dist/*.zip" fail_on_unmatched_files: true generate_release_notes: true From 825d0c0beabecbb50c599237c9bcb326ca3eedf4 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 09:01:07 +0100 Subject: [PATCH 24/35] Package linux and mac builds. --- .github/workflows/build.yaml | 10 ++++++---- CMakePresets.json | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4a0f2871..6d3ca91c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,8 +30,9 @@ jobs: - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: - configurePreset: "linux-debug" - buildPreset: "linux-debug" + configurePreset: "linux-release" + buildPreset: "linux-release" + packagePreset: "linux-release" build-macos: runs-on: ${{ matrix.os }} @@ -57,8 +58,9 @@ jobs: - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: - configurePreset: "macos-debug" - buildPreset: "macos-debug" + configurePreset: "macos-release" + buildPreset: "macos-release" + packagePreset: "macos-release" build-windows: runs-on: windows-latest diff --git a/CMakePresets.json b/CMakePresets.json index 15957a2b..fb4d40dc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -150,6 +150,14 @@ } ], "packagePresets": [ + { + "name": "linux-release", + "configurePreset": "linux-release" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, { "name": "windows-release", "configurePreset": "windows-release" From 5e0523f0aca650720f41156ae4f5dc4c7edee34e Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 09:08:19 +0100 Subject: [PATCH 25/35] Add release steps for mac and linux. --- .github/workflows/build.yaml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6d3ca91c..a93eee0e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,12 +10,7 @@ on: jobs: build-linux: - runs-on: ${{ matrix.os }} - continue-on-error: true - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install system packages @@ -33,14 +28,17 @@ jobs: configurePreset: "linux-release" buildPreset: "linux-release" packagePreset: "linux-release" + - name: Release + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: true + files: "out/build/windows-release/dist/*" + fail_on_unmatched_files: true + generate_release_notes: true build-macos: - runs-on: ${{ matrix.os }} - continue-on-error: true - strategy: - fail-fast: false - matrix: - os: [ macos-latest ] + runs-on: macos-latest steps: - uses: actions/checkout@v6 - name: Install system packages @@ -61,6 +59,14 @@ jobs: configurePreset: "macos-release" buildPreset: "macos-release" packagePreset: "macos-release" + - name: Release + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: true + files: "out/build/windows-release/dist/*" + fail_on_unmatched_files: true + generate_release_notes: true build-windows: runs-on: windows-latest @@ -82,6 +88,6 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') with: draft: true - files: "out/build/windows-release/dist/*.zip" + files: "out/build/windows-release/dist/*" fail_on_unmatched_files: true generate_release_notes: true From 27ad2d4e72e322285f4834e26bbe533c2777d983 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Tue, 5 Mar 2024 09:14:05 +0100 Subject: [PATCH 26/35] Fixed mac and linux release paths. --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a93eee0e..8b9b1a85 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,7 +33,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') with: draft: true - files: "out/build/windows-release/dist/*" + files: "out/build/linux-release/dist/*" fail_on_unmatched_files: true generate_release_notes: true @@ -64,7 +64,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') with: draft: true - files: "out/build/windows-release/dist/*" + files: "out/build/macos-release/dist/*" fail_on_unmatched_files: true generate_release_notes: true From 8fb96845429fa008134a78241dc455e3655b7a3f Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Sat, 18 May 2024 12:43:46 +0200 Subject: [PATCH 27/35] Fix clion cmake presets issue. --- CMakePresets.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index fb4d40dc..6a062fce 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -85,7 +85,8 @@ "inherits": "windows-base", "generator": "Visual Studio 17 2022", "architecture": { - "value": "x64" + "value": "x64", + "strategy": "external" } }, { @@ -163,4 +164,4 @@ "configurePreset": "windows-release" } ] -} \ No newline at end of file +} From 67f29c0f1bb576d35549ac54a171f2e316b5c69a Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Sun, 19 May 2024 16:49:10 +0200 Subject: [PATCH 28/35] Update geometry proto and set more fields. --- src/sslworld.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 83c76d08..528038db 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -1038,6 +1038,13 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { field->set_goal_depth(CONVUNIT(cfg->Goal_Depth())); field->set_goal_substitution_area_width(CONVUNIT(cfg->Field_Goal_Substitution_Area_Width())); + field->set_penalty_area_depth(CONVUNIT(cfg->Field_Penalty_Depth())); + field->set_penalty_area_width(CONVUNIT(cfg->Field_Penalty_Width())); + field->set_center_circle_radius(CONVUNIT(cfg->Field_Rad())); + field->set_line_thickness(CONVUNIT(cfg->Field_Line_Width())); + field->set_goal_center_to_penalty_mark(CONVUNIT(cfg->Field_Penalty_Point())); + field->set_ball_radius(CONVUNIT(cfg->BallRadius())); + // Field lines and arcs addFieldLinesArcs(field); From d4fb5e60f596ee070de944d0d3f11307509a1d00 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Sat, 13 Jul 2024 17:13:42 +0200 Subject: [PATCH 29/35] Add msaa and fix field line flickering. --- src/glwidget.cpp | 4 ++++ src/graphics.cpp | 45 +++++------------------------------------ src/physics/pground.cpp | 2 +- 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/src/glwidget.cpp b/src/glwidget.cpp index 4ef3d6d4..d94d3f98 100644 --- a/src/glwidget.cpp +++ b/src/glwidget.cpp @@ -30,6 +30,10 @@ Copyright (C) 2011, Parsian Robotic Center (eew.aut.ac.ir/~parsian/grsim) GLWidget::GLWidget(QWidget *parent, ConfigWidget* _cfg) : QGLWidget(parent) { + QGLFormat format{}; + format.setSamples(4); // 4x MSAA + setFormat(format); + frames = 0; state = CursorMode::STEADY; first_time = true; diff --git a/src/graphics.cpp b/src/graphics.cpp index da269c07..d1d7a1e3 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -446,13 +446,7 @@ void CGraphics::initScene(int width,int height,dReal rc,dReal gc,dReal bc,bool f _width = width; _height = height; - //glEnable(GL_POLYGON_SMOOTH); - //glEnable(GL_LINE_SMOOTH); - //glEnable(GL_POINT_SMOOTH); - //glHint(GL_POINT_SMOOTH_HINT,GL_NICEST); - //glHint(GL_POLYGON_SMOOTH_HINT,GL_NICEST); - //glHint(GL_LINE_SMOOTH_HINT,GL_NICEST); - //glEnable(GL_MULTISAMPLE); + glEnable(GL_MULTISAMPLE); // setup stuff glEnable (GL_LIGHTING); @@ -462,7 +456,7 @@ void CGraphics::initScene(int width,int height,dReal rc,dReal gc,dReal bc,bool f glDisable (GL_TEXTURE_GEN_T); glShadeModel (GL_FLAT); glEnable (GL_DEPTH_TEST); - glDepthFunc (GL_LESS); + glDepthFunc (GL_LEQUAL); glEnable (GL_CULL_FACE); glCullFace (GL_BACK); glFrontFace (GL_CCW); @@ -471,7 +465,7 @@ void CGraphics::initScene(int width,int height,dReal rc,dReal gc,dReal bc,bool f glViewport (0,0,width,height); glMatrixMode (GL_PROJECTION); glLoadIdentity(); - const dReal vnear = 0.1f; + const dReal vnear = 0.2f; const dReal vfar = m_renderDepth; const dReal k = 0.8f; // view scale, 1 = +/- 45 degrees frustum_vnear = vnear; @@ -546,35 +540,6 @@ void CGraphics::finalizeScene() //owner->swapBuffers(); } -void CGraphics::drawSky () -{ - if (graphicDisabled) return; - const dReal ssize = 1000.0f; - dReal offset = 0.0f; - - dReal x = ssize*sky_scale; - dReal z = view_xyz[2] + sky_height; - - glBegin (GL_QUADS); - glNormal3f (0,0,-1); - glTexCoord2f (-x+offset,-x+offset); - glVertex3f (-ssize+view_xyz[0],-ssize+view_xyz[1],z); - glTexCoord2f (-x+offset,x+offset); - glVertex3f (-ssize+view_xyz[0],ssize+view_xyz[1],z); - glTexCoord2f (x+offset,x+offset); - glVertex3f (ssize+view_xyz[0],ssize+view_xyz[1],z); - glTexCoord2f (x+offset,-x+offset); - glVertex3f (ssize+view_xyz[0],-ssize+view_xyz[1],z); - glEnd(); - - //if (offset > 1) offset -= 1;//never read - - glDepthFunc (GL_LESS); - glDepthRange (0,1); - - resetState(); -} - void CGraphics::resetState() { if (graphicDisabled) return; @@ -582,7 +547,7 @@ void CGraphics::resetState() glDisable (GL_TEXTURE_2D); glShadeModel (GL_FLAT); glEnable (GL_DEPTH_TEST); - glDepthFunc (GL_LESS); + glDepthFunc (GL_LEQUAL); glColor3f (1,1,1); setColor (1,1,1,1); } @@ -593,7 +558,7 @@ void CGraphics::drawGround() glDisable (GL_LIGHTING); glShadeModel (GL_FLAT); glEnable (GL_DEPTH_TEST); - glDepthFunc (GL_LESS); + glDepthFunc (GL_LEQUAL); const dReal gsize = 100.0f; const dReal offset = 0; diff --git a/src/physics/pground.cpp b/src/physics/pground.cpp index fd99ea5d..b4cd6d22 100644 --- a/src/physics/pground.cpp +++ b/src/physics/pground.cpp @@ -43,7 +43,7 @@ void PGround::draw() g->useTexture(tex); g->drawGround(); g->noTexture(); - g->drawSSLGround(rad,len,wid,pdep,pwid,ppoint,lwidth,0.0001); + g->drawSSLGround(rad,len,wid,pdep,pwid,ppoint,lwidth,0.001); } PGround::~PGround() From 0c65ab077e68a3237171fb60bbddcdb0c3baf70a Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Wed, 7 May 2025 09:32:43 +0200 Subject: [PATCH 30/35] Use actual time instead of sim time for frame times. --- src/sslworld.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 528038db..96a05a97 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -461,7 +461,9 @@ void SSLWorld::step(dReal dt) { p->step(dt/ballCollisionTry); } - sim_time += last_dt; + const auto now = std::chrono::system_clock::now(); + sim_time = std::chrono::duration_cast>(now.time_since_epoch()).count(); + //sim_time += last_dt; int best_k=-1; dReal best_dist = 1e8; @@ -1006,7 +1008,11 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { pPacket->mutable_detection()->set_camera_id(cam_id); pPacket->mutable_detection()->set_frame_number(frame_num); pPacket->mutable_detection()->set_t_capture(sim_time); - pPacket->mutable_detection()->set_t_sent(sim_time); + + const auto now = std::chrono::system_clock::now(); + const double t_sent = std::chrono::duration_cast>(now.time_since_epoch()).count(); + pPacket->mutable_detection()->set_t_sent(t_sent); + dReal dev_x = cfg->noiseDeviation_x(); dReal dev_y = cfg->noiseDeviation_y(); dReal dev_a = cfg->noiseDeviation_angle(); From 1a75f49392580078535d76ab4c3b9d6da66d62f1 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Thu, 8 May 2025 00:36:34 +0200 Subject: [PATCH 31/35] Update vcpkg. --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8b9b1a85..ad7047a4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -52,7 +52,7 @@ jobs: - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -76,7 +76,7 @@ jobs: - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: 215a2535590f1f63788ac9bd2ed58ad15e6afdff + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: From 93889b835dba999f2bda41e3af1447553301c884 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Thu, 8 May 2025 08:35:41 +0200 Subject: [PATCH 32/35] Install linux package tools needed for libxcrypt. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ad7047a4..10c8ce06 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: - name: Install system packages uses: ConorMacBride/install-package@v1 with: - apt: ^libxcb.*-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev + apt: ^libxcb.*-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf automake autoconf-archive libtool libltdl-dev - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 From c36ad68dd41c7d3c7f957d10d44c5926227d9411 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Thu, 8 May 2025 09:07:29 +0200 Subject: [PATCH 33/35] Add bison to ubuntu package list. --- .github/workflows/build.yaml | 2 +- CMakePresets.json | 4 ++++ src/sslworld.cpp | 7 ------- vcpkg.json | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 10c8ce06..62eb2af5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: - name: Install system packages uses: ConorMacBride/install-package@v1 with: - apt: ^libxcb.*-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf automake autoconf-archive libtool libltdl-dev + apt: ^libxcb.*-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf automake autoconf-archive libtool libltdl-dev bison - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 diff --git a/CMakePresets.json b/CMakePresets.json index 6a062fce..feabeed3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -125,6 +125,10 @@ } ], "buildPresets": [ + { + "name": "windows-vs-22", + "configurePreset": "windows-vs-22" + }, { "name": "linux-debug", "configurePreset": "linux-debug" diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 96a05a97..c6dcc138 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -1044,13 +1044,6 @@ SSL_WrapperPacket* SSLWorld::generatePacket(int cam_id) { field->set_goal_depth(CONVUNIT(cfg->Goal_Depth())); field->set_goal_substitution_area_width(CONVUNIT(cfg->Field_Goal_Substitution_Area_Width())); - field->set_penalty_area_depth(CONVUNIT(cfg->Field_Penalty_Depth())); - field->set_penalty_area_width(CONVUNIT(cfg->Field_Penalty_Width())); - field->set_center_circle_radius(CONVUNIT(cfg->Field_Rad())); - field->set_line_thickness(CONVUNIT(cfg->Field_Line_Width())); - field->set_goal_center_to_penalty_mark(CONVUNIT(cfg->Field_Penalty_Point())); - field->set_ball_radius(CONVUNIT(cfg->BallRadius())); - // Field lines and arcs addFieldLinesArcs(field); diff --git a/vcpkg.json b/vcpkg.json index 01d464f2..755c8e88 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,7 +3,7 @@ "qt5-base", "ode", "protobuf", - "opengl", - "vartypes" + "opengl", + "vartypes" ] } From dd31de33397e1fa5c2fb380e5c6bc11a06f36786 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Sat, 11 Apr 2026 16:57:51 +0200 Subject: [PATCH 34/35] chore: enable release on version tags and sync vcpkg CI --- .github/workflows/build.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 62eb2af5..9d781fb9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,6 +8,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: write + jobs: build-linux: runs-on: ubuntu-latest @@ -20,8 +23,6 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -29,7 +30,7 @@ jobs: buildPreset: "linux-release" packagePreset: "linux-release" - name: Release - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/v') with: draft: true @@ -51,8 +52,6 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -60,7 +59,7 @@ jobs: buildPreset: "macos-release" packagePreset: "macos-release" - name: Release - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/v') with: draft: true @@ -75,8 +74,6 @@ jobs: - uses: lukka/get-cmake@latest - name: Install dependencies # saves / restores cache to avoid rebuilding dependencies uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b - name: Run CMake and run vcpkg to build packages uses: lukka/run-cmake@v10 with: @@ -84,7 +81,7 @@ jobs: buildPreset: "windows-release" packagePreset: "windows-release" - name: Release - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/v') with: draft: true From d1f93d3b5c91a9099e3ae7cf38d66b5abfe7d265 Mon Sep 17 00:00:00 2001 From: Ali Salehi Date: Sat, 11 Apr 2026 17:00:02 +0200 Subject: [PATCH 35/35] fix: add vcpkg baseline for CI manifest mode --- vcpkg.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcpkg.json b/vcpkg.json index 755c8e88..cbd41595 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,4 +1,7 @@ { + "name": "grsim", + "version": "1.0.0", + "builtin-baseline": "ce613c41372b23b1f51333815feb3edd87ef8a8b", "dependencies": [ "qt5-base", "ode",