Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Code Style On james-vogt/variable-kick #2156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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