Skip to content

Commit

Permalink
Fix Code Style On james-vogt/variable-kick (#2156)
Browse files Browse the repository at this point in the history
automated style fixes

Co-authored-by: Squid5678 <[email protected]>
  • Loading branch information
github-actions[bot] and Squid5678 authored Jan 22, 2024
1 parent 221bf56 commit 30f4eb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 5 additions & 6 deletions soccer/src/soccer/strategy/agent/position/offense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Offense::State Offense::update_state() {
}

std::optional<RobotIntent> Offense::state_to_task(RobotIntent intent) {
float dist {0.0f};
float dist{0.0f};
if (current_state_ == IDLING) {
// Do nothing
auto empty_motion_cmd = planning::MotionCommand{};
Expand All @@ -106,12 +106,11 @@ std::optional<RobotIntent> Offense::state_to_task(RobotIntent intent) {
intent.shoot_mode = RobotIntent::ShootMode::KICK;
// NOTE: Check we can actually use break beams
intent.trigger_mode = RobotIntent::TriggerMode::ON_BREAK_BEAM;
//Adjusts kick speed based on distance. Refer to
//TIGERS Mannheim eTDP from 2019 for details
//See also passer.py in rj_gameplay
// Adjusts kick speed based on distance. Refer to
// TIGERS Mannheim eTDP from 2019 for details
// See also passer.py in rj_gameplay
dist = target_robot_pos.dist_to(this_robot_pos);
intent.kick_speed = std::sqrt((std::pow(FINAL_BALL_SPEED, 2)) -
(2 * BALL_DECEL * dist));
intent.kick_speed = std::sqrt((std::pow(FINAL_BALL_SPEED, 2)) - (2 * BALL_DECEL * dist));
intent.is_active = true;
return intent;
} else if (current_state_ == PREPARING_SHOT) {
Expand Down
5 changes: 2 additions & 3 deletions soccer/src/soccer/strategy/agent/position/offense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ class Offense : public Position {
private:
bool kicking_{true};

static constexpr float FINAL_BALL_SPEED {0.0f};
static constexpr float BALL_DECEL {-0.4f};

static constexpr float FINAL_BALL_SPEED{0.0f};
static constexpr float BALL_DECEL{-0.4f};

std::optional<RobotIntent> derived_get_task(RobotIntent intent) override;
// TODO (Kevin): strategy design pattern for BallHandler/Receiver
Expand Down

0 comments on commit 30f4eb9

Please sign in to comment.