47 if (frame ==
nullptr || frame->
world_cloud ==
nullptr) {
48 AERROR <<
"Frame is nullptr.";
51 ground_service_->GetServiceContentCopy(&ground_service_content_);
53 AERROR <<
"service is not ready.";
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));
70 frame->
cloud->mutable_points_label()->at(i) =
bool IsServiceReady() const
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...