GithubHelp home page GithubHelp logo

Comments (3)

christianlandgraf avatar christianlandgraf commented on June 28, 2024

Hey, when trying this package I get the same error. Did you find a solution?

from pcl_online_viewer.

chandanlal92 avatar chandanlal92 commented on June 28, 2024

I dont remember the solution. But I will add worked method. I guess giving delay or memory lock helped. Here is the working method:

boost::shared_ptrpcl::visualization::PCLVisualizer normalsVis (
pcl::PointCloudpcl::PointXYZ::ConstPtr cloud, pcl::PointCloudpcl::Normal::ConstPtr normals, pcl::PointXYZ center, Eigen::Matrix3f matrix_1)
{
// --------------------------------------------------------
// -----Open 3D viewer and add point cloud and normals-----
// --------------------------------------------------------
m.lock();
//~ pcl::visualization::PointCloudColorHandlerpcl::PCLPointCloud2 ColorHandler;

/*

  • Defining Point Cloud Viewer Parameters
  • */
    boost::shared_ptrpcl::visualization::PCLVisualizer viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));

//~ viewer->spinOnce (10);

//~ cout<< ("PointCloud with %d data points (%s) and frame %s.",
//~ cloud->width * cloud->height,
//~ pcl::getFieldsList (*cloud).c_str (),
//~ cloud->header.frame_id.c_str ());
//~ color_handler.reset (new pcl::visualization::PointCloudColorHandlerCustompcl::PCLPointCloud2(cloud, "rgb" ));
viewer->setBackgroundColor (0, 0, 0);
viewer->addPointCloudpcl::PointXYZ (cloud,"sample cloud");
viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud");
//~ viewer->addPointCloudNormals<pcl::PointXYZ, pcl::Normal> (cloud, normals, 10, 0.1, "normals");
//~ viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 4, "normals");
//~ viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, "normals");

pcl::PointXYZ center_0 (center.x,center.y,center.z);

/*

  • Defining X,Y,Z Axis in the From the Vector Form
  • */

pcl::PointXYZ x_axis (matrix_1(0,0), matrix_1(0,1), matrix_1(0,2));
pcl::PointXYZ y_axis (matrix_1(1,0), matrix_1(1,1), matrix_1(1,2));
pcl::PointXYZ z_axis (matrix_1(2,0), matrix_1(2,1), matrix_1(2,2));

viewer->addLine (center_0, x_axis, 1.0f, 0.0f, 0.0f, "major eigen vector"+1);
viewer->addLine (center_0, y_axis, 0.0f, 1.0f, 0.0f, "middle eigen vector3"+4);
viewer->addLine (center_0, z_axis, 0.0f, 0.0f, 1.0f, "minor eigen vector6"+7);
viewer->addCoordinateSystem (0.5);
//~ viewer->initCameraParameters ();
while(!viewer->wasStopped())
{
viewer->spinOnce (100);
boost::this_thread::sleep (boost::posix_time::microseconds (100000));
}
//~ return(viewer);
m.unlock();
}

from pcl_online_viewer.

chandanlal92 avatar chandanlal92 commented on June 28, 2024

I think this part was the solution. Not sure its been a while since I worked on this:

while(!viewer->wasStopped())
{
viewer->spinOnce (100);
boost::this_thread::sleep (boost::posix_time::microseconds (100000));
}

from pcl_online_viewer.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.