提交 ae0422ec 编写于 作者: K kechxu 提交者: Yajia Zhang

Prediction: rename a function

上级 9029244a
......@@ -109,7 +109,7 @@ void RegionalPredictor::GenerateStillTrajectory(
double delta_heading = 2.0 * M_PI / num_traj;
double speed = FLAGS_pedestrian_min_speed;
double total_time = FLAGS_prediction_pedestrian_total_time;
int start_index = GetTrajectorySize();
int start_index = NumOfTrajectories();
for (int i = 0; i < num_traj; ++i) {
std::vector<TrajectoryPoint> points;
......@@ -158,7 +158,7 @@ void RegionalPredictor::GenerateMovingTrajectory(
DrawMovingTrajectory(position, velocity, acc,
obstacle->kf_pedestrian_tracker(), total_time,
&left_points, &right_points);
int start_index = GetTrajectorySize();
int start_index = NumOfTrajectories();
Trajectory left_trajectory;
Trajectory right_trajectory;
......
......@@ -25,7 +25,7 @@ const std::vector<Trajectory>& Predictor::trajectories() {
return trajectories_;
}
int Predictor::GetTrajectorySize() {
int Predictor::NumOfTrajectories() {
return trajectories_.size();
}
......@@ -37,7 +37,7 @@ void Predictor::GenerateTrajectory(
}
void Predictor::SetEqualProbability(double probability, int start_index) {
int num = GetTrajectorySize();
int num = NumOfTrajectories();
if (start_index >= 0 && num > start_index) {
probability /= static_cast<double>(num - start_index);
for (int i = start_index; i < num; ++i) {
......
......@@ -63,7 +63,7 @@ class Predictor {
* @brief Get trajectory size
* @return Size of trajectories
*/
int GetTrajectorySize();
int NumOfTrajectories();
protected:
/**
......
......@@ -59,7 +59,7 @@ TEST_F(LaneSequencePredictorTest, OnLaneCase) {
mlp_evaluator.Evaluate(obstacle_ptr);
LaneSequencePredictor predictor;
predictor.Predict(obstacle_ptr);
EXPECT_EQ(predictor.GetTrajectorySize(), 2);
EXPECT_EQ(predictor.NumOfTrajectories(), 2);
}
} // namespace prediction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册