void KMDriverDbWidget::setDriver(const QString &manu, const QString &model) { QListBoxItem *item = m_manu->findItem(manu); QString model_(model); if(item) { m_manu->setCurrentItem(item); item = m_model->findItem(model_); if(!item) // try by stripping the manufacturer name from // the beginning of the model string. This is // often the case with PPD files item = m_model->findItem(model_.replace(0, manu.length() + 1, QString::fromLatin1(""))); if(item) m_model->setCurrentItem(item); } }
void shot_detector::loadModel(pcl::PointCloud<PointType>::Ptr model, std::string model_name) { std::string filename = model_name; /*vtkSmartPointer<vtkPLYReader> reader = vtkSmartPointer<vtkPLYReader>::New(); vtkSmartPointer<vtkPolyData> data=vtkSmartPointer<vtkPolyData>::New(); reader->SetFileName ( filename.c_str() ); reader->Update(); data=reader->GetOutput(); std::cerr << "model loaded" << std::endl; pcl::io::vtkPolyDataToPointCloud(data,*model);*/ pcl::PointCloud<pcl::PointXYZRGB>::Ptr model_ (new pcl::PointCloud<pcl::PointXYZRGB> ()); pcl::io::loadOBJFile(filename, *model_); pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer"); viewer.showCloud (model_); while (!viewer.wasStopped ()) { } }
shot_detector::shot_detector() { data = false; activated = false; std::cerr << "Starting" << std::endl; // Start the ros stuff such as the subscriber and the service nh = ros::NodeHandle("apc_object_detection"); loadParameters(); //kinect=nh.subscribe("/kinect2_cool/depth_highres/points", 1, &shot_detector::PointCloudCallback,this); processor = nh.advertiseService("Shot_detector", &shot_detector::processCloud, this); // As we use Ptr to access our pointcloud we first have to initalize something to point to pcl::PointCloud<PointType>::Ptr model_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr model_keypoints_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr scene_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr scene_keypoints_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<NormalType>::Ptr model_normals_ (new pcl::PointCloud<NormalType> ()); pcl::PointCloud<NormalType>::Ptr scene_normals_ (new pcl::PointCloud<NormalType> ()); pcl::PointCloud<DescriptorType>::Ptr model_descriptors_ (new pcl::PointCloud<DescriptorType> ()); pcl::PointCloud<DescriptorType>::Ptr scene_descriptors_ (new pcl::PointCloud<DescriptorType> ()); pcl::CorrespondencesPtr model_scene_corrs_ (new pcl::Correspondences ()); pcl::PointCloud<PointType>::Ptr model_good_kp_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr scene_good_kp_ (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr objects_ (new pcl::PointCloud<PointType> ()); //pcl::PointCloud<DescriptorType>::Ptr model_descriptors_ (new pcl::PointCloud<DescriptorType> ()); //pcl::PointCloud<DescriptorType>::Ptr scene_descriptors_ (new pcl::PointCloud<DescriptorType> ()); model = model_; model_keypoints = model_keypoints_; scene = scene_; scene_keypoints = scene_keypoints_; model_normals = model_normals_; scene_normals = scene_normals_; model_descriptors = model_descriptors_; scene_descriptors = scene_descriptors_; model_scene_corrs = model_scene_corrs_; model_good_kp = model_good_kp_; scene_good_kp = scene_good_kp_; objects = objects_; pcl::CorrespondencesPtr correspondences (new pcl::Correspondences); correspondences_ = correspondences; //Set up a couple of the pcl settings descr_est.setRadiusSearch (descr_rad_); norm_est.setKSearch (10); //calcPFHRGBDescriptors(model,model_keypoints,model_normals,model_descriptors); }
std::string operator()(Args&&... args) { json::wvalue ctx(model_(std::forward<Args>(args)...)); return view_.render(ctx); }