提交 22c4ea64 编写于 作者: J jmtao 提交者: Yu Wang

planning: fixed chassis feature data in learning data

上级 d29691fe
......@@ -98,18 +98,11 @@ void FeatureGenerator::OnLocalization(
}
void FeatureGenerator::OnChassis(const apollo::canbus::Chassis& chassis) {
/* To be fixed
if (learning_data_frame_ == nullptr) {
AERROR << "learning_data_frame_ pointer is nullptr";
return;
}
auto features = learning_data_frame_->mutable_chassis();
features->set_speed_mps(chassis.speed_mps());
features->set_throttle_percentage(chassis.throttle_percentage());
features->set_brake_percentage(chassis.brake_percentage());
features->set_steering_percentage(chassis.steering_percentage());
features->set_gear_location(chassis.gear_location());
*/
chassis_feature_.set_speed_mps(chassis.speed_mps());
chassis_feature_.set_throttle_percentage(chassis.throttle_percentage());
chassis_feature_.set_brake_percentage(chassis.brake_percentage());
chassis_feature_.set_steering_percentage(chassis.steering_percentage());
chassis_feature_.set_gear_location(chassis.gear_location());
}
void FeatureGenerator::OnTafficLightDetection(
......@@ -187,6 +180,10 @@ void FeatureGenerator::GenerateLearningDataFrame() {
localization_for_label_.back().header().timestamp_sec());
learning_data_frame->set_frame_num(total_learning_data_frame_num_++);
// add chassis
auto chassis = learning_data_frame->mutable_chassis();
chassis->CopyFrom(chassis_feature_);
// add localization
auto localization = learning_data_frame->mutable_localization();
const auto& pose = localization_for_label_.back().pose();
......
......@@ -61,6 +61,7 @@ class FeatureGenerator {
std::list<apollo::localization::LocalizationEstimate>
localization_for_label_;
int total_learning_data_frame_num_ = 0;
ChassisFeature chassis_feature_;
std::vector<std::string> routing_lane_ids_;
std::unordered_map<std::string, apollo::perception::TrafficLight::Color>
traffic_lights_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册