From e87e8e3e50dd0cfad1e8c34ad6e3f2d4dfb29271 Mon Sep 17 00:00:00 2001 From: petergarud Date: Mon, 22 Jan 2024 02:18:10 +0000 Subject: [PATCH] fixed compiler error and targets 7/8 part of goal --- .../planner/line_kick_path_planner.cpp | 18 +++++++++++++----- .../soccer/strategy/agent/position/offense.cpp | 3 +-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/soccer/src/soccer/planning/planner/line_kick_path_planner.cpp b/soccer/src/soccer/planning/planner/line_kick_path_planner.cpp index f12219ffcf4..ad25d67a2ac 100644 --- a/soccer/src/soccer/planning/planner/line_kick_path_planner.cpp +++ b/soccer/src/soccer/planning/planner/line_kick_path_planner.cpp @@ -33,10 +33,18 @@ Trajectory LineKickPathPlanner::plan(const PlanRequest& plan_request) { average_ball_vel_ = apply_low_pass_filter(average_ball_vel_, ball.velocity, 0.8); } - // only process state transition if already started the planning - if (has_created_plan) { - process_state_transition(); - } + // ShapeSet static_obstacles; + // std::vector dynamic_obstacles; + // fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, false, nullptr); + + // auto obstacles_with_ball = static_obstacles; + // const RJ::Time cur_time = start_instant.stamp; + // obstacles_with_ball.add( + // make_shared(ball.predict_at(cur_time).position, ball_avoid_distance)); + + // // only plan line kick if not is_done + // if (!this->is_done()) { + state_transition(ball, plan_request.start); switch (current_state_) { case INITIAL_APPROACH: prev_path_ = initial(plan_request); @@ -46,8 +54,8 @@ Trajectory LineKickPathPlanner::plan(const PlanRequest& plan_request) { break; } prev_path_.stamp(RJ::now()); - has_created_plan = true; return prev_path_; + // } } Trajectory LineKickPathPlanner::initial(const PlanRequest& plan_request) { diff --git a/soccer/src/soccer/strategy/agent/position/offense.cpp b/soccer/src/soccer/strategy/agent/position/offense.cpp index 2d97c3d851c..aa16db35643 100644 --- a/soccer/src/soccer/strategy/agent/position/offense.cpp +++ b/soccer/src/soccer/strategy/agent/position/offense.cpp @@ -140,8 +140,7 @@ std::optional Offense::state_to_task(RobotIntent intent) { return intent; } else if (current_state_ == SHOOTING) { rj_geometry::Point their_goal_pos = field_dimensions_.their_goal_loc(); - rj_geometry::Point scoring_point = - their_goal_pos + field_dimensions_.goal_width() * 3.0 / 8.0; + rj_geometry::Point scoring_point = their_goal_pos + field_dimensions_.goal_width() * 3.0 / 8.0; planning::LinearMotionInstant target{scoring_point}; auto line_kick_cmd = planning::MotionCommand{"line_kick", target}; intent.motion_command = line_kick_cmd;