Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 15, 2025

Problem

Maximum kick power values were hardcoded in tactic files, making parameter tuning difficult and requiring code changes for adjustments. The issue affected both Python and C++ tactic implementations:

  • Python Kick tactic had MAX_KICK_POWER = 6.0 and TAPPING_KICK_POWER = 2.0
  • C++ ControlBall had max_shoot_speed_ = 5.5 and max_pass_speed_ = 4.0

Solution

This PR moves all kick power parameters to the centralized configuration system in consai_description, allowing easy tuning without code modifications.

Changes Made

1. Configuration Layer (consai_description)

  • Added kick_power section to strategy/normal.yaml with parameters:
    • max_kick_power: 6.0 - Maximum kick force (must not exceed 6.5 m/s)
    • max_shoot_speed: 5.5 - Maximum shooting velocity
    • max_pass_speed: 4.0 - Maximum passing velocity
    • min_pass_speed: 2.0 - Minimum passing velocity
    • tapping_kick_power: 2.0 - Power for dribbling taps

2. World Model Integration

  • Extended GameConfigModel with kick power fields
  • Updated world_model_provider_node to parse kick power from strategy parameters and populate game_config

3. Python Tactic Updates

  • Removed hardcoded constants from Kick class
  • Modified pass_power() method to accept world_model parameter
  • Updated kick logic to use world_model.game_config values

4. C++ Tactic Updates

  • Added set_kick_power_params() method to ControlBall class
  • Added strategy parameter subscription to controller component
  • Connected parameter loading to update C++ kick power values

Usage

Kick power can now be tuned by editing consai_description/config/strategy/normal.yaml:

kick_power:
  max_kick_power: 6.0      # Adjust maximum kick force
  max_shoot_speed: 5.5     # Tune shooting power
  max_pass_speed: 4.0      # Control passing strength
  min_pass_speed: 2.0      # Set minimum pass power
  tapping_kick_power: 2.0  # Configure dribbling taps

Parameters are automatically loaded through the existing parameter system and made available to all tactics via world_model.game_config.

Fixes #493.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: tilt-silvie <2959645+tilt-silvie@users.noreply.github.com>
Copilot AI changed the title [WIP] 最大キック力をconsai_descriptionで定義したい Move hardcoded kick power values to configurable parameters in consai_description Jun 15, 2025
Copilot AI requested a review from tilt-silvie June 15, 2025 10:11
@ShotaAk
Copy link
Contributor

ShotaAk commented Jun 15, 2025

consai_robot_controller内のkick関連のコードは、今後使わなくなります。
なので、PRから除外してください。

Copy link
Contributor

@ShotaAk ShotaAk left a comment

Choose a reason for hiding this comment

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

consai_robot_controlle内のkick関連のコードは、今後使わなくなります。
なので、consai_robot_controllerに関する変更はPRから除外してください。

@tilt-silvie
Copy link
Contributor

consai_robot_controlle内のkick関連のコードは、今後使わなくなります。
なので、consai_robot_controllerに関する変更はPRから除外してください。

…n tactic changes

Co-authored-by: tilt-silvie <2959645+tilt-silvie@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 15, 2025

consai_robot_controller内のkick関連のコードは、今後使わなくなります。
なので、PRから除外してください。

All consai_robot_controller changes have been removed from the PR per your feedback. The PR now only includes the Python tactic changes and configuration parameters. Commit: b38e702

consai_robot_controlle内のkick関連のコードは、今後使わなくなります。
なので、consai_robot_controllerに関する変更はPRから除外してください。

All consai_robot_controller changes have been removed from the PR per your feedback. The PR now only includes the Python tactic changes and configuration parameters. Commit: b38e702

consai_robot_controlle内のkick関連のコードは、今後使わなくなります。
なので、consai_robot_controllerに関する変更はPRから除外してください。

All consai_robot_controller changes have been removed from the PR per your feedback. The PR now only includes the Python tactic changes and configuration parameters. Commit: b38e702

Comment on lines 15 to 16
max_shoot_speed: 5.5 # シュート時の最大速度 [m/s]
max_pass_speed: 4.0 # パス時の最大速度 [m/s]
Copy link
Contributor

Choose a reason for hiding this comment

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

これら2つは使用されていないので削除してください

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the unused max_shoot_speed and max_pass_speed parameters from the configuration. Commit: b0dd799

max_kick_power: 6.0 # 最大キック力 [m/s] (6.5 m/sを越えてはいけない)
max_shoot_speed: 5.5 # シュート時の最大速度 [m/s]
max_pass_speed: 4.0 # パス時の最大速度 [m/s]
min_pass_speed: 2.0 # パス時の最小速度 [m/s]
Copy link
Contributor

Choose a reason for hiding this comment

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

min_pass_powerに名前を変えてください

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed min_pass_speed to min_pass_power in the configuration and updated all references in the code. Commit: b0dd799

Comment on lines 15 to 17
max_shoot_speed: 5.5 # シュート時の最大速度 [m/s]
max_pass_speed: 4.0 # パス時の最大速度 [m/s]
min_pass_speed: 2.0 # パス時の最小速度 [m/s]
Copy link
Contributor

Choose a reason for hiding this comment

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

max_shoot_speedとmax_pass_speedは使われていないので削除してください。

min_pass_speedはmin_pass_powerに名前を変えてください

Copy link
Contributor

Choose a reason for hiding this comment

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

・max_shoot_speedとmax_pass_speedは使われていないので削除してください。

・min_pass_speedはmin_pass_powerに名前を変えてください

・lintで弾かれています。CIのbuild_and_lint ジョブが成功するように修正してください。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All requested changes completed: removed unused max_shoot_speed and max_pass_speed parameters, renamed min_pass_speed to min_pass_power, and fixed all linting issues. Commit: b0dd799

@tilt-silvie
Copy link
Contributor

consai_description/config/strategy/normal.yaml について
・max_shoot_speedとmax_pass_speedは使われていないので削除してください。
・min_pass_speedはmin_pass_powerに名前を変えてください

また、全体について
・lintで弾かれています。CIのbuild_and_lint ジョブが成功するように修正してください。

…pass_power

Co-authored-by: tilt-silvie <2959645+tilt-silvie@users.noreply.github.com>
Co-authored-by: tilt-silvie <2959645+tilt-silvie@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 15, 2025

consai_description/config/strategy/normal.yaml について
・max_shoot_speedとmax_pass_speedは使われていないので削除してください。
・min_pass_speedはmin_pass_powerに名前...

All requested changes completed: removed unused max_shoot_speed and max_pass_speed parameters, renamed min_pass_speed to min_pass_power, and fixed all linting issues (trailing spaces in YAML file). Commit: 122dc63

Copy link
Contributor

@ShotaAk ShotaAk left a comment

Choose a reason for hiding this comment

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

LGTM

@ShotaAk ShotaAk marked this pull request as ready for review June 15, 2025 12:50
@ShotaAk ShotaAk merged commit 9955f28 into main Jun 15, 2025
13 checks passed
@ShotaAk ShotaAk deleted the copilot/fix-493 branch June 15, 2025 12:50
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.

最大キック力をconsai_descriptionで定義したい

3 participants