46 {
47 if (frame == nullptr || frame->world_cloud == nullptr) {
48 AERROR <<
"Frame is nullptr.";
49 return false;
50 }
51 ground_service_->GetServiceContentCopy(&ground_service_content_);
53 AERROR <<
"service is not ready.";
54 return false;
55 }
56 auto& cloud = frame->world_cloud;
57 auto& non_ground_indices = frame->non_ground_indices;
58 non_ground_indices.indices.clear();
59 non_ground_indices.indices.reserve(cloud->size());
60 for (size_t i = 0; i < cloud->size(); ++i) {
61 auto& pt = cloud->at(i);
62 Eigen::Vector3d world_point(pt.x, pt.y, pt.z);
63 float dist = ground_service_->QueryPointToGroundDistance(
64 world_point, ground_service_content_);
65 frame->cloud->mutable_points_height()->at(i) = dist;
66 frame->world_cloud->mutable_points_height()->at(i) = dist;
67 if (dist > ground_threshold_) {
68 non_ground_indices.indices.push_back(static_cast<int>(i));
69 } else {
70 frame->cloud->mutable_points_label()->at(i) =
72 }
73 }
74 return true;
75}
bool IsServiceReady() const