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

PKumars's profile - activity

2022-03-08 12:34:34 -0500 received badge  Taxonomist
2022-02-07 13:22:02 -0500 marked best answer Conversion of pointCloud using pcl::fromROSMsg makes process much slower.

Dear All, I'm using ROS indigo and Kinect sensor for getting XYZ position. I'm using Conversion of pointCloud using pcl::fromROSMsg. But the problem is it makes process much slower.

I'm subscribing to /camera/depth_registered_points and /camera/depth/points. I'm synchronizing them with approximate synchronize.

Here goes a snippet of my code. main function

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

ros::NodeHandle nh;

// topic subscription
message_filters::Subscriber<Image> RGB_sub(nh, "/camera/rgb/image_color", 1);
message_filters::Subscriber<sensor_msgs::PointCloud2> PointCloud_sub(nh, "/camera/depth_registered/points", 1);
// synchronization policy
typedef sync_policies::ApproximateTime<Image, sensor_msgs::PointCloud2> MySyncPolicy;

// ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(10)
Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), RGB_sub, PointCloud_sub);
sync.registerCallback(boost::bind(&callback, _1, _2));

pubData = nh.advertise<std_msgs::Float32MultiArray>("pubData", 10);

ros::spin();
return 0;

}

callback function

void callback(const ImageConstPtr& image_rgb, const sensor_msgs::PointCloud2::ConstPtr& pCloud) { pcl::StopWatch watch;

// Solve all of perception here...
cv::Mat image_color = cv_bridge::toCvCopy(image_rgb)->image;

// new cloud formation 
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);

// new pcl::cloud from  sensormsg::cloud
pcl::fromROSMsg (*pCloud, *cloud);

}

it will be a great help if anyone can point out error or guide me in making process faster. because it makes my processing much slower. 30Hz to 10-12Hz.

Thanks

Regards, Prasanna

2020-09-09 21:37:03 -0500 received badge  Nice Question (source)
2020-09-06 21:08:49 -0500 received badge  Necromancer (source)
2020-09-06 21:08:49 -0500 received badge  Self-Learner (source)
2020-05-14 15:29:26 -0500 received badge  Famous Question (source)
2020-05-14 15:29:26 -0500 received badge  Notable Question (source)
2020-05-14 15:29:26 -0500 received badge  Popular Question (source)
2018-11-05 11:56:22 -0500 received badge  Self-Learner (source)
2018-06-15 01:47:24 -0500 commented answer Project openni_tracker skeleton to Image Coordinates

ping me in skype please. prasanna.routray97. I cannot explain everything here in forum. You need to debug and I can assi

2018-06-08 20:09:42 -0500 commented question Kinect Depth Image for tracking moving object

Yes I did find. But Currently I'm working in a commercial project.

2018-05-30 18:14:13 -0500 received badge  Famous Question (source)
2018-05-30 18:14:13 -0500 received badge  Notable Question (source)
2018-03-21 08:05:28 -0500 received badge  Popular Question (source)
2018-03-13 05:02:47 -0500 edited answer Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Sorry for the silly question. I solved the issue. Here is a solution to my problem regarding the publish rate of RGB im

2018-03-13 05:02:09 -0500 received badge  Associate Editor (source)
2018-03-13 05:02:09 -0500 edited answer Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Sorry for the silly question. I solved the issue. Here is a solution to my problem regarding the publish rate of RGB im

2018-03-13 05:00:09 -0500 edited question Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Astra Pro RGB & Depth publishing rate not quite same. Hello all, I want to use Orbbec Astra Pro in ROS Indigo

2018-03-13 04:59:43 -0500 marked best answer Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Hello all, I want to use Orbbec Astra Pro in ROS Indigo inside Ubuntu 14.04. I have installed the ROS compatible OPenNI2 and now able to run the launch code. The Astra Pro Camera starts perfectly without any issue.

Now the problem is when i check the publishing rate of RGB and Depth stream I see that they are not quite same.

Here are the outputs..

image description

image description

What can I do to get 30hz publish rate for both RGB and Depth

Cheers,

Prasanna

2018-03-13 04:58:09 -0500 answered a question Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Sorry for the silly question. I solved the issue. Here is a solution to my problem regarding the publish rate of RGB im

