|
@@ -149,22 +149,17 @@ void ListenPointCloud(const char * strdata,const unsigned int nSize,const unsign
|
|
|
points_buffer.push_back(Eigen::Vector3d(x, y, z));
|
|
|
intensities_buffer.push_back(intens);
|
|
|
|
|
|
- if(xp.intensity>10)
|
|
|
- {
|
|
|
+// if(xp.intensity>10)
|
|
|
+// {
|
|
|
point_cloud->push_back(xp);
|
|
|
|
|
|
++point_cloud->width;
|
|
|
- }
|
|
|
+// }
|
|
|
p++;
|
|
|
|
|
|
// std::cout<<" x is "<<xp.x<<" y is "<<xp.y<<std::endl;
|
|
|
}
|
|
|
|
|
|
- if(gcloud_ptr != nullptr)
|
|
|
- {
|
|
|
-// gvis.RemoveGeometry(gcloud_ptr);
|
|
|
- }
|
|
|
-
|
|
|
std::vector<float> times_buffer(points_buffer.size(), 0.0f);
|
|
|
open3d::core::Tensor positions =
|
|
|
open3d::core::eigen_converter::EigenVector3dVectorToTensor(
|
|
@@ -178,9 +173,25 @@ void ListenPointCloud(const char * strdata,const unsigned int nSize,const unsign
|
|
|
open3d::core::Dtype::Float32);
|
|
|
cloud.SetPointAttr("intensity", intensity);
|
|
|
cloud.SetPointAttr("time", time);
|
|
|
- gcloud_ptr = std::make_shared<open3d::geometry::PointCloud>(
|
|
|
- cloud.ToLegacy().PaintUniformColor({1.0, 1.0, 1.0}));
|
|
|
- gvis.AddGeometry(gcloud_ptr);
|
|
|
+
|
|
|
+ if(gcloud_ptr != nullptr)
|
|
|
+ {
|
|
|
+// gvis.RemoveGeometry(gcloud_ptr);
|
|
|
+ gcloud_ptr = std::make_shared<open3d::geometry::PointCloud>(
|
|
|
+ cloud.ToLegacy().PaintUniformColor({1.0, 1.0, 1.0}));
|
|
|
+ gvis.AddGeometry(gcloud_ptr);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ gvis.RemoveGeometry(gcloud_ptr);
|
|
|
+ gcloud_ptr = std::make_shared<open3d::geometry::PointCloud>(
|
|
|
+ cloud.ToLegacy().PaintUniformColor({1.0, 1.0, 1.0}));
|
|
|
+ gvis.AddGeometry(gcloud_ptr);//gvis.UpdateGeometry(gcloud_ptr);
|
|
|
+ gvis.UpdateRender();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -202,9 +213,12 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
snprintf(gstr_memname,255,"lidar_pc");
|
|
|
|
|
|
+
|
|
|
void * pa = iv::modulecomm::RegisterRecv(gstr_memname,ListenPointCloud);
|
|
|
|
|
|
gvis.CreateVisualizerWindow("Point Cloud Viewer", 1600, 900);
|
|
|
+
|
|
|
+ open3d::visualization::gui::SceneWidget;
|
|
|
gvis.GetRenderOption().background_color_ = {0.0, 0.0, 0.0};
|
|
|
gvis.GetRenderOption().point_color_option_ =
|
|
|
open3d::visualization::RenderOption::PointColorOption::Color;
|