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

Hashir Shafi's profile - activity

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.

Base path: /home/hashir/industrial_training/training/work/1.2/catkin_ws
Source space: /home/hashir/industrial_training/training/work/1.2/catkin_ws/src
Build space: /home/hashir/industrial_training/training/work/1.2/catkin_ws/build
Devel space: /home/hashir/industrial_training/training/work/1.2/catkin_ws/devel
Install space: /home/hashir/industrial_training/training/work/1.2/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/hashir/industrial_training/training/work/1.2/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hashir/industrial_training/training/work/1.2/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/hashir/industrial_training/training/work/1.2/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/hashir/industrial_training/training/work/1.2/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hashir/industrial_training/training/work/1.2/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 11 packages in topological order:
-- ~~  - robotiq (metapackage)
-- ~~  - robotiq_c2_model_visualization
-- ~~  - robotiq_ethercat
-- ~~  - robotiq_c_model_control
-- ~~  - robotiq_force_torque_sensor
-- ~~  - robotiq_modbus_rtu
-- ~~  - robotiq_modbus_tcp
-- ~~  - robotiq_s_model_control
-- ~~  - robotiq_joint_state_publisher
-- ~~  - robotiq_action_server
-- ~~  - robotiq_s_model_visualization
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'robotiq'
-- ==> add_subdirectory(robotiq/robotiq)
-- +++ processing catkin package: 'robotiq_c2_model_visualization'
-- ==> add_subdirectory(robotiq/robotiq_c2_model_visualization)
-- +++ processing catkin package: 'robotiq_ethercat'
-- ==> add_subdirectory(robotiq/robotiq_ethercat)
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "soem" with any of
  the following names:

    soemConfig.cmake
    soem-config.cmake

  Add the installation prefix of "soem" to CMAKE_PREFIX_PATH or set
  "soem_DIR" to a directory containing one of the above files.  If "soem"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  robotiq/robotiq_ethercat/CMakeLists.txt:4 (find_package)


-- Could not find the required component 'soem'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "soem" with any of
  the following names:

    soemConfig.cmake
    soem-config.cmake

  Add the installation prefix of "soem" to CMAKE_PREFIX_PATH or set
  "soem_DIR" to a directory containing one of the above files.  If "soem"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent ...
(more)