提交 b42a35be 编写于 作者: F freeHackOfJeff 提交者: Jiangtao Hu

Perception: simplify the logic of AbleToPublish

上级 ffcbc8f9
......@@ -65,7 +65,6 @@ bool PbfGatekeeper::Init() {
std::string PbfGatekeeper::Name() const { return "PbfGatekeeper"; }
bool PbfGatekeeper::AbleToPublish(const TrackPtr &track) {
bool able_to_pub = false;
bool invisible_in_lidar = !(track->IsLidarVisible());
bool invisible_in_radar = !(track->IsRadarVisible());
bool invisible_in_camera = !(track->IsCameraVisible());
......@@ -80,15 +79,9 @@ bool PbfGatekeeper::AbleToPublish(const TrackPtr &track) {
struct tm timeinfo;
localtime_r(&rawtime, &timeinfo);
bool is_night = (timeinfo.tm_hour >= 23);
if (LidarAbleToPublish(track)) {
able_to_pub = true;
} else if (RadarAbleToPublish(track, is_night)) {
able_to_pub = true;
} else if (CameraAbleToPublish(track, is_night)) {
able_to_pub = true;
}
if (!able_to_pub) {
if (!LidarAbleToPublish(track) ||
!RadarAbleToPublish(track, is_night) ||
!CameraAbleToPublish(track, is_night)) {
return false;
}
......
......@@ -60,7 +60,6 @@ class PbfGatekeeper : public BaseGatekeeper {
bool RadarAbleToPublish(const TrackPtr& track, bool is_night);
bool CameraAbleToPublish(const TrackPtr& track, bool is_night);
private:
PbfGatekeeperParams params_;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册