@@ -551,15 +551,6 @@ bool isNeverAvoidanceTarget(
551
551
const std::shared_ptr<const PlannerData> & planner_data,
552
552
const std::shared_ptr<AvoidanceParameters> & parameters)
553
553
{
554
- const auto & object_pose = object.object .kinematics .initial_pose_with_covariance .pose ;
555
- const auto is_moving_distance_longer_than_threshold =
556
- tier4_autoware_utils::calcDistance2d (object.init_pose , object_pose) >
557
- parameters->distance_threshold_for_ambiguous_vehicle ;
558
- if (is_moving_distance_longer_than_threshold) {
559
- object.reason = AvoidanceDebugFactor::MOVING_OBJECT;
560
- return true ;
561
- }
562
-
563
554
if (object.is_within_intersection ) {
564
555
if (object.behavior == ObjectData::Behavior::NONE) {
565
556
object.reason = " ParallelToEgoLane" ;
@@ -752,6 +743,15 @@ bool isSatisfiedWithVehicleCondition(
752
743
return false ;
753
744
}
754
745
746
+ const auto & current_pose = object.object .kinematics .initial_pose_with_covariance .pose ;
747
+ const auto is_moving_distance_longer_than_threshold =
748
+ calcDistance2d (object.init_pose , current_pose) >
749
+ parameters->distance_threshold_for_ambiguous_vehicle ;
750
+ if (is_moving_distance_longer_than_threshold) {
751
+ object.reason = " AmbiguousStoppedVehicle" ;
752
+ return false ;
753
+ }
754
+
755
755
if (object.is_within_intersection ) {
756
756
if (object.behavior == ObjectData::Behavior::DEVIATING) {
757
757
object.reason = " AmbiguousStoppedVehicle(wait-and-see)" ;
@@ -1384,6 +1384,7 @@ void fillObjectMovingTime(
1384
1384
object_data.last_stop = now;
1385
1385
object_data.move_time = 0.0 ;
1386
1386
if (is_new_object) {
1387
+ object_data.init_pose = object_data.object .kinematics .initial_pose_with_covariance .pose ;
1387
1388
object_data.stop_time = 0.0 ;
1388
1389
object_data.last_move = now;
1389
1390
stopped_objects.push_back (object_data);
@@ -1392,11 +1393,13 @@ void fillObjectMovingTime(
1392
1393
same_id_obj->last_stop = now;
1393
1394
same_id_obj->move_time = 0.0 ;
1394
1395
object_data.stop_time = same_id_obj->stop_time ;
1396
+ object_data.init_pose = same_id_obj->init_pose ;
1395
1397
}
1396
1398
return ;
1397
1399
}
1398
1400
1399
1401
if (is_new_object) {
1402
+ object_data.init_pose = object_data.object .kinematics .initial_pose_with_covariance .pose ;
1400
1403
object_data.move_time = std::numeric_limits<double >::infinity ();
1401
1404
object_data.stop_time = 0.0 ;
1402
1405
object_data.last_move = now;
@@ -1406,6 +1409,7 @@ void fillObjectMovingTime(
1406
1409
object_data.last_stop = same_id_obj->last_stop ;
1407
1410
object_data.move_time = (now - same_id_obj->last_stop ).seconds ();
1408
1411
object_data.stop_time = 0.0 ;
1412
+ object_data.init_pose = object_data.object .kinematics .initial_pose_with_covariance .pose ;
1409
1413
1410
1414
if (object_data.move_time > object_parameter.moving_time_threshold ) {
1411
1415
stopped_objects.erase (same_id_obj);
@@ -1452,22 +1456,6 @@ void fillAvoidanceNecessity(
1452
1456
object_data.avoid_required = check_necessity (parameters->hysteresis_factor_expand_rate );
1453
1457
}
1454
1458
1455
- void fillInitialPose (ObjectData & object_data, ObjectDataArray & detected_objects)
1456
- {
1457
- const auto id = object_data.object .object_id ;
1458
- const auto same_id_obj = std::find_if (
1459
- detected_objects.begin (), detected_objects.end (),
1460
- [&id](const auto & o) { return o.object .object_id == id; });
1461
-
1462
- if (same_id_obj != detected_objects.end ()) {
1463
- object_data.init_pose = same_id_obj->init_pose ;
1464
- return ;
1465
- }
1466
-
1467
- object_data.init_pose = object_data.object .kinematics .initial_pose_with_covariance .pose ;
1468
- detected_objects.push_back (object_data);
1469
- }
1470
-
1471
1459
void fillObjectStoppableJudge (
1472
1460
ObjectData & object_data, const ObjectDataArray & registered_objects,
1473
1461
const double feasible_stop_distance, const std::shared_ptr<AvoidanceParameters> & parameters)
0 commit comments