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

Gurj's profile - activity

2015-12-04 04:02:55 -0500 received badge  Famous Question (source)
2015-07-08 13:27:42 -0500 received badge  Famous Question (source)
2015-07-08 13:27:42 -0500 received badge  Notable Question (source)
2015-05-19 02:20:55 -0500 received badge  Notable Question (source)
2015-03-15 08:35:51 -0500 received badge  Popular Question (source)
2015-03-02 13:14:27 -0500 asked a question roslint error

I am trying to perform an extrinsic calibration based on the following tutorial: http://wiki.ros.org/industrial_extrin...

I have installed all the dependencies outlines and when I try catkin_make before carrying out the steps outlined in the tutorial I get the following errors:

...catkinConfig.cmake:75 (find_package):
  Could not find a configuration file for package roslint.

  Set roslint_DIR to the directory containing a CMake configuration file for
  roslint.  The file will have one of the following names:

    roslintConfig.cmake
    roslint-config.cmake

And

...CMakeLists.txt:206 (roslint_cpp):
  Unknown CMake command "roslint_cpp".

Anybody ever have the same problem or could help in fixing it? Thanks

2015-02-24 06:31:32 -0500 received badge  Enthusiast
2015-02-24 06:31:31 -0500 received badge  Enthusiast
2015-02-24 06:31:31 -0500 received badge  Enthusiast
2015-02-24 06:31:31 -0500 received badge  Enthusiast
2015-02-23 13:07:20 -0500 asked a question Problems viewing planar segmentation in RVIZ?

I am attempting to perform a planar segmentation using input from a Kinect sensor but every time I subscribe to the segmentation topic in RVIZ nothing comes up, could anybody help me with this? After subscribing to the topic I get an error in the PointCloud2 status within RVIZ saying:

Transform [sender=/my_pcl_tutorial]
For frame []: Frame [] does not exist

And in the terminal used to run RVIZ i get the message:

[ WARN] [1424717651.536676279]: MessageFilter [target=camera_depth_optical_frame ]: Discarding message from [/my_pcl_tutorial] due to empty frame_id.  This message will only print once.
[ WARN] [1424717651.536922749]: Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty

Here is the part of my code where I am attempting the segmentation:

void
cloud_cb_2 (const sensor_msgs::PointCloud2ConstPtr& input)
{
 pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients); 
 pcl::PointIndices::Ptr inliers (new pcl::PointIndices); 
 pcl::SACSegmentation<pcl::PointXYZ> seg;
 pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ> ()),
        cloud_filtered(new pcl::PointCloud<pcl::PointXYZ> ()); 
 seg.setOptimizeCoefficients (true); 
 seg.setModelType (pcl::SACMODEL_PLANE); 
 seg.setMethodType (pcl::SAC_RANSAC); 
 seg.setDistanceThreshold (0.3); 
 seg.setMaxIterations (200);


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

 sensor_msgs::PointCloud2::Ptr cloud_seg(new sensor_msgs::PointCloud2 ());
 pcl::toROSMsg (*cloud_filtered, *cloud_seg);

 // Publish the dataSize 
 object_pub.publish (cloud_seg); 

  }


int
main (int argc, char** argv)
{
  // Initialize ROS
  ros::init (argc, argv, "my_pcl_tutorial");
  ros::NodeHandle nh;

// Create a ROS subscriber for the input point cloud
 ros::Subscriber sub_2 = nh.subscribe ("input", 100, cloud_cb_2);

// Create a ROS publisher for the output point cloud
 object_pub = nh.advertise<sensor_msgs::PointCloud2>("segmentation", 100);

  // Spin
  ros::spin ();
  return EXIT_SUCCESS;
}
2015-02-20 08:36:31 -0500 received badge  Popular Question (source)
2015-02-11 12:59:32 -0500 asked a question Using Kinect input instead of a .pcd file and viewing results in RVIZ?

I am trying to apply some filters and euclidean clustering to input from a Kinect sensor. Currently I am using a piece of code that calls in the "table_scene_lms400.pcd" but I would like to know how I can use input from a Kinect sensor rather than this .pcd file? I would also like to view the results in RVIZ? I know this involves subscribers and publishers and despite numerous attempts using tutorials, etc. I have not been able to accomplish this so was wondering if anybody has any code to do the above or could edit my own code/give me some tips to help me? I have included my code below. (I have tried following most online tutorials and guides but I am still struggling so any help would be greatly appreciated)

#include <ros/ros.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/kdtree/kdtree.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/segmentation/extract_clusters.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

ros::Publisher pub;

int 
main (int argc, char** argv)
{

  ros::init(argc, argv, "perception_node");
  ros::NodeHandle nh;


  // Read in the cloud data
  pcl::PCDReader reader;
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>), cloud_f (new pcl::PointCloud<pcl::PointXYZ>);
  reader.read ("table_scene_lms400.pcd", *cloud);
  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 (200);
  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 ...
(more)