同步操作将从 ApolloAuto/apollo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The Predictor generates the predicted trajectory for each obstacle. Here, let's assume we want to add a new predictor to our vehicle, for other types of obstacles, the procedure is very as follows:
Predictor
NewPredictor
prediction_conf.proto
The following steps will add a Predictor NewPredictor
.
Predictor
Create a new file named new_predictor.h
in the folder modules/prediction/predictor/vehicle
and define it as follows:
#include "modules/prediction/predictor/predictor.h"
namespace apollo {
namespace prediction {
class NewPredictor : public Predictor {
public:
void Predict(Obstacle* obstacle) override;
// Other useful functions and fields.
};
} // namespace prediction
} // namespace apollo
NewPredictor
Create a new file named new_predictor.cc
in the same folder of new_predictor.h
. Implement it like this:
#include "modules/prediction/predictor/vehicle/new_predictor.h"
namespace apollo {
namespace prediction {
NewPredictor::Predict(Obstacle* obstacle)() {
// Get the results from evaluator
// Generate the predicted trajectory
}
// Other functions
} // namespace prediction
} // namespace apollo
prediction_conf.proto
enum PredictorType {
LANE_SEQUENCE_PREDICTOR = 0;
FREE_MOVE_PREDICTOR = 1;
REGIONAL_PREDICTOR = 2;
MOVE_SEQUENCE_PREDICTOR = 3;
NEW_PREDICTOR = 4;
}
In the file modules/prediction/conf/prediction_conf.pb.txt
, update the field predictor_type
like this:
obstacle_conf {
obstacle_type: VEHICLE
obstacle_status: ON_LANE
evaluator_type: NEW_EVALUATOR
predictor_type: NEW_PREDICTOR
}
Update CreateEvluator( ... )
like this:
case ObstacleConf::NEW_PREDICTOR: {
predictor_ptr.reset(new NewPredictor());
break;
}
Update RegisterPredictors()
like this:
RegisterPredictor(ObstacleConf::NEW_PREDICTOR);
After completing the steps above, you would have created a new Predictor.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。