fix(autoware_multi_object_tracker): tracker update path, shape gating, and association data structure#12560
Conversation
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12560 +/- ##
===========================================
+ Coverage 18.64% 42.30% +23.66%
===========================================
Files 1918 58 -1860
Lines 131362 3477 -127885
Branches 44502 1218 -43284
===========================================
- Hits 24489 1471 -23018
+ Misses 86760 1622 -85138
+ Partials 20113 384 -19729
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… and scoring logic - Introduced `TrackerBevEntry` struct to bundle precomputed data for each tracker, simplifying the `PreparationData` structure. - Updated `calculateBevAssignmentScore` to return a `ScoringResult` struct, encapsulating both score and shape change status. - Refactored `BevAssociation` to utilize the new structures, improving clarity and maintainability. - Enhanced `selectUpdatePath` logic in tracker models to streamline update strategies based on shape change and trust conditions. This refactor aims to improve the organization of data and scoring mechanisms within the multi-object tracking system. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…method - Clarified comments in the `selectUpdatePath` method of `tracker_base.hpp` to enhance understanding of the update path selection logic based on shape change and trust conditions. - Adjusted formatting for better readability and consistency with existing documentation. This change aims to improve code maintainability and facilitate easier onboarding for new developers. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…arity and consistency - Refactored the `selectUpdatePath` method in `multiple_vehicle_tracker.hpp`, `vehicle_tracker.hpp`, and `tracker_base.hpp` to use `trust_extension` instead of `channel_info.trust_extension`, improving clarity in the update path selection logic. - Adjusted the logic to return `TRY_EXTENSION` based on the `has_significant_shape_change` condition, enhancing the decision-making process for update paths. - Removed the old implementation of `selectUpdatePath` in `tracker_base.cpp` to streamline the codebase. These changes aim to improve the maintainability and readability of the multi-object tracking system. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…conditionedUpdate - Updated the logic in the `conditionedUpdate` method to ensure that the bounding box orientation is correctly handled for cluster measurements. - Improved the condition for aligning the cluster to the tracker's orientation by checking for polygon shape type and non-empty footprint points. These changes aim to enhance the accuracy of the vehicle tracking system's update strategy. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
a218717 to
335d917
Compare
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
There was a problem hiding this comment.
Pull request overview
This PR updates the multi-object tracker’s vehicle update logic and BEV association plumbing to (1) avoid corrupting vehicle shape estimates from untrusted cluster measurements, and (2) simplify/refactor association and update-path handling.
Changes:
- Fix vehicle EKF/shape update behavior by gating shape updates on trustworthy bbox measurements and adding cluster-to-tracker orientation alignment for conditioned updates.
- Refactor tracker update flow with a new
UpdatePathselection hook and named update paths (NORMAL / TRY_EXTENSION / CONDITIONED). - Refactor BEV association preparation/scoring by consolidating tracker-side precomputed data into a single struct and returning a
ScoringResultfrom the scoring function.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| perception/autoware_multi_object_tracker/lib/tracker/model/vehicle_tracker.cpp | Shape gating for EKF length input; adds cluster footprint re-projection for conditioned edge alignment; adds absolute alignment threshold. |
| perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp | Refactors updateWithMeasurement() to use UpdatePath selection and clearer control flow. |
| perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp | Prevents zeroing object height when converting convex hull footprint to bbox. |
| perception/autoware_multi_object_tracker/lib/association/scoring/bev_assignment_scoring.cpp | Changes scoring API to return ScoringResult and removes output parameter. |
| perception/autoware_multi_object_tracker/lib/association/bev_association.cpp | Consolidates per-tracker precomputed data into TrackerBevEntry and adapts to ScoringResult. |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/vehicle_tracker.hpp | Adds selectUpdatePath() override and alignment threshold constants; declares cluster alignment helper. |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/tracker_base.hpp | Introduces UpdatePath enum and virtual selectUpdatePath(). |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp | Adds selectUpdatePath() override consistent with vehicle trackers. |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/association/scoring/scoring_types.hpp | Adds ScoringResult type for assignment scoring. |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/association/scoring/bev_assignment_scoring.hpp | Updates scoring API to return ScoringResult and includes new types header. |
| perception/autoware_multi_object_tracker/include/autoware/multi_object_tracker/association/bev_association.hpp | Adds TrackerBevEntry and consolidates PreparationData. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rement alignment logic - Removed the comment regarding the bicycle model's ownership of shape, as it was deemed unnecessary. - Simplified the logic in the `conditionedUpdate` method to directly check for non-empty footprint points, enhancing clarity in the measurement alignment process. These changes aim to improve code readability and maintainability in the vehicle tracking system. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…easurement handling - Increased the alignment ratio threshold from 9% to 15% of the larger object's length to enhance flexibility in alignment checks. - Reduced the absolute alignment threshold from 3.0m to 1.0m for small objects, allowing for better handling of size-mismatch cases. - Updated the alignment logic to use the maximum length between predicted and measured dimensions, ensuring symmetrical handling of different object sizes. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Description
Bug Fixes
1.
shapes.cpp—convertConvexHullToBoundingBoxzeroed every object's heightconvertConvexHullToBoundingBoxwas trackingmin_z/max_zover the footprint points and writingmax_z - min_zintodimensions.z.Footprint points are 2D (
z = 0always), so this silently set every converted object's height to zero.Fix: Removed the z-axis scan entirely. The output
dimensions.zis now left untouched so the caller's upstream value is preserved.2.
vehicle_tracker.cpp—measureWithPosegradually shrank tracked vehicle length for cluster inputsShape update was gated only on
shape.type == BOUNDING_BOX. Cluster measurements withtrust_extension = falseare converted to bounding boxes in baselink frame with unreliable dimensions. These were being fed into the EKF length update, causing the tracked vehicle length to drift smaller over time.Fix: Added
can_update_shape = channel_info.trust_extension && is_bboxguard. Whencan_update_shapeis false, shape update is skipped and the EKF length input is taken frommotion_model_.getLength()(the current state estimate) rather than the noisy measurement.3.
vehicle_tracker.cpp—determineUpdateStrategyalignment threshold was too tight for large vehicles and asymmetric for size-mismatched objectsThe alignment threshold was
0.09 * predicted_length(ratio-only). For a 12 m truck the tolerance was ~1.1 m, which caused spuriousWEAK_UPDATEfallbacks when the vehicle was decelerating. Additionally, comparing againstpredicted_lengthalone was asymmetric when measurement and prediction sizes differed.Fix:
ALIGNMENT_RATIO_THRESHOLD = 0.2).predicted_lengthtomax(predicted_length, measured_length)so that size-mismatched cases are handled symmetrically.ALIGNMENT_ABSOLUTE_THRESHOLD = 1.0) to prevent the threshold from collapsing for small objects.threshold = max(0.2 * max_length, 1.0).4.
vehicle_tracker.cpp—conditionedUpdatecomputed wrong edge gaps for cluster inputsCluster bounding boxes arrive in baselink frame (orientation ≈ ego heading). The edge-alignment logic in
determineUpdateStrategyassumed the measurement is oriented in the tracker's heading frame, so near-face distances were computed incorrectly.Fix: Added
alignClusterToTrackerOrientation(). Before callingdetermineUpdateStrategy, the cluster's polygon footprint is re-projected onto the tracker's current yaw. The aligned object has its pose and dimensions expressed in the tracker's heading frame, so all edge-center calculations become frame-consistent.Refactoring
1.
UpdatePathenum +selectUpdatePath()virtual dispatch (tracker_base, vehicle_tracker, multiple_vehicle_tracker)updateWithMeasurementintracker_base.cpppreviously selected between update strategies with an opaqueif (!has_significant_shape_change)/elsetree. The branch structure conflated two independent decisions (shape stability and channel trust), making the logic hard to follow and override in subclasses.Change: Introduced
enum class UpdatePath { NORMAL, TRY_EXTENSION, CONDITIONED }and avirtual selectUpdatePath(trust_extension, has_significant_shape_change)method onTracker. The base implementation returnsNORMAL.VehicleTrackerandMultipleVehicleTrackeroverride to returnCONDITIONEDwhen!trust_extension(clusters always skip the shape filter) andTRY_EXTENSIONwhenhas_significant_shape_change. TheupdateWithMeasurementbody becomes a clean three-branch dispatch.2.
TrackerBevEntrystruct (bev_association.hpp / bev_association.cpp)PreparationDatapreviously held four parallel vectors (tracked_objects,tracker_labels,tracker_types,tracker_inverse_covariances). Keeping these in sync was fragile; the inverse-covariance vector was also filled in a second loop overtracked_objects.Change: Introduced
struct TrackerBevEntry { object, label, type, inv_cov }and collapsedPreparationDatato a singlestd::vector<TrackerBevEntry> trackers. The preparation loop now fills all four fields in one pass (inverse covariance is computed immediately after the object is extracted), eliminating both the second loop and the parallel-index bookkeeping.3.
ScoringResultstruct (scoring_types.hpp, bev_assignment_scoring.hpp/.cpp)calculateBevAssignmentScorereturned the score as adoubleand communicatedhas_significant_shape_changevia a non-const reference output parameter — an error-prone calling convention.Change: Added a new header
scoring_types.hppwithstruct ScoringResult { double score; bool has_significant_shape_change; }.calculateBevAssignmentScorenow returnsScoringResultby value. All early-return gates return{INVALID_SCORE, false}. Call sites readresult.scoreandresult.has_significant_shape_changedirectly.Files Changed
lib/object_model/shapes.cppconvertConvexHullToBoundingBoxlib/tracker/model/vehicle_tracker.cppcan_update_shapeguard,alignClusterToTrackerOrientation, updated alignment thresholdslib/tracker/model/tracker_base.cppupdateWithMeasurement→ namedUpdatePathdispatchlib/association/bev_association.cppPreparationData→ single-passTrackerBevEntryvectorlib/association/scoring/bev_assignment_scoring.cppScoringResultinstead ofbool &out-paraminclude/.../tracker_base.hppUpdatePathenum,selectUpdatePathvirtualinclude/.../vehicle_tracker.hppselectUpdatePathoverride, updated thresholds,alignClusterToTrackerOrientationinclude/.../multiple_vehicle_tracker.hppselectUpdatePathoverrideinclude/.../bev_association.hppTrackerBevEntry; collapsePreparationDatainclude/.../bev_assignment_scoring.hppScoringResultinclude/.../scoring_types.hppScoringResultstructRelated links
#12475 will base this PR
Parent Issue:
How was this PR tested?
using modified perception pipeline https://github.com/technolojin/autoware_launch/tree/feat/mot/association-polar to input polygon shape detections.
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.