Skip to content

Commit

Permalink
fixed compiler error and targets 7/8 part of goal
Browse files Browse the repository at this point in the history
  • Loading branch information
petergarud authored and sid-parikh committed Feb 1, 2024
1 parent 3748541 commit e87e8e3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 13 additions & 5 deletions soccer/src/soccer/planning/planner/line_kick_path_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DynamicObstacle> 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<Circle>(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);
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions soccer/src/soccer/strategy/agent/position/offense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ std::optional<RobotIntent> 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;
Expand Down

0 comments on commit e87e8e3

Please sign in to comment.