Skip to content

Commit

Permalink
Changing ball radius dynamically based on velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
rishiso committed Nov 6, 2023
1 parent 9bdb379 commit 54269c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions soccer/src/soccer/planning/planner/plan_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ void fill_obstacles(const PlanRequest& in, rj_geometry::ShapeSet* out_static,
out_static->add(std::make_shared<rj_geometry::Circle>(obs_center, obs_radius));
}

//Adding ball as a static obstacle (because dynamic obstacles are not working)
double ball_vel = in.world_state->ball.velocity.linear().mag();

Check failure on line 69 in soccer/src/soccer/planning/planner/plan_request.cpp

View workflow job for this annotation

GitHub Actions / build-and-test

no member named 'linear' in 'rj_geometry::Point'
out_static->add(std::make_shared<rj_geometry::Circle>(in.world_state->ball.position, kBallRadius * (1.0 + ball_vel) + in.min_dist_from_ball));

// Finally, add the ball as a dynamic obstacle.
// (This is for when the other team is trying to do ball placement, so we
// don't interfere with them.)
Expand Down

0 comments on commit 54269c6

Please sign in to comment.