Skip to content

Commit

Permalink
Calculate role info using PositionComputations
Browse files Browse the repository at this point in the history
  • Loading branch information
JornJorn committed Oct 31, 2023
1 parent 28011ed commit 2fe7fd1
Show file tree
Hide file tree
Showing 34 changed files with 519 additions and 1,590 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ constexpr ScoreProfile SafePass = {1, 1, 0.5, 0}; /**< Scoring weight
constexpr ScoreProfile LineOfSight = {0, 1, 0, 0}; /**< Scoring weights for Line of Sight score */
constexpr ScoreProfile Open = {1, 0, 0, 0}; /**< Scoring weights for Open score */
constexpr ScoreProfile GoalShot = {0, 0, 1, 0}; /**< Scoring weights for Goal Shot Score */
constexpr ScoreProfile ChippingPass = {0, 0.0, 0, 1}; /**< Scoring weights for ChippingPass score */
constexpr ScoreProfile ChippingPass = {0, 0, 0, 1}; /**< Scoring weights for ChippingPass score */

/**
* @brief Generalized Keys for passing information form the old play to the new.
Expand Down
26 changes: 0 additions & 26 deletions roboteam_ai/include/roboteam_ai/stp/plays/defensive/DefendPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,6 @@ class DefendPass : public Play {
* @return The name of the play as string
*/
const char* getName() const override;

protected:
/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the keeper
*/
void calculateInfoForKeeper() noexcept;

/**
* @brief Calculates info for the RobotDefenders
*/
void calculateInfoForRobotDefenders() noexcept;

/**
* @brief Calculates info for the offenders
*/
void calculateInfoForOffenders() noexcept;

/**
* @brief Calculates info for the harasser role
*/
void calculateInfoForHarasser() noexcept;
};
} // namespace rtt::ai::stp::play

Expand Down
31 changes: 0 additions & 31 deletions roboteam_ai/include/roboteam_ai/stp/plays/defensive/DefendShot.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,6 @@ class DefendShot : public Play {
* @brief Check if play should end
*/
bool shouldEndPlay() noexcept override;

protected:
/**
* @brief Calculates info for the wallers
*/
void calculateInfoForWallers(bool shouldIncludeBallBlocker) noexcept;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the ballBlocker
*/
void calculateInfoForBlocker() noexcept;

/**
* @brief Calculates info for the harasser
*/
void calculateInfoForHarasser() noexcept;

/**
* @brief Calculates info for the keeper
*/
void calculateInfoForKeeper() noexcept;

/**
* @brief Calculates info for the offenders
*/
void calculateInfoForOffenders() noexcept;
};
} // namespace rtt::ai::stp::play

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@ class KeeperKickBall : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the midfielders
*/
void calculateInfoForMidfielders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Retrieve name of the play
* @return The name of the play as a string
Expand Down
25 changes: 0 additions & 25 deletions roboteam_ai/include/roboteam_ai/stp/plays/offensive/Attack.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,6 @@ class Attack : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the midfielders
*/
void calculateInfoForMidfielders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Calculates info for the pass defenders
*/
void calculateInfoForPassDefenders() noexcept;

/**
* @brief Check if play should end. True when attacker role is finished.
*/
Expand All @@ -67,11 +47,6 @@ class Attack : public Play {
* @return The name of the play as string
*/
const char* getName() const override;

/**
* @brief calculates info for the blocker roll
*/
void calculateInfoForBlocker() noexcept;
};

} // namespace rtt::ai::stp::play
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ class AttackingPass : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Calculates info for the pass defenders
*/
void calculateInfoForPassDefenders() noexcept;

/**
* @brief Retrieves the name of the play
* @return The name of the play as string
Expand All @@ -75,11 +60,6 @@ class AttackingPass : public Play {
bool ballKicked();

PassInfo passInfo; /**< Struct containing info about the pass. Calculated once for each time this play is run */

/**
* @brief Calculate info for the blocker roles
*/
void calculateInfoForBlocker() noexcept;
};
} // namespace rtt::ai::stp::play

Expand Down
25 changes: 0 additions & 25 deletions roboteam_ai/include/roboteam_ai/stp/plays/offensive/ChippingPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ class ChippingPass : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the midfielders
*/
void calculateInfoForMidfielders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Calculates info for the pass defenders
*/
void calculateInfoForPassDefenders() noexcept;

/**
* @brief Gets the name of the play
* @return The name of the play
Expand All @@ -79,11 +59,6 @@ class ChippingPass : public Play {
bool ballKicked();

PassInfo passInfo; /**< Struct containing info about the pass. Calculated once for each time this play is run */

/**
* @brief Calculate info for the blocker roles
*/
void calculateInfoForBlocker() noexcept;
};
} // namespace rtt::ai::stp::play

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,11 @@ class BallPlacementThem : public Play {
*/
void calculateInfoForRoles() noexcept override;

void calculateInfoForKeeper() noexcept;

/**
* @brief Calculates info for the harasser roles
*/
void calculateInfoForHarasser() noexcept;

/**
* @brief Calculates info for the waller roles
*/
void calculateInfoForWallers() noexcept;

/**
* @brief Retrieves the name of the play
* @return The name of the play as string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,10 @@ class FreeKickThem : public Play {
const char *getName() const override;

protected:
/**
* @brief Calculates info for the wallers
*/
void calculateInfoForWallers() noexcept;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the ballBlocker
*/
void calculateInfoForBlocker() noexcept;

/**
* @brief Calculates info for the harasser
*/
void calculateInfoForHarasser() noexcept;

/**
* @brief Calculates info for the keeper
*/
void calculateInfoForKeeper() noexcept;
};
} // namespace rtt::ai::stp::play

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ class FreeKickUsAtGoal : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the midfielders
*/
void calculateInfoForMidfielders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Check if play should end. True when the free kick taker has kicked the ball
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@ class FreeKickUsPass : public Play {
*/
void calculateInfoForRoles() noexcept override;

/**
* @brief Calculates info for the defenders
*/
void calculateInfoForDefenders() noexcept;

/**
* @brief Calculates info for the midfielders
*/
void calculateInfoForMidfielders() noexcept;

/**
* @brief Calculates info for the attackers
*/
void calculateInfoForAttackers() noexcept;

/**
* @brief Retrieves the name of the play
* @return The name of the play as a string
Expand Down
Loading

0 comments on commit 2fe7fd1

Please sign in to comment.