Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update start goal planner v0.10.1 #846

Merged
merged 26 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
597515e
refactor(goal_planner): refactor isAllowedGoalModification (#4856)
kosuke55 Sep 4, 2023
f30699d
fix(behavior_path_planner): fix checkOriginalGoalIsInShoulder (#4878)
kosuke55 Sep 4, 2023
ff976ba
fix(start_planner): start pose candidates (#4880)
kosuke55 Sep 5, 2023
78879eb
fix(goal_planner): fix goal search for narrow shoulder lane (#4816)
kosuke55 Sep 5, 2023
b255711
fix(route_handler): fix getter for pose (#4884)
kosuke55 Sep 5, 2023
9b02b5d
fix(behavior_path_planner): save original route goal pose (#4876)
kosuke55 Sep 5, 2023
ff2b0a5
feat(goal_planner): set ignore_distance_from_lane_start 0.0 (#4889)
kosuke55 Sep 5, 2023
7690628
refactor(start/goal_planner): minor refactor like const and reference…
kosuke55 Sep 5, 2023
8ad2bfa
refactor(start/goal_planner): use combineLanelets (#4894)
kosuke55 Sep 5, 2023
d65d8ee
feat(goal_planner): do not use minimum_request_length for fixed goal …
kosuke55 Sep 5, 2023
d4d1caa
fix(start_planner): fix start pose candidats when the ego is close to…
kosuke55 Sep 5, 2023
7d3a6a3
feat(start_planner): run start planner even if ego is out of lane (#4…
kosuke55 Sep 5, 2023
9b64aa0
fix(behavior_path_planner): fix functions related to pull over lanes …
kosuke55 Sep 6, 2023
275b997
fix(start_planner): fix drivable area without shoulder lanes (#4909)
kosuke55 Sep 7, 2023
5614761
fix(start_planner): prevent approval when stop path (#4932)
kosuke55 Sep 10, 2023
726fd7f
fix(start_planner): crop backward path to start from narrow space (#4…
kosuke55 Sep 12, 2023
bd16bba
refactor(start_planner): refactor drivable lanes (#4951)
kosuke55 Sep 12, 2023
f373778
fix(start_planner): fix path update (#4931)
kosuke55 Sep 12, 2023
8a379bb
fix(start/goal_planner): fix inverse order path points (#4950)
kosuke55 Sep 12, 2023
bb89430
fix(start_planner): keep max back distace whithin lanes (#4962)
kosuke55 Sep 12, 2023
d982b3a
refactor(goal_planner): remove unused variables (#4966)
kosuke55 Sep 12, 2023
8f4ab70
fix(goal_planner): fix occpancy grid initializing check (#4969)
kosuke55 Sep 12, 2023
940cdfc
fix
kosuke55 Sep 16, 2023
08dd7a1
feat(goal_planner): use only static objects in pull over lanes to pat…
kosuke55 Sep 12, 2023
314b95b
feat(goal_planner): add options of occupancy grid map to use only for…
kosuke55 Sep 14, 2023
586bd26
style(pre-commit): autofix
pre-commit-ci[bot] Sep 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
ros__parameters:
goal_planner:
# general params
minimum_request_length: 100.0
th_arrived_distance: 1.0
th_stopped_velocity: 0.01
th_stopped_time: 2.0 # It must be greater than the state_machine's.
Expand All @@ -17,25 +16,28 @@
longitudinal_margin: 3.0
max_lateral_offset: 0.5
lateral_offset_interval: 0.25
ignore_distance_from_lane_start: 15.0
ignore_distance_from_lane_start: 0.0
margin_from_boundary: 0.5

# occupancy grid map
occupancy_grid:
use_occupancy_grid: true
use_occupancy_grid_for_longitudinal_margin: false
use_occupancy_grid_for_goal_search: true
use_occupancy_grid_for_goal_longitudinal_margin: false
use_occupancy_grid_for_path_collision_check: false
occupancy_grid_collision_check_margin: 0.0
theta_size: 360
obstacle_threshold: 60

# object recognition
object_recognition:
use_object_recognition: true
use_object_recognition: false
object_recognition_collision_check_margin: 0.6 # this should be larger than `surround_check_distance` of surround_obstacle_checker
object_recognition_collision_check_max_extra_stopping_margin: 1.0
th_moving_object_velocity: 1.0

# pull over
pull_over:
minimum_request_length: 100.0
pull_over_velocity: 3.0
pull_over_minimum_velocity: 1.38
decide_path_distance: 10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ Either one is activated when all conditions are met.

### fixed_goal_planner

- The distance between the goal and ego-vehicle is shorter than `minimum_request_length`.
- Route is set with `allow_goal_modification=false` by default.
- ego-vehicle is in the same lane as the goal.

<img src="https://user-images.githubusercontent.com/39142679/237929955-c0adf01b-9e3c-45e3-848d-98cf11e52b65.png" width="600">

### rough_goal_planner

#### pull over on road lane

- The distance between the goal and ego-vehicle is shorter than `minimum_request_length`.
- The distance between the goal and ego-vehicle is shorter than `pull_over_minimum_request_length`.
- Route is set with `allow_goal_modification=true` .
- We can set this option with [SetRoute](https://github.com/autowarefoundation/autoware_adapi_msgs/blob/main/autoware_adapi_v1_msgs/routing/srv/SetRoute.srv#L2) api service.
- We support `2D Rough Goal Pose` with the key bind `r` in RViz, but in the future there will be a panel of tools to manipulate various Route API from RViz.
Expand All @@ -105,7 +105,7 @@ Either one is activated when all conditions are met.

#### pull over on shoulder lane

- The distance between the goal and ego-vehicle is shorter than `minimum_request_length`.
- The distance between the goal and ego-vehicle is shorter than `pull_over_minimum_request_length`.
- Goal is set in the `road_shoulder`.

<img src="https://user-images.githubusercontent.com/39142679/237929941-2ce26ea5-c84d-4d17-8cdc-103f5246db90.png" width="600">
Expand All @@ -118,17 +118,11 @@ Either one is activated when all conditions are met.

## General parameters for goal_planner

| Name | Unit | Type | Description | Default value |
| :------------------------- | :----- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| minimum_request_length | [m] | double | when the ego-vehicle approaches the goal by this distance or a safe distance to stop, the module is activated. | 100.0 |
| th_arrived_distance | [m] | double | distance threshold for arrival of path termination | 1.0 |
| th_stopped_velocity | [m/s] | double | velocity threshold for arrival of path termination | 0.01 |
| th_stopped_time | [s] | double | time threshold for arrival of path termination | 2.0 |
| pull_over_velocity | [m/s] | double | decelerate to this speed by the goal search area | 3.0 |
| pull_over_minimum_velocity | [m/s] | double | speed of pull_over after stopping once. this prevents excessive acceleration. | 1.38 |
| margin_from_boundary | [m] | double | distance margin from edge of the shoulder lane | 0.5 |
| decide_path_distance | [m] | double | decide path if it approaches this distance relative to the parking position. after that, no path planning and goal search are performed | 10.0 |
| maximum_deceleration | [m/s2] | double | maximum deceleration. it prevents sudden deceleration when a parking path cannot be found suddenly | 1.0 |
| Name | Unit | Type | Description | Default value |
| :------------------ | :---- | :----- | :------------------------------------------------- | :------------ |
| th_arrived_distance | [m] | double | distance threshold for arrival of path termination | 1.0 |
| th_stopped_velocity | [m/s] | double | velocity threshold for arrival of path termination | 0.01 |
| th_stopped_time | [s] | double | time threshold for arrival of path termination | 2.0 |

## **collision check**

Expand All @@ -138,13 +132,14 @@ Generate footprints from ego-vehicle path points and determine obstacle collisio

#### Parameters for occupancy grid based collision check

| Name | Unit | Type | Description | Default value |
| :----------------------------------------- | :--- | :----- | :-------------------------------------------------------------------------------------------------------------- | :------------ |
| use_occupancy_grid | [-] | bool | flag whether to use occupancy grid for collision check | true |
| use_occupancy_grid_for_longitudinal_margin | [-] | bool | flag whether to use occupancy grid for keeping longitudinal margin | false |
| occupancy_grid_collision_check_margin | [m] | double | margin to calculate ego-vehicle cells from footprint. | 0.0 |
| theta_size | [-] | int | size of theta angle to be considered. angular resolution for collision check will be 2$\pi$ / theta_size [rad]. | 360 |
| obstacle_threshold | [-] | int | threshold of cell values to be considered as obstacles | 60 |
| Name | Unit | Type | Description | Default value |
| :---------------------------------------------- | :--- | :----- | :-------------------------------------------------------------------------------------------------------------- | :------------ |
| use_occupancy_grid_for_goal_search | [-] | bool | flag whether to use occupancy grid for goal search collision check | true |
| use_occupancy_grid_for_goal_longitudinal_margin | [-] | bool | flag whether to use occupancy grid for keeping longitudinal margin | false |
| use_occupancy_grid_for_path_collision_check | [-] | bool | flag whether to use occupancy grid for collision check | false |
| occupancy_grid_collision_check_margin | [m] | double | margin to calculate ego-vehicle cells from footprint. | 0.0 |
| theta_size | [-] | int | size of theta angle to be considered. angular resolution for collision check will be 2$\pi$ / theta_size [rad]. | 360 |
| obstacle_threshold | [-] | int | threshold of cell values to be considered as obstacles | 60 |

### **object recognition based collision check**

Expand Down Expand Up @@ -174,12 +169,22 @@ searched for in certain range of the shoulder lane.
| longitudinal_margin | [m] | double | margin between ego-vehicle at the goal position and obstacles | 3.0 |
| max_lateral_offset | [m] | double | maximum offset of goal search in the lateral direction | 0.5 |
| lateral_offset_interval | [m] | double | distance interval of goal search in the lateral direction | 0.25 |
| ignore_distance_from_lane_start | [m] | double | distance from start of pull over lanes for ignoring goal candidates | 15.0 |
| ignore_distance_from_lane_start | [m] | double | distance from start of pull over lanes for ignoring goal candidates | 0.0 |
| ignore_distance_from_lane_start | [m] | double | distance from start of pull over lanes for ignoring goal candidates | 0.0 |
| margin_from_boundary | [m] | double | distance margin from edge of the shoulder lane | 0.5 |

## **Path Generation**
## **Pull Over**

There are three path generation methods.
The path is generated with a certain margin (default: `0.5 m`) from left boundary of shoulder lane.
The path is generated with a certain margin (default: `0.5 m`) from the boundary of shoulder lane.

| Name | Unit | Type | Description | Default value |
| :------------------------------- | :----- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| pull_over_minimum_request_length | [m] | double | when the ego-vehicle approaches the goal by this distance or a safe distance to stop, pull over is activated. | 100.0 |
| pull_over_velocity | [m/s] | double | decelerate to this speed by the goal search area | 3.0 |
| pull_over_minimum_velocity | [m/s] | double | speed of pull_over after stopping once. this prevents excessive acceleration. | 1.38 |
| decide_path_distance | [m] | double | decide path if it approaches this distance relative to the parking position. after that, no path planning and goal search are performed | 10.0 |
| maximum_deceleration | [m/s2] | double | maximum deceleration. it prevents sudden deceleration when a parking path cannot be found suddenly | 1.0 |

### **shift parking**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class GoalPlannerModuleManager : public SceneModuleManagerInterface
std::shared_ptr<GoalPlannerParameters> parameters_;

std::vector<std::shared_ptr<GoalPlannerModule>> registered_modules_;
bool left_side_parking_;
};

} // namespace behavior_path_planner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ struct PullOutStatus
PathWithLaneId backward_path{};
lanelet::ConstLanelets pull_out_lanes{};
bool is_safe{false};
bool back_finished{false};
bool back_finished{false}; // if backward driving is not required, this is also set to true
// todo: rename to clear variable name.
Pose pull_out_start_pose{};

PullOutStatus() {}
Expand Down Expand Up @@ -122,7 +123,8 @@ class StartPlannerModule : public SceneModuleInterface
std::mutex mutex_;

PathWithLaneId getFullPath() const;
std::vector<Pose> searchPullOutStartPoses();
PathWithLaneId calcStartPoseCandidatesBackwardPath() const;
std::vector<Pose> searchPullOutStartPoses(const PathWithLaneId & start_pose_candidates) const;

std::shared_ptr<LaneDepartureChecker> lane_departure_checker_;

Expand All @@ -132,8 +134,8 @@ class StartPlannerModule : public SceneModuleInterface
void incrementPathIndex();
PathWithLaneId getCurrentPath() const;
void planWithPriority(
const std::vector<Pose> & start_pose_candidates, const Pose & goal_pose,
const std::string search_priority);
const std::vector<Pose> & start_pose_candidates, const Pose & refined_start_pose,
const Pose & goal_pose, const std::string search_priority);
PathWithLaneId generateStopPath() const;
lanelet::ConstLanelets getPathRoadLanes(const PathWithLaneId & path) const;
std::vector<DrivableLanes> generateDrivableLanes(const PathWithLaneId & path) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ enum class ParkingPolicy {
struct GoalPlannerParameters
{
// general params
double minimum_request_length;
double th_arrived_distance;
double th_stopped_velocity;
double th_stopped_time;
Expand All @@ -59,8 +58,9 @@ struct GoalPlannerParameters
double margin_from_boundary;

// occupancy grid map
bool use_occupancy_grid;
bool use_occupancy_grid_for_longitudinal_margin;
bool use_occupancy_grid_for_goal_search;
bool use_occupancy_grid_for_goal_longitudinal_margin;
bool use_occupancy_grid_for_path_collision_check;
double occupancy_grid_collision_check_margin;
int theta_size;
int obstacle_threshold;
Expand All @@ -69,8 +69,10 @@ struct GoalPlannerParameters
bool use_object_recognition;
double object_recognition_collision_check_margin;
double object_recognition_collision_check_max_extra_stopping_margin;
double th_moving_object_velocity;

// pull over general params
double pull_over_minimum_request_length;
double pull_over_velocity;
double pull_over_minimum_velocity;
double decide_path_distance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ using visualization_msgs::msg::MarkerArray;

// TODO(sugahara) move to util
PathWithLaneId combineReferencePath(const PathWithLaneId & path1, const PathWithLaneId & path2);
lanelet::ConstLanelets getPullOverLanes(const RouteHandler & route_handler, const bool left_side);
lanelet::ConstLanelets getPullOverLanes(
const RouteHandler & route_handler, const bool left_side, const double backward_distance,
const double forward_distance);
PredictedObjects filterObjectsByLateralDistance(
const Pose & ego_pose, const double vehicle_width, const PredictedObjects & objects,
const double distance_thresh, const bool filter_inside);

bool isAllowedGoalModification(
const std::shared_ptr<RouteHandler> & route_handler, const bool left_side_parking);
bool checkOriginalGoalIsInShoulder(
const std::shared_ptr<RouteHandler> & route_handler, const bool left_side_parking);
bool isAllowedGoalModification(const std::shared_ptr<RouteHandler> & route_handler);
bool checkOriginalGoalIsInShoulder(const std::shared_ptr<RouteHandler> & route_handler);

// debug
MarkerArray createPullOverAreaMarkerArray(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FreespacePullOut : public PullOutPlannerBase

PlannerType getPlannerType() override { return PlannerType::FREESPACE; }

boost::optional<PullOutPath> plan(Pose start_pose, Pose end_pose) override;
boost::optional<PullOutPath> plan(const Pose & start_pose, const Pose & end_pose) override;

protected:
std::unique_ptr<AbstractPlanningAlgorithm> planner_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GeometricPullOut : public PullOutPlannerBase
explicit GeometricPullOut(rclcpp::Node & node, const StartPlannerParameters & parameters);

PlannerType getPlannerType() override { return PlannerType::GEOMETRIC; };
boost::optional<PullOutPath> plan(Pose start_pose, Pose goal_pose) override;
boost::optional<PullOutPath> plan(const Pose & start_pose, const Pose & goal_pose) override;

GeometricParallelParking planner_;
ParallelParkingParameters parallel_parking_parameters_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PullOutPlannerBase
}

virtual PlannerType getPlannerType() = 0;
virtual boost::optional<PullOutPath> plan(Pose start_pose, Pose goal_pose) = 0;
virtual boost::optional<PullOutPath> plan(const Pose & start_pose, const Pose & goal_pose) = 0;

protected:
std::shared_ptr<const PlannerData> planner_data_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ShiftPullOut : public PullOutPlannerBase
std::shared_ptr<LaneDepartureChecker> & lane_departure_checker);

PlannerType getPlannerType() override { return PlannerType::SHIFT; };
boost::optional<PullOutPath> plan(Pose start_pose, Pose goal_pose) override;
boost::optional<PullOutPath> plan(const Pose & start_pose, const Pose & goal_pose) override;

std::vector<PullOutPath> calcPullOutPaths(
const RouteHandler & route_handler, const lanelet::ConstLanelets & road_lanes,
Expand Down
Loading
Loading