Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sanatd33 committed Feb 17, 2025
1 parent 89483b5 commit 2592815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions soccer/src/soccer/planning/planner/collect_path_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ Trajectory CollectPathPlanner::plan(const PlanRequest& plan_request) {
// List of obstacles
ShapeSet static_obstacles;
std::vector<DynamicObstacle> dynamic_obstacles;

// If we are intercepting, do add the ball as an obstacle
if (current_state_ == INTERCEPT) {
fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, true);
} else {
Trajectory ball;
fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, false, &ball);
}
fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, false);

// Return an empty trajectory if the ball is hitting static obstacles
// or it is in the goalie area.
Expand Down Expand Up @@ -163,8 +156,6 @@ void CollectPathPlanner::process_state_transition(const PlanRequest& request, Ba

// Do the transitions
double dist = (start_instant->position() - ball.position).mag() - kRobotMouthRadius;
double speed_diff = (start_instant->linear_velocity() - average_ball_vel_).mag() -
collect::PARAM_touch_delta_speed;

// If we are in range to the slow dist
if (dist < collect::PARAM_approach_dist_target + kRobotMouthRadius &&
Expand Down Expand Up @@ -195,7 +186,7 @@ void CollectPathPlanner::process_state_transition(const PlanRequest& request, Ba
// Within X seconds of the end of path
bool inline_with_ball = bot_dist_to_ball_movement_line < kRobotMouthRadius / 2;
bool in_front_of_ball =
average_ball_vel_.angle_between(start_instant->position() - ball.position) < 3.14 / 2;
average_ball_vel_.angle_between(start_instant->position() - ball.position) < M_PI / 2;

if (in_front_of_ball && inline_with_ball && current_state_ == INTERCEPT) {
// Start the next section of the path from the end of our current
Expand Down
6 changes: 3 additions & 3 deletions soccer/src/soccer/planning/planner/collect_path_planner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ class CollectPathPlanner : public PathPlanner {
bool is_ball_sense_ = false;

// Threshold for switching from dampen to fine approach
double kDampenBallSpeedThreshold = 0.75;
static constexpr double kDampenBallSpeedThreshold{0.75};

// Threshold for ball velocity to try to intercept;
double kInterceptVelocityThreshold = 0.2;
static constexpr double kInterceptVelocityThreshold{0.2};

// Threshold for chasing after the ball instead of intercepting (deg)
double kChaseAngleThreshold = 45;
static constexpr double kChaseAngleThreshold{45};
};

} // namespace planning

0 comments on commit 2592815

Please sign in to comment.