提交 db47654f 编写于 作者: C Calvin Miao 提交者: Jiangtao Hu

Fixed some errors in free move trajectory

上级 c6bd80ae
......@@ -41,7 +41,7 @@ void Predictor::GenerateTrajectory(
void Predictor::SetEqualProbability(double probability, int start_index) {
int num = GetTrajectorySize();
if (start_index > 0 && num > 0 && num > start_index) {
if (start_index >= 0 && num > 0 && num > start_index) {
probability = probability / (double(num - start_index));
for (int i = start_index; i < num; ++i) {
prediction_obstacle_.mutable_trajectory(i)->set_probability(probability);
......
......@@ -50,14 +50,15 @@ void FreeMovePredictor::Predict(Obstacle* obstacle) {
std::vector<TrajectoryPoint> points(0);
double total_time = FLAGS_prediction_duration;
// TODO(jinghao):
// TODO(kechxu):
// draw_free_move_trajectory(position, velocity, obstacle->kf_motion_tracker(),
// total_time, points);
Trajectory trajectory;
GenerateTrajectory(points, &trajectory);
trajectory.set_probability(1.0);
int start_index = 0;
prediction_obstacle_.set_predicted_period(total_time);
prediction_obstacle_.add_trajectory()->CopyFrom(trajectory);
SetEqualProbability(1.0, start_index);
}
} // prediction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册