File tree 1 file changed +21
-0
lines changed
planning/freespace_planning_algorithms/src
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,27 @@ bool AstarSearch::search()
259
259
continue ;
260
260
}
261
261
262
+ geometry_msgs::msg::Pose relative_goal_pose;
263
+ relative_goal_pose.position .x = goal_pose_.position .x - (next_pose.position .x - start_pose_.position .x );
264
+ relative_goal_pose.position .y = goal_pose_.position .y - (next_pose.position .y - start_pose_.position .y );
265
+ relative_goal_pose.orientation = goal_pose_.orientation ;
266
+ const auto relative_goal_index = pose2index (costmap_, relative_goal_pose, planner_common_param_.theta_size );
267
+
268
+ const auto & vertex_indexes_2d = vertex_indexes_table_[relative_goal_index.theta ];
269
+ bool relative_goal_is_out_of_range = false ;
270
+ for (const auto & vertex_index_2d : vertex_indexes_2d) {
271
+ IndexXYT vertex_index{vertex_index_2d.x , vertex_index_2d.y , 0 };
272
+ // must slide to current base position
273
+ vertex_index.x += relative_goal_index.x ;
274
+ vertex_index.y += relative_goal_index.y ;
275
+ if (isOutOfRange (vertex_index)) {
276
+ relative_goal_is_out_of_range = true ;
277
+ }
278
+ }
279
+ if (relative_goal_is_out_of_range) {
280
+ continue ;
281
+ }
282
+
262
283
// Compare cost
263
284
AstarNode * next_node = getNodeRef (next_index);
264
285
if (next_node->status == NodeStatus::None) {
You can’t perform that action at this time.
0 commit comments