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

Cloud values are not loaded

asked 2012-01-24 23:11:47 -0500

alfa_80 gravatar image

My code snippet in order to build a point cloud as below:

static tf::TransformBroadcaster tfb;
tf::Transform xform;
xform.setOrigin(tf::Vector3(pose3D_LD2.pose.position.x, pose3D_LD2.pose.position.y, pose3D_LD2.pose.position.z));
xform.setRotation(tf::Quaternion(previous_poseLD_.pose.orientation.x, previous_poseLD_.pose.orientation.y, previous_poseLD_.pose.orientation.z, previous_poseLD_.pose.orientation.w));
tfb.sendTransform(tf::StampedTransform(xform, ros::Time(pose3D_LD2.header.stamp), "base_link", "laser"));
tfListener_.waitForTransform("base_link", "laser", previous_scan_.header.stamp, ros::Duration(2.0));
projector_.transformLaserScanToPointCloud("base_link", previous_scan_, cloud, tfListener_);

It neither gives error and nor emits warning messages. However, when I run "rostopic echo /cloud" it gives the following information:

header: 
  seq: 198
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: cloud
points: []
channels: []
---
header: 
  seq: 199
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: cloud
points: []
channels: []
---
header: 
  seq: 200
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: cloud
points: []
channels: []
---
header: 
  seq: 201
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: cloud
points: []
channels: []
---

It seems that the point cloud is not successfully configured. Apparently, when running the rviz, it complaints that "no messages received".

Any remedy for this weird behavior?

Thanks in advance.

edit retag flag offensive close merge delete

Comments

Does the incoming LaserScan have any messages coming in?
DimitriProsser gravatar image DimitriProsser  ( 2012-01-25 00:23:43 -0500 )edit
It's just solved! Thanks anyway.
alfa_80 gravatar image alfa_80  ( 2012-01-25 02:42:22 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-01-25 02:41:37 -0500

alfa_80 gravatar image

The solution can be referred here.

edit flag offensive delete link more
1

answered 2012-01-25 00:28:49 -0500

Lorenz gravatar image

Your code looks good as far as I can see. Are you sure that previous_scan_ is actually filled with points? I would add two debugging statements at the end of your code snippet to check if the number of points in the laser scan and the number of points in the point cloud actually differ:

ROS_DEBUG("Laser scan: %lu", (unsigned long)previous_scan_.ranges.size());
ROS_DEBUG("Point cloud: %lu", (unsigned long)cloud.points.size());

Note that your node needs to have the log level set to debug to print the output. If you feel lazy, you can also use ROS_INFO which should be displayed per default.

If you have something greater than zero in the scan but zero points in the cloud then something is probably wrong with your laser scan's metadata, maybe range_min or range_max.

edit flag offensive delete link more

Comments

It's just solved! Thanks anyway. I'm just curios about "Note that your node needs to have the log level set to debug..", how do I do this normally? Is it just tick log option in the rxconsole, or is there another way of doing it?
alfa_80 gravatar image alfa_80  ( 2012-01-25 02:44:53 -0500 )edit
There is also a config file. See here for more information on that: http://www.ros.org/wiki/rosconsole
Lorenz gravatar image Lorenz  ( 2012-01-25 02:46:59 -0500 )edit
Thanks anyway..
alfa_80 gravatar image alfa_80  ( 2012-01-25 04:17:58 -0500 )edit

Question Tools

Stats

Asked: 2012-01-24 23:11:47 -0500

Seen: 323 times

Last updated: Jan 25 '12