提交 80e15612 编写于 作者: P panjiacheng 提交者: Kecheng Xu

Prediction: Introducing the lane-scanning evaluator.

上级 3263e162
......@@ -277,6 +277,7 @@ void ObstaclesContainer::BuildLaneGraph() {
continue;
}
obstacle_ptr->BuildLaneGraph();
obstacle_ptr->BuildLaneGraphFromLeftToRight();
}
}
......
......@@ -165,4 +165,18 @@ cc_test(
],
)
cc_library(
name = "lane_scanning_evaluator",
srcs = [
"lane_scanning_evaluator.cc",
],
hdrs = [
"lane_scanning_evaluator.h",
],
deps = [
"//modules/prediction/container:container_manager",
"//modules/prediction/evaluator",
],
)
cpplint()
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include <limits>
#include <utility>
#include "modules/common/util/file.h"
#include "modules/prediction/common/feature_output.h"
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/prediction/common/prediction_system_gflags.h"
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/container/obstacles/obstacles_container.h"
#include "modules/prediction/evaluator/vehicle/lane_scanning_evaluator.h"
namespace apollo {
namespace prediction {
using apollo::common::adapter::AdapterConfig;
using apollo::common::util::GetProtoFromFile;
// Helper function for converting world coordinate of a point
// to relative coordinate with respect to the object (obstacle or ADC).
std::pair<double, double> WorldCoordToObjCoord
(std::pair<double, double> input_world_coord,
std::pair<double, double> obj_world_coord,
double obj_world_angle) {
double x_diff = input_world_coord.first - obj_world_coord.first;
double y_diff = input_world_coord.second - obj_world_coord.second;
double rho = std::sqrt(x_diff * x_diff + y_diff * y_diff);
double theta = std::atan2(y_diff, x_diff) - obj_world_angle;
return std::make_pair(std::cos(theta)*rho, std::sin(theta)*rho);
}
double WorldAngleToObjAngle(double input_world_angle,
double obj_world_angle) {
return common::math::NormalizeAngle(input_world_angle - obj_world_angle);
}
LaneScanningEvaluator::LaneScanningEvaluator() {
}
void LaneScanningEvaluator::Evaluate(Obstacle* obstacle_ptr) {
}
void LaneScanningEvaluator::ExtractFeatures(
const Obstacle* obstacle_ptr, std::vector<double>* feature_values) {
}
void LaneScanningEvaluator::ExtractObstacleFeatures(
const Obstacle* obstacle_ptr, std::vector<double>* feature_values) {
}
void LaneScanningEvaluator::ExtractStaticEnvFeatures(
const Obstacle* obstacle_ptr, std::vector<double>* feature_values) {
}
} // namespace prediction
} // namespace apollo
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "modules/prediction/evaluator/evaluator.h"
namespace apollo {
namespace prediction {
class LaneScanningEvaluator : public Evaluator {
public:
/**
* @brief Constructor
*/
LaneScanningEvaluator();
/**
* @brief Destructor
*/
virtual ~LaneScanningEvaluator() = default;
/**
* @brief Override Evaluate
* @param Obstacle pointer
*/
void Evaluate(Obstacle* obstacle_ptr) override;
/**
* @brief Extract features for learning model's input
* @param Obstacle pointer
*/
void ExtractFeatures(const Obstacle* obstacle_ptr,
std::vector<double>* feature_values);
private:
/**
* @brief Extract the features for obstacles
* @param Obstacle pointer
* A vector of doubles to be filled up with extracted features
*/
void ExtractObstacleFeatures(const Obstacle* obstacle_ptr,
std::vector<double>* feature_values);
/**
* @brief Set lane feature vector
* @param Obstacle pointer
* A vector of doubles to be filled up with extracted features
*/
void ExtractStaticEnvFeatures(const Obstacle* obstacle_ptr,
std::vector<double>* feature_values);
private:
static const size_t OBSTACLE_FEATURE_SIZE = 23 + 5 * 9;
static const size_t INTERACTION_FEATURE_SIZE = 8;
static const size_t SINGLE_LANE_FEATURE_SIZE = 4;
static const size_t LANE_POINTS_SIZE = 20;
};
} // namespace prediction
} // namespace apollo
......@@ -64,12 +64,6 @@ message ObstaclePriority {
optional Priority priority = 25 [default = NORMAL];
}
// Ground truth information for labeling purpose
message FutureStatus {
repeated apollo.common.TrajectoryPoint future_traj_points = 1;
}
// next id = 32
message Feature {
// Obstacle ID
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册