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

tordalk's profile - activity

2013-02-06 07:27:44 -0500 received badge  Famous Question (source)
2013-02-06 07:27:44 -0500 received badge  Notable Question (source)
2012-11-27 16:26:00 -0500 received badge  Famous Question (source)
2012-10-23 11:56:36 -0500 received badge  Famous Question (source)
2012-10-12 05:07:54 -0500 received badge  Notable Question (source)
2012-10-12 00:08:11 -0500 commented question RViz displays "No messages received", what could be the reason?

Hello Martin, thanks for your reply. I finally got your point with the triggering. Unfortunately when I run your code a problem with the transformation appears, stating : Transform [sender=/some_init] For frame [some_frame]: Frame [some_frame] does not exist. How can I fix that?

2012-10-11 23:47:06 -0500 received badge  Popular Question (source)
2012-10-11 05:08:19 -0500 received badge  Editor (source)
2012-10-11 05:07:15 -0500 asked a question RViz displays "No messages received", what could be the reason?

Hi there, I have a code that goes like this and is very similar to an example code:

#include <ros/ros.h>
//#include <sensor_msgs/PointCloud2.h>
#include <pcl/ros/conversions.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <iostream>
using namespace std;

ros::Publisher pub;

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

  float x=0,y=0,z=0;
  pcl::PointCloud<pcl::PointXYZ>::Ptr msg (new pcl::PointCloud<pcl::PointXYZ>);
  msg->header.frame_id = "some_frame";
  msg->height = msg->width = 1;
  msg->points.push_back (pcl::PointXYZ(x, y, z));
  pub.publish (msg);
}

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

   ros::init (argc, argv, "some_init");
   ros::NodeHandle nh;
   ros::Subscriber sub = nh.subscribe ("output", 100, cloud_cb);
   pub = nh.advertise<sensor_msgs::PointCloud2> ("output", 100);
   ros::Rate loop_rate(1);
   while (nh.ok()){
   ros::spin ();
   loop_rate.sleep ();}
}

Don't be concerned about the function's input argument. I just need this later as soon as I am able to process some incoming data, publish and then visualize it with RViz. So far, I'd like to see one single point when I'm using RViz. However, it indicates "No messages received". Does anyone know what the fault is? Kevin

2012-10-05 11:39:13 -0500 received badge  Popular Question (source)
2012-10-04 23:11:00 -0500 received badge  Notable Question (source)
2012-10-04 22:21:41 -0500 asked a question What does "Assertion `cloud.points.size () == cloud.width * cloud.height' failed" mean?

Hello, after storing each points' coordinates of a point cloud in an array, then converting them to a ROSmessage and publishing them I get the following error message while running:

array: /opt/ros/fuerte/include/pcl-1.5/pcl/ros/conversions.h:248: void pcl::toROSMsg(const pcl::PointCloud<pointt>&, sensor_msgs::PointCloud2&) [with PointT = pcl::PointXYZ, sensor_msgs::PointCloud2 = sensor_msgs::PointCloud2_<std::allocator<void> >]: Assertion `cloud.points.size () == cloud.width * cloud.height' failed. Aborted (core dumped)

What does the last part about size, width and height mean?

Here's the part that might be the source of the error. The array's declared as 'field' with x,y,z as its elements.

msg->header.frame_id = "some_tf_frame";
msg->height = 1;
msg->width = pc.points.size();

//Storing the vector values in msg->points

for(i = msg->points.begin();i != msg->points.end();++i){
    j=distance(i,msg->points.begin());
    msg->points.push_back (pcl::PointXYZ(field[j].x,field[j].y,field[j].z));
}
sensor_msgs::PointCloud2 output;
pcl::toROSMsg(*msg,output);
pub.publish(output);
2012-10-02 01:00:23 -0500 received badge  Popular Question (source)
2012-10-01 22:46:14 -0500 answered a question Visualizing a point cloud previously stored in an array

Hello Lorenz, Do you mean by putting the array's values in the arguments of msg->points.push_back (pcl::PointXYZ( , , ))?

2012-10-01 05:17:36 -0500 asked a question Visualizing a point cloud previously stored in an array

Hello, I'd like to visualize a point cloud by using rviz. The points' coordinates were previously stored in an array that contains the x-, y- and z-coordinates of each point within a struct data type. I tried to store this data in the corresponding ~.x, ~.y, ~.z members of a pcl::PointXYZ object. However, I am not sure if this works and if so, how to make it to the publication of this cloud, so I can see something on rviz. It would be great if someone could tell how this works. Kevin