ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

blackmamba591's profile - activity

2020-03-27 04:05:53 -0500 received badge  Famous Question (source)
2019-05-29 09:01:24 -0500 received badge  Student (source)
2017-11-19 20:02:53 -0500 received badge  Notable Question (source)
2016-09-01 08:03:07 -0500 received badge  Popular Question (source)
2016-08-10 15:36:05 -0500 received badge  Famous Question (source)
2016-07-24 12:45:05 -0500 received badge  Famous Question (source)
2016-06-06 05:19:01 -0500 received badge  Famous Question (source)
2016-05-13 14:09:55 -0500 received badge  Notable Question (source)
2016-04-15 07:58:45 -0500 received badge  Notable Question (source)
2016-04-05 15:00:17 -0500 asked a question Unable to read a .pcd file

Hello I am using pcl to read a .pcd file in ros. I can read less dense files, however when it comes to more dense files, with more fields, that is x,y,z, normal x, normal y, normal z it doesnot view the point cloud anymore. My code is as follows which is a very simple snippet. I am facing the problem when I am trying to see around a million point dense cloud.

#include <ros/ros.h>
#include <pcl/point_cloud.h>
#include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl/io/pcd_io.h>


main(int argc, char **argv){
ros::init (argc, argv, "pcl_read");

ros::NodeHandle nh;
ros::Publisher pcl_pub = nh.advertise<sensor_msgs::PointCloud2> ("pcl_output", 1);

sensor_msgs::PointCloud2 output;
pcl::PointCloud<pcl::PointXYZ> cloud;

pcl::io::loadPCDFile ("milk.pcd", cloud);

pcl::toROSMsg(cloud, output);
output.header.frame_id = "odom";

ros::Rate loop_rate(1);
while (ros::ok())
{
    pcl_pub.publish(output);
    ros::spinOnce();
    loop_rate.sleep();
}

    return 0;
}
2016-04-02 23:03:59 -0500 received badge  Notable Question (source)
2016-03-11 08:22:47 -0500 received badge  Popular Question (source)
2016-02-10 15:05:13 -0500 commented answer Unable to compile PCL 3D Object Recognition tutorial in ROS

Follow the pcl tutorials here http://wiki.ros.org/pcl/Tutorials . Its very descriptive and well documented.

2016-02-10 13:46:38 -0500 asked a question Compare point cloud with CAD model, for object recognition?

I am trying to do industrial part recognition using my robot. I am using a Kinect for as my vision component for the robot. The kinect fetches me real clustered segmented data ( i wrote a code for that). Now i need to perform recognition using a given CAD model. I thought converting it into .pcd file would be one option however, I dont know how feasible and accurate final output I will have after converting a .assembly --> .STL/Mesh--> .PCD. Can some one tell me how can the comparison done to perform the recognition. I am using ROS indigo, PCL (latest), and Kinect Xbox 360. Also all this needs to be done in real time and not offline. As detection and segmentation has been achieved already in real time.

2016-02-10 13:46:38 -0500 received badge  Taxonomist
2016-01-29 12:37:28 -0500 received badge  Popular Question (source)
2016-01-27 17:57:32 -0500 answered a question Unable to view to the clustering results in rviz.

frame_id of the headerof the pointcloud-message needs to be set.

clusters->header.frame_id = "/camera_depth_frame";
clusters->header.stamp=ros::Time::now();
pub.publish (*clusters);

This will solve the problem.

2016-01-27 17:55:56 -0500 commented question Unable to view to the clustering results in rviz.

Thanks jarvis, I have done so. Its solved.

2016-01-27 17:02:32 -0500 commented answer Euclidean Cluster Extraction

How to edit the point cloud headers

2016-01-27 14:42:05 -0500 asked a question Unable to view to the clustering results in rviz.

Hello, I am trying to perform euclidean clustering in ROS. I can generate data and also store them .pcd files. But i wish to see the output of the file in rviz which I am unable to. It throws the following warning:

[WARN] [1426601373.806774699]: Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty

My code looks like this:

ros::Publisher pub;

