Skip to content

Commit

Permalink
revert SelectedPullOverPath
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin committed Dec 2, 2024
1 parent 1f868c8 commit b172a68
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ struct PoseWithString
}
};

struct SelectedPullOverPath
{
PullOverPath path;
rclcpp::Time selected_time;
std::optional<rclcpp::Time> last_path_idx_increment_time;
};

struct PullOverContextData
{
PullOverContextData() = delete;
Expand All @@ -136,8 +129,11 @@ struct PullOverContextData
const bool is_stopped;
const LaneParkingResponse lane_parking_response;
const FreespaceParkingResponse freespace_parking_response;
// TODO(soblin): due to deceleratePath(), this cannot be const member(velocity is modified by it)
std::optional<SelectedPullOverPath> selected_pull_over_path_opt;
// TODO(soblin): due to deceleratePath(), this cannot be const member(velocity is modified by it),
// and bind following three member, rename as "SelectedPullOverPath"
std::optional<PullOverPath> pull_over_path_opt;
std::optional<rclcpp::Time> last_path_update_time;
std::optional<rclcpp::Time> last_path_idx_increment_time;
};

bool isOnModifiedGoal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class LaneParkingRequest
void update(
const PlannerData & planner_data, const ModuleStatus & current_status,
const BehaviorModuleOutput & previous_module_output,
const std::optional<std::pair<PullOverPath, rclcpp::Time>> & selected_pull_over_path,
const PathDecisionState & prev_data);
const std::optional<PullOverPath> & pull_over_path, const PathDecisionState & prev_data);

const GoalPlannerParameters parameters_;
const autoware::universe_utils::LinearRing2d vehicle_footprint_;
Expand All @@ -63,10 +62,7 @@ class LaneParkingRequest
{
return last_previous_module_output_;
}
const std::optional<std::pair<PullOverPath, rclcpp::Time>> & get_selected_pull_over_path() const
{
return selected_pull_over_path_;
}
const std::optional<PullOverPath> & get_pull_over_path() const { return pull_over_path_; }
const PathDecisionState & get_prev_data() const { return prev_data_; }
LaneParkingRequest clone() const;

Expand All @@ -75,8 +71,7 @@ class LaneParkingRequest
ModuleStatus current_status_;
BehaviorModuleOutput previous_module_output_;
BehaviorModuleOutput last_previous_module_output_;
std::optional<std::pair<PullOverPath, rclcpp::Time>>
selected_pull_over_path_; //<! pull over path selected by main thread
std::optional<PullOverPath> pull_over_path_; //<! pull over path selected by main thread
PathDecisionState prev_data_;
};

Expand All @@ -103,8 +98,8 @@ class FreespaceParkingRequest
const ModuleStatus & getCurrentStatus() const { return current_status_; }
void update(
const PlannerData & planner_data, const ModuleStatus & current_status,
const std::optional<std::pair<PullOverPath, rclcpp::Time>> & selected_pull_over_path,
const bool is_stopped);
const std::optional<PullOverPath> & pull_over_path,
const std::optional<rclcpp::Time> & last_path_update_time, const bool is_stopped);

const GoalPlannerParameters parameters_;
const autoware::universe_utils::LinearRing2d vehicle_footprint_;
Expand All @@ -116,9 +111,10 @@ class FreespaceParkingRequest
{
return occupancy_grid_map_;
}
const std::optional<std::pair<PullOverPath, rclcpp::Time>> & get_selected_pull_over_path() const
const std::optional<PullOverPath> & get_pull_over_path() const { return pull_over_path_; }
const std::optional<rclcpp::Time> & get_last_path_update_time() const
{
return selected_pull_over_path_;
return last_path_update_time_;
}
bool is_stopped() const { return is_stopped_; }

Expand All @@ -128,7 +124,8 @@ class FreespaceParkingRequest
std::shared_ptr<PlannerData> planner_data_;
ModuleStatus current_status_;
std::shared_ptr<OccupancyGridBasedCollisionDetector> occupancy_grid_map_;
std::optional<std::pair<PullOverPath, rclcpp::Time>> selected_pull_over_path_;
std::optional<PullOverPath> pull_over_path_;
std::optional<rclcpp::Time> last_path_update_time_;
bool is_stopped_;

void initializeOccupancyGridMap(
Expand Down
Loading

0 comments on commit b172a68

Please sign in to comment.