46 auto latest_object_pair = track_data->GetLatestObject();
50 double time_diff = new_object->object_ptr->latest_tracked_time -
51 latest_object->object_ptr->latest_tracked_time;
52 Eigen::Vector3d filter_velocity_gain = new_object->belief_velocity_gain;
53 double filter_acceleration_gain = 0.0;
55 filter_acceleration_gain = 0.0;
57 filter_acceleration_gain = filter_velocity_gain.norm() / time_diff;
59 bool need_keep_motion =
64 need_keep_motion =
true;
67 if (need_keep_motion && (!new_object->converged)) {
68 Eigen::Vector3d current_velocity = Eigen::Vector3d::Zero();
69 current_velocity = latest_object->output_velocity;
70 new_object->output_velocity = current_velocity;
71 AINFO <<
"Track_id " << track_data->track_id_
72 <<
", keep motion because of extraodinary acceleration.";
76 bool is_static_hypothesis =
79 if (is_static_hypothesis) {
80 new_object->output_velocity = Eigen::Vector3d::Zero();
81 new_object->state.tail<2>().setZero();
82 AINFO <<
"Track_id " << track_data->track_id_
83 <<
", set velocity to zero because of noise claping.";
95 double speed = new_object->output_velocity.head(2).norm();
102 if (velocity_noise_level_is_1 &&
104 velocity_noise_level_is_0 =
true;
106 if (velocity_noise_level_is_0) {
112 if (velocity_noise_level_is_2 &&
114 velocity_noise_level_is_1 =
true;
116 double reasonable_angle_change_maximum_0 = M_PI / 6;
117 bool velocity_angle_change_level_is_0 =
119 latest_object, new_object, reasonable_angle_change_maximum_0);
120 if (velocity_noise_level_is_1 && velocity_angle_change_level_is_0) {
126 if (velocity_noise_level_is_3 &&
128 velocity_noise_level_is_2 =
true;
130 double reasonable_angle_change_maximum_1 = M_PI / 4;
131 bool velocity_angle_change_level_is_1 =
133 latest_object, new_object, reasonable_angle_change_maximum_1);
134 if (velocity_noise_level_is_2 && velocity_angle_change_level_is_1) {
143 double reasonable_angle_change_maximum)
const {
147 Eigen::Vector3d previous_velocity = latest_object->output_velocity;
148 Eigen::Vector3d current_velocity = new_object->output_velocity;
149 constexpr double kEpsilon = std::numeric_limits<double>::epsilon();
150 if (previous_velocity.norm() < kEpsilon) {
154 if (current_velocity.norm() < kEpsilon) {
159 double velocity_angle_change =
161 if (fabs(velocity_angle_change) > reasonable_angle_change_maximum) {
167 Eigen::Vector3d previous_direction = latest_object->output_direction;
168 double velocity_heading_angle_change_1 =
170 previous_direction *= -1;
171 double velocity_heading_angle_change_2 =
172 algorithm::CalculateTheta2DXY<double>(
173 previous_direction, current_velocity);
174 velocity_angle_change = std::min(fabs(velocity_heading_angle_change_1),
175 fabs(velocity_heading_angle_change_2));
176 if (fabs(velocity_angle_change) > reasonable_angle_change_maximum) {
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...