2018-03-13 04:55:29 -0500 commented question Astra Pro RGB & Depth publishing rate not quite same. [Closed]

OK Sir, it was a mistake. It won't be repeated. But I'm closing this issue as I have found the bug.

2018-03-13 01:21:31 -0500 asked a question Astra Pro RGB & Depth publishing rate not quite same. [Closed]

Astra Pro RGB & Depth publishing rate not quite same. Hello all, I want to use Orbbec Astra Pro in ROS Indigo

2017-10-25 02:47:04 -0500 received badge  Famous Question (source)
2017-02-08 07:40:17 -0500 commented answer tf Listener for OpenNI Tracker [Solved]

yes. skelCord.cpp

2017-02-07 09:50:58 -0500 commented answer tf Listener for OpenNI Tracker [Solved]

you can run that node typing the command in terminal. rosrun package_name node_name but you must run kinect node first like: roslaunch openni_..... check the cmakelists.txt and compile the package before running the program node. if you have any doubt in running program then please see ROS Tutorial.

2016-10-18 06:56:06 -0500 answered a question Conversion of pointCloud using pcl::fromROSMsg makes process much slower.

Here is a sample that can solve your problem. This is a snippet and it should work properly with normal rate of 30Hz. If this is not solving then let me know about the exact problem.

//// c++ headers
#include <iostream>
// ROS headers
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
// point cloud definition
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
// namspace
using namespace std;
using namespace sensor_msgs;


void callback(const sensor_msgs::PointCloud2ConstPtr& pCloud)
{
// new cloud formation 
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromROSMsg (*pCloud, *cloud);

// cloud is the one you are interested about.
}


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

ros::NodeHandle nh;
ros::Rate rate(30); // frequency of operation

// subscribe
ros::Subscriber sub = nh.subscribe ("/camera/depth/points", 1, callback);


ros::spin();
return 0;
}

Regards, Prasanna

2016-10-17 13:07:41 -0500 commented question Conversion of pointCloud using pcl::fromROSMsg makes process much slower.

do you want synchronization? If not then this not a problem and you can run at 30Hz. let me know about it. I want to know the exact thing that you want to do and not just testing and hit-and-trial kind of thing. I hope you understood. Reply soon and I'll try to find a solution..

2016-10-17 12:41:19 -0500 received badge  Famous Question (source)
2016-10-16 07:57:22 -0500 received badge  Famous Question (source)
2016-10-16 05:08:39 -0500 commented question Kinect Depth Image for tracking moving object

I used color image to detect the object according to color and then used point cloud to get 3D position of that object. you can also use depth image to get 3D position but for that you need camera parameters.

2016-10-15 09:35:43 -0500 commented question Kinect Depth Image for tracking moving object

hello, I was not trying to down-sample point cloud data. i was trying to detect and track a moving object using only depth image. point cloud data and other things are not considered in this case. I hope you understand the main reason for this question. I stopped this method and tried another method

2016-09-27 03:43:12 -0500 commented answer tf Listener for OpenNI Tracker [Solved]

Hello, this should work perfectly. There are several other things that you must take care during execution of this program. there should exist two frames("/neck_1", "/openni_depth_frame"), then you can get transform using TF listener. My suggestion is that you should first check it in RViz

2016-08-18 03:05:36 -0500 received badge  Famous Question (source)
2016-07-24 06:23:58 -0500 received badge  Notable Question (source)
2016-07-07 09:21:50 -0500 received badge  Notable Question (source)
2016-07-07 09:21:50 -0500 received badge  Famous Question (source)
2016-06-15 18:44:41 -0500 received badge  Popular Question (source)
2016-06-07 03:32:53 -0500 received badge  Famous Question (source)
2016-05-31 00:48:56 -0500 received badge  Notable Question (source)
2016-05-12 21:49:46 -0500 received badge  Notable Question (source)
2016-04-25 12:34:49 -0500 received badge  Popular Question (source)
2016-04-22 12:38:39 -0500 received badge  Famous Question (source)
2016-04-11 05:00:25 -0500 received badge  Famous Question (source)
2016-04-09 20:40:41 -0500 received badge  Famous Question (source)
2016-04-07 05:37:05 -0500 received badge  Self-Learner (source)
2016-04-07 05:37:05 -0500 received badge  Teacher (source)