提交 3afd601e 编写于 作者: H huiyujiang 提交者: Dong Li

Perception: add confidence type, lidar and radar confidence (#1881)

* Perception: add confidence type, lidar and radar confidence

* Perception: change unknown to 0
上级 fc4ffce7
......@@ -118,6 +118,8 @@ void Object::Serialize(PerceptionObstacle* pb_obj) const {
}
pb_obj->set_confidence(score);
pb_obj->set_confidence_type(
static_cast<PerceptionObstacle::ConfidenceType>(score_type));
pb_obj->set_tracking_time(tracking_time);
pb_obj->set_type(static_cast<PerceptionObstacle::Type>(type));
pb_obj->set_timestamp(latest_tracked_time); // in seconds.
......@@ -150,6 +152,7 @@ void Object::Deserialize(const PerceptionObstacle& pb_obs) {
}
score = pb_obs.confidence();
score_type = static_cast<ScoreType>(pb_obs.confidence_type());
tracking_time = pb_obs.tracking_time();
latest_tracked_time = pb_obs.timestamp();
type = static_cast<ObjectType>(pb_obs.type());
......
......@@ -65,6 +65,8 @@ struct alignas(16) Object {
// foreground score/probability
float score = 0.0;
// foreground score/probability type
ScoreType score_type = SCORE_CNN;
// Object classification type.
ObjectType type;
......
......@@ -42,6 +42,12 @@ enum SensorType {
UNKNOWN_SENSOR_TYPE = 10,
};
enum ScoreType {
UNKNOWN_SCORE_TYPE = 0,
SCORE_CNN = 1,
SCORE_RADAR = 2,
};
typedef pcl_util::PointCloud PolygonType;
typedef pcl_util::PointDCloud PolygonDType;
......
......@@ -264,6 +264,7 @@ class Cluster2D {
apollo::perception::ObjectPtr out_obj(new apollo::perception::Object);
out_obj->cloud = obs->cloud;
out_obj->score = obs->score;
out_obj->score_type = SCORE_CNN;
out_obj->type = GetObjectType(obs->meta_type);
out_obj->type_probs = GetObjectTypeProbs(obs->meta_type_probs);
objects->push_back(out_obj);
......
......@@ -85,6 +85,9 @@ void ObjectBuilder::Build(const ContiRadar &raw_obstacles,
object_ptr->width = 1.0;
object_ptr->height = 1.0;
object_ptr->type = UNKNOWN;
object_ptr->score_type = SCORE_RADAR;
object_ptr->score = static_cast<float>(
raw_obstacles.contiobs(i).probexist());
Eigen::Matrix3d dist_rms;
Eigen::Matrix3d vel_rms;
......
......@@ -44,6 +44,12 @@ message PerceptionObstacle {
repeated double point_cloud = 12 [packed = true];
optional double confidence = 13 [default = 1.0];
enum ConfidenceType {
CONFIDENCE_UNKNOWN = 0;
CONFIDENCE_CNN = 1;
CONFIDENCE_RADAR = 2;
};
optional ConfidenceType confidence_type = 14 [default = CONFIDENCE_CNN];
}
message PerceptionObstacles {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册