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

laser_assembler not gathering scan lines

asked 2012-01-27 06:40:12 -0500

alfa_80 gravatar image

updated 2012-01-30 18:16:48 -0500

I attempt to gather scan lines over time using laser_assembler package. I use this package by putting some lines of XML code in my launch file. I have in my code, one cloud variable already(please refer below). But then, it only gives one cloud topic in the option tab in rviz, after clicking it, it doesn't assemble. What could go wrong?

Thanks in advance.

The code snippet(resides in a callback function):

      sensor_msgs::PointCloud cloud;

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

      try
      {
        projector_.transformLaserScanToPointCloud("base_link", previous_scan_, cloud, tfListener_);           
      }
      catch (tf::TransformException ex)
      {
        ROS_WARN("Problem: %s", ex.what());
      }

In my launch file:

  <node type="point_cloud_assembler" pkg="laser_assembler" name="my_assembler">
    <remap from="cloud" to="cloud"/>
    <param name="max_clouds" type="int" value="400" />
    <param name="fixed_frame" type="string" value="base_link" />
  </node>

EDIT

My code snippet:

      try
      {
        projector_.transformLaserScanToPointCloud("base_link", previous_scan_, cloud, tfListener_);


        ros::service::waitForService("assemble_scans");
        ros::ServiceClient client = n.serviceClient<AssembleScans>("assemble_scans");
        AssembleScans srv;

        srv.request.begin = ros::Time(0.00);
        srv.request.end   = ros::Time(100.00);
        if (client.call(srv))
        {
           ROS_INFO("Got cloud with %u points\n", srv.response.cloud.points.size());
        }
        else
           ROS_INFO("Service call failed\n");

      }
      catch (tf::TransformException ex)
      {
        ROS_WARN("Problem: %s", ex.what());
      }

Part of my launch file:

  <node type="point_cloud_assembler" pkg="laser_assembler" name="my_assembler"> 
    <remap from="/cloud" to="cloud"/>   
    <param name="max_clouds" type="int" value="400" /> 
    <param name="fixed_frame" type="string" value="base_link" /> 
  </node> 

  <node type="periodic_snapshotter" pkg="laser_assembler" name="periodic_snapshotter"> 
    <remap from="/cloud" to="cloud"/>   
    <param name="max_clouds" type="int" value="400" /> 
    <param name="fixed_frame" type="string" value="base_link" /> 
  </node>

The problem now is that in rviz when I click to "/cloud"(I could only see each scan line being updated) or "/assembled_cloud"(I could only see the related frames including moving /world frame), I couldn't be able to see the gathered cloud.

At the moment, there is a warning message coming in rxconsole as "msg: Published Cloud with 0 points" from periodic_snapshotter node.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-01-27 07:07:35 -0500

arebgun gravatar image

updated 2012-01-27 07:08:20 -0500

laser_scan_assembler doesn't publish assembled clouds by default, you have to call assemble_scans service and pass in the begin and end times to get the composite cloud for that time period (all this is described in section 1.4 of this tutorial).

edit flag offensive delete link more

Comments

Thanks, I'll try this.
alfa_80 gravatar image alfa_80  ( 2012-01-27 07:17:18 -0500 )edit
@arebgun: Could you see my above update, still something not yet working. Thanks in advance.
alfa_80 gravatar image alfa_80  ( 2012-01-29 19:48:46 -0500 )edit
@alfa_80: are your cloud timestamps range from 0 to 100? You should check what the timestamps of laser scans that get converted to point clouds are.
arebgun gravatar image arebgun  ( 2012-01-30 10:40:44 -0500 )edit
@arebgun: Yes, it is. It starts at 24.182s and ends at 79.268s in specific, this is also verified by rostopic echo /scan.
alfa_80 gravatar image alfa_80  ( 2012-01-30 13:29:58 -0500 )edit
In the wiki(http://ros.org/wiki/laser_assembler), is it right the following line on the webpage [srv.request.begin = ros::Time(0,0);]? Is it allowed to put comma there? What does it mean by (0,0), if you know..
alfa_80 gravatar image alfa_80  ( 2012-01-30 13:34:55 -0500 )edit
1

answered 2012-01-27 06:44:31 -0500

DimitriProsser gravatar image

updated 2012-01-27 07:02:42 -0500

Are you publishing your cloud to the "cloud" topic?

EDIT:

Try assembling the cloud with respect to a different frame ( a fixed one like "/odom" or "/world" ).

edit flag offensive delete link more

Comments

Yes, it is. Even if I cross check using rostopic echo /cloud, it gives all the coordinates(unassembled one I think) there.
alfa_80 gravatar image alfa_80  ( 2012-01-27 06:49:55 -0500 )edit
The fixed_frame is named base_link as well, as in the above code snippet. But I don't get this(<remap from="cloud" to="my_cloud_in"/>) from its tutorial, my_cloud_in is the cloud in my code, right?
alfa_80 gravatar image alfa_80  ( 2012-01-27 07:04:13 -0500 )edit
You mean setting /world, instead of my current cloud topic of /cloud?
alfa_80 gravatar image alfa_80  ( 2012-01-27 07:08:07 -0500 )edit
@DimitriProsser:I've just updated as above, if you have time, could you have a look.
alfa_80 gravatar image alfa_80  ( 2012-01-29 20:09:09 -0500 )edit

Question Tools

Stats

Asked: 2012-01-27 06:40:12 -0500

Seen: 792 times

Last updated: Jan 30 '12