48 {
49 auto latest_object_pair = track_data->GetLatestObject();
51
52
53 double time_diff = new_object->object_ptr->latest_tracked_time -
54 latest_object->object_ptr->latest_tracked_time;
55 Eigen::Vector3d filter_velocity_gain = new_object->belief_velocity_gain;
56 double filter_acceleration_gain = 0.0;
58 filter_acceleration_gain = 0.0;
59 } else {
60 filter_acceleration_gain = filter_velocity_gain.norm() / time_diff;
61 }
62 bool need_keep_motion =
64
67 need_keep_motion = true;
68 }
69
70 if (need_keep_motion && (!new_object->converged)) {
71 Eigen::Vector3d current_velocity = Eigen::Vector3d::Zero();
72 current_velocity = latest_object->output_velocity;
73 new_object->output_velocity = current_velocity;
74
75
76
77
78 AINFO <<
"[Velocity-Refine] track_id: " << track_data->track_id_
79 << " KEEP MOTION because of extraodinary acceleration.";
80 return true;
81 }
82
83
84 bool need_assign_movable_obj_speed =
87 if (new_object->belief_velocity.head(2).norm() > 0) {
88 new_object->output_velocity = new_object->belief_velocity;
89 } else if (new_object->measured_barycenter_velocity.head(2).norm() > 0) {
90 new_object->output_velocity = new_object->measured_barycenter_velocity;
91 } else {
92 new_object->output_velocity = new_object->measured_center_velocity;
93 }
94 return true;
95 }
96
97
98 bool is_static_hypothesis =
100
101 if (is_static_hypothesis) {
102 new_object->output_velocity = Eigen::Vector3d::Zero();
103 new_object->state.tail<2>().setZero();
104 AINFO <<
"[Velocity-Refine] track_id: " << track_data->track_id_
105 << " set velocity to zero because of static_hypothesis.";
106 return true;
107 }
108 return false;
109}
bool CheckStaticHypothesisByState(const TrackedObjectConstPtr &latest_object, const TrackedObjectConstPtr &new_object) const
Check whether new observed object is static or not
bool NeedAssignMovableObjectSpeed(const TrackedObjectConstPtr &latest_object, const TrackedObjectConstPtr &new_object) const
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr