Skip to content

Enhance ball friction handling and update macOS CI/CD configuration#193

Open
mahi97 wants to merge 12 commits intoRoboCup-SSL:masterfrom
mahi97:master
Open

Enhance ball friction handling and update macOS CI/CD configuration#193
mahi97 wants to merge 12 commits intoRoboCup-SSL:masterfrom
mahi97:master

Conversation

@mahi97
Copy link
Copy Markdown
Member

@mahi97 mahi97 commented Apr 9, 2026

This pull request introduces several improvements to the build system and simulation physics, focusing on modernizing CMake requirements, updating macOS build support, and refining ball-ground interaction. The most significant changes are grouped below.

Build System Modernization and Compatibility:

  • Raised the minimum required CMake version to 3.10 in both the top-level CMakeLists.txt and clients/qt/CMakeLists.txt to ensure compatibility with newer CMake features. [1] [2]
  • Updated the macOS build matrix in .github/workflows/build.yaml to target macOS 14 and 15, and removed legacy macOS 13 build steps for a cleaner, more maintainable workflow.
  • Added -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to external project CMake arguments for VarTypes, ODE, and protobuf to improve compatibility and suppress policy warnings. [1] [2] [3]
  • Disabled building ODE demos and tests by setting -DODE_WITH_DEMOS=OFF and -DODE_WITH_TESTS=OFF to avoid build failures on macOS 15+.

Simulation Physics Improvements:

  • Refined the ball-ground interaction logic in SSLWorld:
    • Introduced a new method ballGroundThreshold() to consistently determine when the ball is considered "on the ground". [1] [2]
    • Updated the ball friction and force application to act only when the ball is on the ground and only in the XY plane, improving the realism of ball movement.
    • Ensured that ball replacement and reset actions use the new ground threshold for vertical positioning.

mahi97 and others added 12 commits April 10, 2026 03:36
Enhance robot management and configuration features
Fixes two bugs:
- Mismatch 9: Ground friction was applied in all 3 axes (including Z),
  but ground friction should only act in the XY plane.
- Mismatch 10: Ground friction was applied unconditionally even when
  the ball was airborne. Now checks ball Z position against ground level
  before applying friction.

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/bd648558-4597-4716-8949-9375cb72d37e

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replaces duplicated cfg->BallRadius() * 1.2 in the friction ground
check and ball replacement positioning with a single named constant
defined at the top of SSLWorld::step().

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/45d9654e-0950-4e11-a136-cc2003d2c4cb

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… macos-13 runner

- clients/qt/CMakeLists.txt: VERSION 2.8 → 3.10 (CMake 4.x removed < 3.5 compat)
- CMakeLists.txt: VERSION 3.5 → 3.10 (pre-empt upcoming removal of < 3.10 compat)
- build.yaml: replace deprecated macos-13 with macos-15, clean up Homebrew paths

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/63b6bfd3-c1e9-4877-b17a-5491aba569f2

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Move the duplicated `cfg->BallRadius() * 1.2` threshold into a single
private `SSLWorld::ballGroundThreshold()` const method, used by both
step() and recvActions().

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/ed027e95-34cf-4b51-a993-74ad8ed20436

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ake 4.x compat

Protobuf 3.6.1, ODE, and vartypes have old cmake_minimum_required that
CMake 4.x (on macOS runners) rejects. Pass CMAKE_POLICY_VERSION_MINIMUM=3.5
to allow these external projects to configure successfully.

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/838d00c6-d230-4382-801b-9e2b0aa8ae78

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Fix ball ground friction: skip when airborne, restrict to XY plane
ODE 0.16.4 demo_cylvssphere.cpp has double-to-float narrowing conversions
that fail with the stricter Clang on macOS 15. Since we only need the ODE
library (not demos or tests), disable them with ODE_WITH_DEMOS=OFF and
ODE_WITH_TESTS=OFF.

Agent-Logs-Url: https://github.com/mahi97/grSim/sessions/c1d5edc7-457e-40ea-a2f3-8cf678736c23

Co-authored-by: mahi97 <7570279+mahi97@users.noreply.github.com>
Fix macOS CI: update cmake_minimum_required for CMake 4.x, replace deprecated macos-13 runner
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the build/CI configuration (notably for newer macOS runners) and refines ball–ground interaction in the simulator by applying ground friction only when the ball is considered on the ground and only in the XY plane.

Changes:

  • Introduce a centralized SSLWorld::ballGroundThreshold() and use it for ball “on ground” detection and replacement Z positioning.
  • Update ground friction application to only affect XY motion when the ball is on the ground.
  • Modernize build configuration: raise CMake minimum versions, adjust external-project CMake args/policies, disable ODE demos/tests, and update macOS CI matrix/env.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/sslworld.cpp Adds ground-threshold helper; updates friction application logic and ball replacement Z positioning.
include/sslworld.h Declares the new ballGroundThreshold() helper.
CMakeLists.txt Raises minimum CMake version and tweaks external VarTypes CMake args.
cmake/modules/BuildProtobuf.cmake Passes additional CMake policy argument to the protobuf external build.
cmake/modules/BuildODE.cmake Passes policy arg and disables ODE demos/tests for macOS compatibility.
clients/qt/CMakeLists.txt Raises minimum CMake version for the Qt client build.
.github/workflows/build.yaml Updates macOS build matrix and environment variables for Qt5 discovery on Homebrew ARM paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +446 to +449
dReal ballx, bally, ballz;
ball->getBodyPosition(ballx, bally, ballz);
(void)ballx;
(void)bally;
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ball->getBodyPosition(ballx, bally, ballz); is only used to read ballz, and the (void)ballx/(void)bally casts are just to silence unused-variable warnings. Consider reading Z directly (e.g., via dBodyGetPosition(ball->body)[2]) or adding a helper that returns only Z to avoid the extra locals and casts.

Suggested change
dReal ballx, bally, ballz;
ball->getBodyPosition(ballx, bally, ballz);
(void)ballx;
(void)bally;
const dReal ballz = dBodyGetPosition(ball->body)[2];

Copilot uses AI. Check for mistakes.
# demos are not needed and fail to compile on macOS 15+ due to narrowing errors
-DODE_WITH_DEMOS=OFF
-DODE_WITH_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-DCMAKE_INSTALL_PREFIX is passed twice in this ExternalProject_Add call (once as -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> and again here). Dropping the duplicate avoids ambiguity and makes it clearer which value/type is intended.

Suggested change
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants