Conversation
|
@rishiso what's the status of this PR? |
automated style fixes Co-authored-by: rishiso <rishiso@users.noreply.github.com>
|
Blocked thinking about some design issues @Squid5678. Going to try to finish during today's meeting |
8c2646c to
2fdd670
Compare
automated style fixes Co-authored-by: rishiso <rishiso@users.noreply.github.com>
47f5f6b to
3a5d40d
Compare
automated style fixes Co-authored-by: rishiso <rishiso@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements a complete rewrite of the obstacle system to address several architectural issues including deprecated dynamic obstacles, unclear separation between obstacle cores and padding zones, and poor handling of moving obstacles.
Key Changes
- Introduced new
ObstacleandObstacleSetclasses that distinguish between obstacle cores (hard physical collisions) and padding zones (safety margins) - Refactored
StadiumShapeto inherit fromCompositeShapefor better modularity and correct vertex ordering in polygons - Removed deprecated
DynamicObstacle,StaticObstacle, andStadiumObstacleclasses along with global obstacle publishing mechanism - Simplified API by consolidating static and dynamic obstacles into a single
ObstacleSetparameter throughout the planning system
Reviewed changes
Copilot reviewed 39 out of 41 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rj_planning/include/rj_planning/obstacle.hpp | New Obstacle class with separate obstacle core and padding shape, providing hit detection methods for both |
| src/rj_planning/include/rj_planning/obstacle_set.hpp | New ObstacleSet container class with hit detection, conversion utilities, and visualization methods |
| src/rj_planning/include/rj_planning/plan_request.hpp | Updated to remove virtual_obstacles field and add inline helper functions for creating robot and ball obstacles with velocity-based padding |
| src/rj_planning/src/plan_request.cpp | Rewrote fill_obstacles to populate ObstacleSet with moving obstacles using stadium-shaped padding |
| src/rj_planning/src/trajectory_utils.cpp | Removed trajectory_hits_dynamic function, simplified trajectory_hits_static to work with ObstacleSet |
| src/rj_planning/src/primitives/create_path.cpp | Updated rrt and intermediate functions to use single ObstacleSet parameter, removed dynamic obstacle retry logic |
| src/rj_planning/src/primitives/replanner.cpp | Updated to use unified ObstacleSet, removed separate dynamic obstacle collision checking |
| src/rj_planning/src/planners/*.cpp | Updated all planners (collect, settle, escape_obstacles, goalie_idle, path_target) to use ObstacleSet |
| src/rj_planning/src/planner_for_robot.cpp | Removed global obstacles handling, consolidated into single field_obstacles |
| src/rj_planning/src/global_state.cpp | Removed global obstacles subscription and renamed set_static_obstacles to set_field_obstacles |
| src/rj_geometry/src/stadium_shape.cpp | Refactored to use CompositeShape base class and fixed polygon vertex ordering |
| src/rj_geometry/include/rj_geometry/stadium_shape.hpp | Updated to inherit from CompositeShape instead of Shape |
| src/rj_planning/tests/*.cpp | Updated test files to construct obstacles with the new Obstacle wrapper |
| src/rj_planning/CMakeLists.txt | Removed obsolete source files (obstacle.cpp, static_obstacle.cpp, stadium_obstacle.cpp) |
| src/rj_constants/include/rj_constants/topic_names.hpp | Removed deprecated kGlobalObstaclesTopic constant |
| src/rj_common/include/rj_common/context.hpp | Removed global_obstacles field from Context struct |
| install/setup.bash | Generated build artifact that should not be in PR |
| install/setup.zsh | Generated build artifact that should not be in PR |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| unset COLCON_CURRENT_PREFIX | ||
| unset _colcon_prefix_chain_bash_source_script | ||
| unset _colcon_prefix_chain_bash_source_script |
There was a problem hiding this comment.
The install/ directory should not be included in the pull request. According to the .gitignore file, this directory should be excluded from version control. These are generated build artifacts that should not be committed to the repository.
|
|
||
| unset COLCON_CURRENT_PREFIX | ||
| unset _colcon_prefix_chain_zsh_source_script | ||
| unset _colcon_prefix_chain_zsh_source_script |
There was a problem hiding this comment.
The install/ directory should not be included in the pull request. According to the .gitignore file, this directory should be excluded from version control. These are generated build artifacts that should not be committed to the repository.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jvogt23
left a comment
There was a problem hiding this comment.
Looks pretty good, just a few questions/comments
| namespace planning { | ||
|
|
||
| bool trajectory_hits_static(const Trajectory& trajectory, const rj_geometry::ShapeSet& obstacles, | ||
| bool trajectory_hits_static(const Trajectory& trajectory, const ObstacleSet& obstacles, |
There was a problem hiding this comment.
Can this be renamed to trajectory_hits_obstacle or are we still differentiating between obstacle types?
| } | ||
|
|
||
| // Convenience methods: hit() delegates to padding_hit() for compatibility | ||
| virtual bool hit(rj_geometry::Point pt) { return padding_hit(pt); } |
There was a problem hiding this comment.
If we consider the "obstacle" shape to be the obstacle itself and the padding to be an unsafe zone/an area where you are likely to hit the obstacle, would it be better to have hit() delegate to obstacle_hit()?
Or are we considering a "hit" to the obstacle to be a collision with either the obstacle or the unsafe zone?
| protected: | ||
| std::shared_ptr<rj_geometry::Shape> obstacle; | ||
| std::shared_ptr<rj_geometry::Shape> padding; | ||
| std::shared_ptr<rj_geometry::Point> velocity; |
There was a problem hiding this comment.
Is an obstacle that scales by velocity something we plan to implement in a subclass, or are we getting rid of that idea altogether?
If neither of those are the case, I would think we would still need line 25.
| @@ -30,7 +29,6 @@ namespace planning { | |||
| struct PlanRequest { | |||
| PlanRequest(RobotInstant start, MotionCommand command, // NOLINT | |||
There was a problem hiding this comment.
Do we still want PlanRequest to expect a ShapeSet for field_obstacles instead of an ObstacleSet?
EDIT: Is this a ShapeSet for compatibility with ROS messages?
| RJ::Time start_time, | ||
| rj_geometry::Circle* out_hit_obstacle, | ||
| RJ::Time* out_hit_time); | ||
| bool trajectory_hits_static(const Trajectory& trajectory, const ObstacleSet& obstacles, |
There was a problem hiding this comment.
May make sense to rename to "trajectory_hits_obstacle"
Motivation
The previous obstacle system had several issues:
Changes
Did a complete rewrite of the current obstacles system:
Obstacle/ObstacleSetEscapeObstaclesPathPlannerAssociated / Resolved Issue
ClickUp card
Testing
Did some basic testing and nothing seems broken. Going to do thorough testing on shop computer since Docker is lagging with all the drawing and stuff