提交 cbe3aa22 编写于 作者: K kechxu 提交者: Kecheng Xu

Prediction: move dumping adc trajectory to data for tuning

上级 67ad6208
......@@ -26,6 +26,7 @@ namespace apollo {
namespace prediction {
using apollo::common::util::StrCat;
using apollo::common::TrajectoryPoint;
Features FeatureOutput::features_;
ListDataForLearning FeatureOutput::list_data_for_learning_;
......@@ -132,7 +133,8 @@ void FeatureOutput::InsertFrameEnv(const FrameEnv& frame_env) {
void FeatureOutput::InsertDataForTuning(
const Feature& feature, const std::vector<double>& feature_values,
const std::string& category, const LaneSequence& lane_sequence) {
const std::string& category, const LaneSequence& lane_sequence,
const std::vector<TrajectoryPoint>& adc_trajectory) {
DataForTuning* data_for_tuning = list_data_for_tuning_.add_data_for_tuning();
data_for_tuning->set_id(feature.id());
data_for_tuning->set_timestamp(feature.timestamp());
......@@ -142,6 +144,9 @@ void FeatureOutput::InsertDataForTuning(
ADEBUG << "Insert [" << category
<< "] data for tuning with size = " << feature_values.size();
data_for_tuning->set_lane_sequence_id(lane_sequence.lane_sequence_id());
for (const auto& adc_traj_point : adc_trajectory) {
data_for_tuning->add_adc_trajectory_point()->CopyFrom(adc_traj_point);
}
}
void FeatureOutput::WriteFeatureProto() {
......
......@@ -88,11 +88,12 @@ class FeatureOutput {
* @param values for tuning
* @param category of the data
* @param lane sequence
* @param adc trajectory
*/
static void InsertDataForTuning(const Feature& feature,
const std::vector<double>& feature_values,
const std::string& category,
const LaneSequence& lane_sequence);
const std::vector<double>& feature_values,
const std::string& category, const LaneSequence& lane_sequence,
const std::vector<apollo::common::TrajectoryPoint>& adc_trajectory);
/**
* @brief Write features to a file
......
......@@ -261,7 +261,8 @@ double InteractionPredictor::ComputeTrajectoryCost(const Obstacle& obstacle,
std::vector<double> cost_values = {lon_acc_cost, centri_acc_cost,
collision_cost};
FeatureOutput::InsertDataForTuning(
obstacle.latest_feature(), cost_values, "interaction", lane_sequence);
obstacle.latest_feature(), cost_values, "interaction", lane_sequence,
adc_trajectory_);
}
return total_cost;
......
......@@ -91,6 +91,7 @@ proto_library(
"offline_features.proto",
],
deps = [
"//modules/common/proto:pnc_point_proto_lib",
"//modules/prediction/proto:feature_proto_lib",
"//modules/prediction/proto:prediction_proto_lib",
],
......
......@@ -2,6 +2,7 @@ syntax = "proto2";
package apollo.prediction;
import "modules/common/proto/pnc_point.proto";
import "modules/prediction/proto/feature.proto";
message CNNFeatures {
......@@ -58,6 +59,8 @@ message DataForTuning {
repeated double real_cost_value = 5;
// The lane sequence id if associated with a lane
optional int32 lane_sequence_id = 6;
// The associated adc trajectory
repeated apollo.common.TrajectoryPoint adc_trajectory_point = 7;
}
message ListDataForTuning {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册