File tree 4 files changed +11
-8
lines changed
perception/tracking_object_merger
include/tracking_object_merger/utils
4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ We use the `existence_probability` to manage tracklet.
59
59
- When we create a new tracklet, we set the ` existence_probability ` to $p_ {sensor}$ value.
60
60
- In each update with specific sensor, we set the ` existence_probability ` to $p_ {sensor}$ value.
61
61
- When tracklet does not have update with specific sensor, we reduce the ` existence_probability ` by ` decay_rate `
62
- - Object can be published if ` existence_probability ` is larger than ` publish_probability_threshold `
63
- - Object will be removed if ` existence_probability ` is smaller than ` remove_probability_threshold `
62
+ - Object can be published if ` existence_probability ` is larger than ` publish_probability_threshold ` and time from last update is smaller than ` max_dt `
63
+ - Object will be removed if ` existence_probability ` is smaller than ` remove_probability_threshold ` and time from last update is larger than ` max_dt `
64
64
65
65
![ tracklet_management] ( ./image/tracklet_management.drawio.svg )
66
66
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class TrackerState
118
118
std::function<void (TrackedObject &, const TrackedObject &)> update_func);
119
119
// const functions
120
120
bool hasUUID (const MEASUREMENT_STATE input, const unique_identifier_msgs::msg::UUID & uuid) const ;
121
- bool isValid () const ;
121
+ bool isValid (const rclcpp::Time & current_time ) const ;
122
122
bool canPublish () const ;
123
123
TrackedObject getObject () const ;
124
124
Original file line number Diff line number Diff line change @@ -250,9 +250,6 @@ bool DecorativeTrackerMergerNode::decorativeMerger(
250
250
{
251
251
// get current time
252
252
const auto current_time = rclcpp::Time (input_objects_msg->header .stamp );
253
- if (input_objects_msg->objects .empty ()) {
254
- return false ;
255
- }
256
253
if (inner_tracker_objects_.empty ()) {
257
254
for (const auto & object : input_objects_msg->objects ) {
258
255
inner_tracker_objects_.push_back (createNewTracker (input_sensor, current_time, object));
Original file line number Diff line number Diff line change @@ -271,8 +271,14 @@ bool TrackerState::hasUUID(
271
271
return input_uuid_map_.at (input) == uuid;
272
272
}
273
273
274
- bool TrackerState::isValid () const
274
+ bool TrackerState::isValid (const rclcpp::Time & current_time ) const
275
275
{
276
+ // check dt from last update
277
+ double dt = (current_time - last_update_time_).seconds ();
278
+ if (std::abs (dt) > max_dt_) {
279
+ return false ;
280
+ }
281
+
276
282
// check if tracker state is valid
277
283
if (existence_probability_ < remove_probability_threshold_) {
278
284
return false ;
@@ -302,7 +308,7 @@ TrackedObjects getTrackedObjectsFromTrackerStates(
302
308
// sanitize and get tracked objects
303
309
for (auto it = tracker_states.begin (); it != tracker_states.end ();) {
304
310
// check if tracker state is valid
305
- if (it->isValid ()) {
311
+ if (it->isValid (current_time )) {
306
312
if (it->canPublish ()) {
307
313
// if valid, get tracked object
308
314
tracked_objects.objects .push_back (it->getObject ());
You can’t perform that action at this time.
0 commit comments