void cloud_cb(const sensor_msgs::PointCloud2ConstPtr& input){

sensor_msgs::PointCloud2::Ptr clusters (new sensor_msgs::PointCloud2);  
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>), cloud_f (new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromROSMsg(*input, *cloud);
pcl::PointCloud<pcl::PointXYZ>::Ptr clustered_cloud (new pcl::PointCloud<pcl::PointXYZ>);   

std::cout << "PointCloud before filtering has: " << cloud->points.size () << " data points." << std::endl;

// Create the filtering object: downsample the dataset using a leaf size of 1cm
pcl::VoxelGrid<pcl::PointXYZ> vg;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered (new pcl::PointCloud<pcl::PointXYZ>);
vg.setInputCloud (cloud);
vg.setLeafSize (0.01f, 0.01f, 0.01f);
vg.filter (*cloud_filtered);
std::cout << "PointCloud after filtering has: " << cloud_filtered->points.size ()  << " data points." << std::endl;

// Create the segmentation object for the planar model and set all the parameters
pcl::SACSegmentation<pcl::PointXYZ> seg;
pcl::PointIndices::Ptr inliers (new pcl::PointIndices);
pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_plane (new pcl::PointCloud<pcl::PointXYZ> ());
pcl::PCDWriter writer;
seg.setOptimizeCoefficients (true);
seg.setModelType (pcl::SACMODEL_PLANE);
seg.setMethodType (pcl::SAC_RANSAC);
seg.setMaxIterations (100);
seg.setDistanceThreshold (0.02);

int i=0, nr_points = (int) cloud_filtered->points.size ();
while (cloud_filtered->points.size () > 0.3 * nr_points)
{
    // Segment the largest planar component from the remaining cloud
    seg.setInputCloud (cloud_filtered);
        seg.segment (*inliers, *coefficients);
        if (inliers->indices.size () == 0)
     {
            std::cout << "Could not estimate a planar model for the given dataset." << std::endl;
            break;
         }

    // Extract the planar inliers from the input cloud
pcl::ExtractIndices<pcl::PointXYZ> extract;
    extract.setInputCloud (cloud_filtered);
    extract.setIndices (inliers);
    extract.setNegative (false);

    // Get the points associated with the planar surface
    extract.filter (*cloud_plane);
    std::cout << "PointCloud representing the planar component: " << cloud_plane->points.size () << " data points." << std::endl;

    // Remove the planar inliers, extract the rest
    extract.setNegative (true);
    extract.filter (*cloud_f);
    *cloud_filtered = *cloud_f;
}

// Creating the KdTree object for the search method of the extraction
 pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);
tree->setInputCloud (cloud_filtered);

std::vector<pcl::PointIndices> cluster_indices;
pcl::EuclideanClusterExtraction<pcl::PointXYZ> ec;
ec.setClusterTolerance (0.02); // 2cm
ec.setMinClusterSize (10);
ec.setMaxClusterSize (2500);
ec.setSearchMethod (tree);
ec.setInputCloud (cloud_filtered);
ec.extract (cluster_indices);
std::vector<pcl::PointIndices>::const_iterator it;
std::vector<int>::const_iterator pit;

 int j = 0; 
for(it = cluster_indices.begin(); it != cluster_indices.end(); ++it) {
        pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_cluster (new pcl::PointCloud<pcl::PointXYZ>);
        for(pit = it->indices.begin(); pit != it->indices.end(); pit++) {
        //push_back: add a point to the end of the existing vector
                cloud_cluster->points.push_back(cloud_filtered->points[*pit]); 

        cloud_cluster->width = cloud_cluster->points.size ();
            cloud_cluster->height = 1;
            cloud_cluster->is_dense = true;


        std::stringstream ss;
            ss << "cloud_cluster_" << j << ".pcd";
            writer.write<pcl::PointXYZ> (ss.str (), *cloud_cluster, false ...
(more)
2016-01-26 17:06:24 -0500 received badge  Commentator
2016-01-26 17:06:24 -0500 commented question Euclidean Cluster Extraction

Could you get your code running?

2016-01-26 16:36:47 -0500 received badge  Popular Question (source)
2016-01-26 12:27:40 -0500 commented answer table top segmentation from kinect

Thanks Ugo the wiki link works for me. I thought you implemented it, so wanted to see the code, however, l have been going through the wiki and has been very comprehensive. Thanks again

2016-01-26 12:25:54 -0500 commented answer How to implement conditional euclidean clustering in ROS?

Thanks a lot, I implemented the SAC segmentation with some changes, and it works, I will give it a try. Thanks for your response Javier

2016-01-26 12:25:17 -0500 received badge  Supporter (source)
2016-01-26 12:25:13 -0500 received badge  Scholar (source)
2016-01-25 13:14:32 -0500 asked a question How to implement conditional euclidean clustering in ROS?

I am aware of the the conditional euclidean clustering is available on PCL website. But can someone please tell me how to implement this in ROS?

2016-01-25 12:28:56 -0500 commented answer table top segmentation from kinect

thanks Ugo, is your code open source. Could I have a look at it. This link which you have given above does not work for me. Thanks again for your time

2015-12-13 11:08:46 -0500 commented answer table top segmentation from kinect

I went through tutorial link. I wish to implement this. Will it work in ROS Indigo (ubuntu 14.04)? Also I am unable to access the code.

2015-11-15 10:42:50 -0500 received badge  Enthusiast
2015-11-15 09:54:22 -0500 received badge  Famous Question (source)
2015-11-14 10:01:04 -0500 commented answer How can I part identification in real time using kinect?

Did. Thanks again.

2015-11-14 10:00:24 -0500 edited question How can I part identification in real time using kinect?

I am fairly new to Kinect. I am using it for my research. I want to use kinect for segment my input part and identify the part in real time? Here I refer part as the industry part, where I am employing a bot at the conveyor and using kinect to perform hand off of the industrial parts. The robot should be able to read the part and perform identification and also segment the region of interest.

2015-11-14 10:00:24 -0500 received badge  Editor (source)