Ask Your Question
0

pointcloud_to_laserscan returns inf in ROS indigo.

asked 2016-09-24 10:29:25 -0500

sradmard gravatar image

Hi,

I am using ROS indigo under UBUNTU 14.04. I am also simulating a turtlebot equipped with kinect camera in v-rep and would like to run gmapping through ROS. Since gmapping requires laserscan data, and I can only publish pointcloud data to ROS from v-rep, I need to use pointcloud_to_laserscan package. However I haven't been successful so far, and this is what I've done so far:

I can publish the simulated kinect data to ROS as sensor_msgs/PointCloud2 type on a topic called /cloud_in. This pointcloud data is being published with respect to frame_id of base_scan. I also publish some frames in my tf tree including world, base_link (the robot frame), and base_scan (the kinect frame) with the following hierarchy:

world -> base_link -> base_scan

Then, when I run my pointcloud_to_laserscan launch file, the laserscan data is supposed to be published on /scan topic. However, depending on what I set for the target_frame parameter in my launch file, I run into different issues. Here are the different cases:

1- If "target_frame" is not set in the launch file, then it will publish laserscan data on /scan topic with respect to the same frame_id of base_scan. If I echo the pointcloud data from /cloud_in topic, I see the frame_id to be /base_scan. If I also echo the /scan topic, its frame_id is also /base_scan. The problem in this setting is that /scan topic returns manly inf values, which is incorrect given my simulated environment. In addition, I do not get anything by running the following command:

$ rosparam get /pointcloud_to_laserscan/target_frame

From my understanding of similar posts on the web, this is apparently because of incorrect frame setting and transformation, so I did the following next.

2- If "target_frame" is set to base_link or world in the launch file, then nothing gets published on /scan topic. By running rqt_console, I see the following error:

Transform failure: Invalid argument "/base_scan" passed to lookupTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:

Location:~/v-rep_ws/src/pointcloud_to_laserscan/src/pointcloud_to_laserscan_ nodelet.cpp:PointCloudToLaserScanNodelet::cloudCb:185

In this case the following command returns base_link or world depending on the launch file parameter.

$ rosparam get /pointcloud_to_laserscan/target_frame

3- If "target_frame" is set to /base_link or /world in the launch file, then nothing gets published on /scan topic again. By running rqt_console, I see the following error:

Transform failure: Invalid argument "/base_link" passed to lookupTransform argument target_frame in tf2 frame_ids cannot start with a '/' like:

Location:~/v-rep_ws/src/pointcloud_to_laserscan/src/pointcloud_to_laserscan_ nodelet.cpp:PointCloudToLaserScanNodelet::cloudCb:185

In this case the following command returns /base_link or /world depending on the launch file parameter.

$ rosparam get /pointcloud_to_laserscan/target_frame

I would really appreciate any hint or help on these issues.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-10 13:15:09 -0500

sradmard gravatar image

I found the solution to the problem and wanted to share. The source of the problem was using v-rep simulation environment to publish point cloud data. I used the publisher “simros_strmcmd_get_depth_sensor_data” in v-rep to publish PointCloud2 data to ROS. The current version of v-rep publishes the frame_id of the header of the published PointClouad2 message in ROS with a preceding “/”. This was compatible with tf, but is not compatible with tf2 standard since there was a change in tf2, that frame_ids cannot start with an “/” anymore. Therefore, there will be a problem in ROS if we try to apply tf2 to the published data of “simros_strmcmd_get_depth_sensor_data”. I managed to debug the “simros_strmcmd_get_depth_sensor_data” source file so that it would publish PointCloud2 with a frame_id that does not contain a preceding "/". More detail on the debugging is provided here: http://www.forum.coppeliarobotics.com/viewtopic.php?f=5&t=6188

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-09-24 10:29:25 -0500

Seen: 795 times

Last updated: Nov 10 '16