Exemple #1
0
void runViewer()
{
    viewer = boost::shared_ptr<pcl::visualization::PCLVisualizer>(new pcl::visualization::PCLVisualizer("3D Viewer"));
    viewer->setBackgroundColor(0.3, 0.3, 0.3);

    viewer->registerKeyboardCallback (keyboardEventOccurred, (void*)&viewer);

    pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgbInit(cloudInit);
    viewer->addPointCloud<pcl::PointXYZRGB>(cloudInit, rgbInit, "cloudInit");
    viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloudInit");

    pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(cloud);
    viewer->addPointCloud<pcl::PointXYZRGB>(cloud, rgb, "cloud");
    viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "cloud");

    viewer->addCoordinateSystem(0.1);
    viewer->initCameraParameters();

    viewer->setCameraPosition(0,0,-1,0,0,0,-1,0,0);
    viewer->setCameraPosition(0,0,-1,0,0,0,0,-1,0);

    initialized = true;

    while (!viewer->wasStopped() && !doStopViewer)
    {
        if (cloudUpdated) {
            cloudMutex.lock();
            viewer->updatePointCloud(cloud, "cloud");
            Eigen::Affine3f poseAff(cloudPose);
            viewer->updatePointCloudPose("cloud", poseAff);
            viewer->addCoordinateSystem(0.1, poseAff);
            cloudUpdated = false;
            cloudMutex.unlock();
        }
        if (cloudInitUpdated) {
            cloudMutex.lock();
            //viewer->updatePointCloud(cloudInit, "cloudInit");
            cloudInitUpdated = false;
            cloudMutex.unlock();
        }

        viewer->spinOnce(1);
        boost::this_thread::sleep(boost::posix_time::milliseconds(1));
    }

    //viewer->close();
}
Exemple #2
0
int main()
{
	// Message
	char morseMessage[] = "MICRO CONTROLLER CENTRAL";
	
	// Initializers
	gpioInit();
	timerInit();
	rgbInit(PTB18, PTB19, PTD1);
	morseInit();
	
	// Do something
	morseSetTempo(100);
	morseSendMessage(morseMessage);
	
	// Test access control
	morseRemoveCriticalSafety();
	
	while(1);
	return 0;
}