Skip to content

Commit

Permalink
added goal obstacles
Browse files Browse the repository at this point in the history
  • Loading branch information
anson authored and anson committed Mar 11, 2024
1 parent 41f8941 commit c32025a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rj_common/include/rj_common/field_dimensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ struct FieldDimensions {
their_left_goal_post_coordinate_ = rj_geometry::Point(-goal_width_ / 2, length_);
their_right_goal_post_coordinate_ = rj_geometry::Point(goal_width_ / 2, length_);

our_goal_area_ = rj_geometry::Rect(our_left_goal_post_coordinate_, our_right_goal_post_coordinate_ + goal_depth_);
their_goal_area_ = rj_geometry::Rect(their_left_goal_post_coordinate_, their_right_goal_post_coordinate_ - goal_depth_);
our_goal_area_ = rj_geometry::Rect(our_left_goal_post_coordinate_, our_right_goal_post_coordinate_ - rj_geometry::Point(0, goal_depth_));
their_goal_area_ = rj_geometry::Rect(their_left_goal_post_coordinate_, their_right_goal_post_coordinate_ + rj_geometry::Point(0, goal_depth_));

our_left_corner_ = rj_geometry::Point(field_x_left_coord_, 0.0);
our_right_corner_ = rj_geometry::Point(field_x_right_coord_, 0.0);
Expand Down
5 changes: 5 additions & 0 deletions soccer/src/soccer/planning/global_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ rj_geometry::ShapeSet GlobalState::create_defense_area_obstacles() {
auto our_goal_area{
std::make_shared<rj_geometry::Rect>(last_field_dimensions_.our_goal_area())};

auto their_goal_area{
std::make_shared<rj_geometry::Rect>(last_field_dimensions_.their_goal_area())};

// auto their_goal_area{
// std::make_shared<rj_geometry::Rect>(last_field_dimensions_.our_goal_area())};

Expand All @@ -107,6 +110,8 @@ rj_geometry::ShapeSet GlobalState::create_defense_area_obstacles() {
def_area_obstacles.add(our_defense_area);
def_area_obstacles.add(our_goal_area);
def_area_obstacles.add(their_defense_area);
def_area_obstacles.add(their_goal_area);


return def_area_obstacles;
}
Expand Down

0 comments on commit c32025a

Please sign in to comment.