Skip to content

Commit

Permalink
Update ball got shot limit (ugly fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
JornJorn committed Nov 20, 2023
1 parent 28587dd commit 6d24920
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ constexpr uint8_t MAX_ROBOT_COUNT = 11; /**< Maximum allowed number of robots */
/// Ball constants
constexpr double BALL_STILL_VEL = 0.1; /**< Velocity of the ball at which it is considered still */
constexpr double BALL_STILL_VEL2 = BALL_STILL_VEL * BALL_STILL_VEL; /**< Squared velocity of the ball at which it is considered still */
constexpr double BALL_GOT_SHOT_LIMIT = 1.3; /**< Velocity of the ball at which it is considered shot */
constexpr double BALL_GOT_SHOT_LIMIT = 0.6; /**< Velocity of the ball at which it is considered shot */
constexpr double BALL_IS_MOVING_SLOW_LIMIT = 1; /**< Velocity of the ball at which it is considered moving slow */
constexpr double BALL_IS_CLOSE = 0.5; /**< Distance from the ball to a robot at which the ball is considered close */
constexpr double BALL_RADIUS = 0.0215; /**< Radius of the ball */
Expand Down
5 changes: 2 additions & 3 deletions roboteam_ai/src/stp/tactics/active/KickAtPos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ bool KickAtPos::isEndTactic() noexcept {
}

bool KickAtPos::isTacticFailing(const StpInfo &info) noexcept {
// Fail tactic if there is no shootTarget or we don't have the ball during Rotate
if (!info.getPositionToShootAt()) return true;
if (skills.current_num() == 0 && !info.getRobot()->get()->hasBall()) return true;
// Fail tactic if there is no shootTarget or we don't have the ball
if (!info.getPositionToShootAt() || !info.getRobot()->get()->hasBall()) return true;
return false;
}

Expand Down
5 changes: 2 additions & 3 deletions roboteam_ai/src/stp/tactics/active/OrbitKick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ bool OrbitKick::isEndTactic() noexcept {
}

bool OrbitKick::isTacticFailing(const StpInfo &info) noexcept {
// Fail tactic if there is no shootTarget or we don't have the ball during Rotate
if (!info.getPositionToShootAt()) return true;
if (skills.current_num() == 0 && !info.getRobot()->get()->hasBall()) return true;
// Fail tactic if there is no shootTarget or we don't have the ball
if (!info.getPositionToShootAt() || !info.getRobot()->get()->hasBall()) return true;
return false;
}

Expand Down

0 comments on commit 6d24920

Please sign in to comment.