Ask Your Question
1

laser_assembler not gathering clouds

asked 2012-02-13 08:05:57 -0500

alfa_80 gravatar image

updated 2012-02-13 09:27:12 -0500

I've been trying to use laser_assembler package to gather every single cloud that is publish by another node. For this, I've created a client node to define the service needed from the laser_assembler package(included in launch file). However, I still couldn't be able to have the clouds gathered.

The client code:

    void AssemblerClient::useAssembler(const sensor_msgs::LaserScanConstPtr& scan_ptr)
    {
      ROS_INFO("Assembler service is being used");
      ros::service::waitForService("assemble_scans");
      ros::ServiceClient client = n.serviceClient<AssembleScans>("assemble_scans");
      AssembleScans srv;
      srv.request.begin = ros::Time(0);
      srv.request.end   = ros::Time::now();
      if (client.call(srv))
        ROS_INFO("Got cloud with %u points\n", srv.response.cloud.points.size());
      else
        ROS_INFO("Service call failed\n");
    }

In the 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="4000" />
  <param name="fixed_frame" type="string" value="world" />
</node>

<node pkg="pcd_bot" type="assembler_client_node" name="assembler_client_node">
</node>

Am I missing something?

Thanks in advance.

EDIT

No error at all I receive but in the rviz, I even cannot choose/tick for "assemble_scans" topic of type PointCloud.

I've added the following 2 lines at the bottom of the above code snippet(but still doesn't work):

gathered_cloud = srv.response.cloud;
gathered_cloud_publisher_.publish(gathered_cloud);
edit retag flag offensive close merge delete

Comments

What is the error exactly?'

DimitriProsser gravatar imageDimitriProsser ( 2012-02-13 08:10:21 -0500 )edit

What is the error exactly?

DimitriProsser gravatar imageDimitriProsser ( 2012-02-13 08:10:24 -0500 )edit

No error at all but in the rxconsole I receive this info "Got cloud with 0 points" and in the rviz of course, it displays only one scan line. In the rviz, I even cannot choose/tick for "assemble_scans" topic.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 08:12:57 -0500 )edit

@DimitriProsser: Do I need to subscribe explicitly to the "assemble_scans" topic that has been provided by laser_assembler package?

alfa_80 gravatar imagealfa_80 ( 2012-02-13 08:27:46 -0500 )edit

Supposedly, will the laser_assembler publish a topic on "assemble_scans"? When I rostopic list, I didn't see the "assemble_scans" listed.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 08:32:02 -0500 )edit

@alfa_80 assemble_scans is not a topic it's a service, and you can't subscribe to it to see the assembled cloud. In your code you correctly printing out the cloud size, you can choose to publish this cloud on some topic. But it looks like the resulting cloud has 0 points, so there's some other issue

arebgun gravatar imagearebgun ( 2012-02-13 08:39:52 -0500 )edit

For example, pr2_laser_snapshotter (which uses the assemble_scans service) publishes assembled clouds when the tilting laser does a full up-down sweep.

arebgun gravatar imagearebgun ( 2012-02-13 08:43:51 -0500 )edit

@arebgun & @DimitriProsser: At the end, I got this in the rxconsole "Got cloud with 89280 points ", It just needs a little bit time to get that. But then, why I cannot choose "assemble_scans" in rviz of type PointCloud? Any idea on how to resolve this?

alfa_80 gravatar imagealfa_80 ( 2012-02-13 09:01:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-02-13 09:09:17 -0500

DimitriProsser gravatar image

The reason that you are not seeing any data published in Rviz is that laser_assembler does not publish the resulting compiled cloud. In your assembler client, you must perform the publishing yourself. You can obtain the resulting cloud from srv.response.cloud and then publish it with a standard publisher. This will allow you to visualize in Rviz.

edit flag offensive delete link more

Comments

I've added 2 lines of code as my update above. I can now tick to "gathered_cloud", but, only one static scan line appears in the rviz.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 09:33:08 -0500 )edit

Does the laser scanner move? If it doesn't, all the scans will overlap and it will look like a single scan.

DimitriProsser gravatar imageDimitriProsser ( 2012-02-13 09:35:19 -0500 )edit

Yes, the laser scanner is moving around. I don't think they overlap at the moment.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 09:38:32 -0500 )edit

Is the transform also moving? Also, is the "cloud" topic in the same frame as the moving sensor?

DimitriProsser gravatar imageDimitriProsser ( 2012-02-13 09:42:53 -0500 )edit

Yes, the transform is moving. The cloud(in fact, it's only one scan line) is static while the base_link and laser are moving.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 09:47:27 -0500 )edit

The cloud data is in the form of (x, y, z) with respect to a certain frame. If that frame is not moving, the cloud will not move.

DimitriProsser gravatar imageDimitriProsser ( 2012-02-13 09:50:10 -0500 )edit

It somehow works when I change the fixed_frame value for the laser_assembler parameter in the launch file, however, the cloud is not linearly gathered. I think it could be the problem with TF.

alfa_80 gravatar imagealfa_80 ( 2012-02-13 10:01:06 -0500 )edit

Should the cloud be moving? It's too difficult then, to see every good changes/addition in the cloud frame over time. And, we don't need to define cloud frame right?

alfa_80 gravatar imagealfa_80 ( 2012-02-13 19:15:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-02-13 08:05:57 -0500

Seen: 924 times

Last updated: Feb 13 '12