Skip to content

Commit

Permalink
automated style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kfu02 authored Jan 10, 2024
1 parent d72c88b commit 2cbf998
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions soccer/src/soccer/strategy/agent/position/offense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ std::optional<RobotIntent> Offense::state_to_task(RobotIntent intent) {
intent.motion_command = empty_motion_cmd;
return intent;
} else if (current_state_ == PASSING) {
//TODO: Remove this
// TODO: Remove this
/*
Commented for now, may need for testing later.
*/
//this->target_robot_id = 2;
// this->target_robot_id = 2;
// attempt to pass the ball to the target robot
rj_geometry::Point target_robot_pos =
last_world_state_->get_robot(true, target_robot_id).pose.position();
Expand All @@ -110,12 +110,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
6 changes: 3 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,9 @@ class Offense : public Position {
private:
bool kicking_{true};

const float FINAL_BALL_SPEED {0.0f};
const float BALL_DECEL {-0.4f};
float dist {0.0f};
const float FINAL_BALL_SPEED{0.0f};
const float BALL_DECEL{-0.4f};
float dist{0.0f};

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

0 comments on commit 2cbf998

Please sign in to comment.