ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2017-10-04 15:09:39 -0500 | received badge | ● Famous Question (source) |
2017-01-18 19:10:19 -0500 | received badge | ● Notable Question (source) |
2016-12-07 11:31:44 -0500 | received badge | ● Famous Question (source) |
2016-09-27 19:34:13 -0500 | received badge | ● Popular Question (source) |
2016-09-27 19:34:13 -0500 | received badge | ● Notable Question (source) |
2016-07-26 07:27:11 -0500 | received badge | ● Famous Question (source) |
2016-07-14 22:44:11 -0500 | received badge | ● Popular Question (source) |
2016-07-11 23:53:07 -0500 | received badge | ● Scholar (source) |
2016-07-11 23:51:33 -0500 | asked a question | Problem in implementing voxel grid filter on the point cloud using Kinect I am working on ROS Indigo Igloo with platform Ubuntu 14.04. I have to implement voxel grid filter on the real time point cloud obtained by Kinect v1.1. I am following a tutorial http://aeswiki.datasys.swri.edu/rosit... from the tutorial series http://aeswiki.datasys.swri.edu/rosit... . The tutorial is written for working with a provided bag file in Exercise 4.4 but I want to implement it on the point cloud obtained by Kinect in the run time. Following is the node I am running. #include <ros ros.h=""> #include <tf transform_datatypes.h=""> #include <tf transform_listener.h=""> #include <tf transform_broadcaster.h=""> #include <sensor_msgs pointcloud2.h=""> //hydro // PCL specific includes #include <pcl_conversions pcl_conversions.h=""> //hydro #include "pcl_ros/transforms.h" #include <pcl filters="" voxel_grid.h=""> //#include <pcl filters="" passthrough.h=""> //#include <pcl sample_consensus="" method_types.h=""> //#include <pcl sample_consensus="" model_types.h=""> //#include <pcl segmentation="" sac_segmentation.h=""> //#include <pcl filters="" extract_indices.h=""> //#include <pcl segmentation="" extract_clusters.h=""> //#include <pcl kdtree="" kdtree_flann.h=""> //#include <pcl filters="" statistical_outlier_removal.h=""> int main(int argc, char argv[]) { / * INITIALIZE ROS NODE */ ros::init(argc, argv, "perception_node"); ros::NodeHandle nh; ros::NodeHandle priv_nh_("~"); /* * SET UP PARAMETERS (COULD BE INPUT FROM LAUNCH FILE/TERMINAL) */ std::string cloud_topic, world_frame, camera_frame; world_frame="camera_depth_optical_frame"; camera_frame="camera_link"; cloud_topic="camera/depth_registered/points"; /* * SETUP PUBLISHERS */ ros::Publisher object_pub, cluster_pub, pose_pub; object_pub = nh.advertise<sensor_msgs::pointcloud2>("object_cluster", 1); cluster_pub = nh.advertise<sensor_msgs::pointcloud2>("primary_cluster", 1); while (ros::ok()) { /* * LISTEN FOR POINTCLOUD */ std::string topic = nh.resolveName(cloud_topic); ROS_INFO_STREAM("Cloud service called; waiting for a PointCloud2 on topic "<< topic); sensor_msgs::PointCloud2::ConstPtr recent_cloud = ros::topic::waitForMessage<sensor_msgs::pointcloud2>(topic, nh); /* * TRANSFORM POINTCLOUD FROM CAMERA FRAME TO WORLD FRAME */ tf::TransformListener listener; tf::StampedTransform stransform; try { listener.waitForTransform(world_frame, camera_frame, ros::Time::now(), ros::Duration(6.0)); listener.lookupTransform(world_frame, camera_frame, ros::Time(0), stransform); } catch (tf::TransformException ex) { ROS_ERROR("%s",ex.what()); } sensor_msgs::PointCloud2 transformed_cloud; pcl_ros::transformPointCloud(world_frame, *recent_cloud, transformed_cloud, listener); /* * CONVERT POINTCLOUD ROS->PCL */ pcl::PointCloud<pcl::pointxyz> cloud; pcl::fromROSMsg (transformed_cloud, cloud); /* ======================================== * Fill Code: VOXEL GRID * ========================================/ pcl::PointCloud<pcl::pointxyz>::Ptr cloud_ptr (new pcl::PointCloud<pcl::pointxyz> (cloud)); pcl::PointCloud<pcl::pointxyz>::Ptr cloud_voxel_filtered (new pcl::PointCloud<pcl::pointxyz> ()); pcl::VoxelGrid<pcl::pointxyz> voxel_filter; voxel_filter.setInputCloud (cloud_ptr); voxel_filter.setLeafSize (float(0.005), float(0.005), float(0.005)); voxel_filter.filter (cloud_voxel_filtered); ROS_INFO_STREAM("Original cloud had " << cloud_ptr->size() << " points"); ROS_INFO_STREAM("Downsampled cloud with " << cloud_voxel_filtered->size() << " points"); /* ======================================== * Fill Code: PASSTHROUGH FILTER(S) * ========================================*/ //filter in x //filter in y //filter in z /* ======================================== * Fill Code: CROPBOX (OPTIONAL) * ========================================*/ /* ======================================== * Fill Code: PLANE SEGEMENTATION * ========================================*/ /* ======================================== * Fill Code: PUBLISH PLANE MARKER (OPTIONAL) * ========================================*/ /* ======================================== * Fill Code: EUCLIDEAN CLUSTER EXTRACTION (OPTIONAL/RECOMMENDED) * ========================================*/ /* ======================================== * Fill Code: STATISTICAL OUTLIER REMOVAL (OPTIONAL) * ========================================*/ /* ======================================== * CONVERT POINTCLOUD PCL->ROS * PUBLISH CLOUD * Fill Code: UPDATE AS NECESSARY * ========================================/ sensor_msgs::PointCloud2::Ptr pc2_cloud (new sensor_msgs::PointCloud2); pcl::toROSMsg(cloud_voxel_filtered, *pc2_cloud); pc2_cloud->header.frame_id=world_frame; pc2_cloud->header.stamp=ros::Time::now(); object_pub.publish(pc2_cloud); /* ======================================== * Fill Code: PUBLISH OTHER MARKERS (OPTIONAL) * ========================================*/ /* ======================================== * BROADCAST TRANSFORM (OPTIONAL) * ========================================*/ /* ======================================== * Fill Code: POLYGONAL SEGMENTATION (OPTIONAL) * ========================================*/ } return 0; } And I am getting the following error. In the rviz window when I subscribe to ... (more) |
2016-07-08 04:00:36 -0500 | received badge | ● Notable Question (source) |
2016-07-08 04:00:21 -0500 | received badge | ● Editor (source) |
2016-07-08 03:59:30 -0500 | asked a question | how can I get object pose through Kinect using OpenCV in conjunction with ROS Indigo ? I am working on a dual arm robot. My job is to get the accurate position of the object. For simplicity, the object can be of known size and shape. I am using Kinect v1.1 with ROS Indigo on Ubuntu 14.04. Since I am new to ROS, it would be great if you explain in detail. |
2016-06-24 04:09:57 -0500 | received badge | ● Popular Question (source) |
2016-06-18 10:05:31 -0500 | received badge | ● Student (source) |
2016-06-18 05:00:36 -0500 | asked a question | Invoking "make cmake_check_build_system" failed I am using ROS indigo with Ubunty Trusty 14.04. I am following the ROS industrial tutorials and currently at http://aeswiki.datasys.swri.edu/rosit... . This is not the first time that I am facing this problem. Whenever I try to build my workspace after cloning any repository in the src sub-directory of my work space, I get errors. I had just cloned robotiq repository from http://github.com/ros-industrial and tried to build my workspace by typing catkin_make in the workspace but I got the following on terminal. (more) |