Ask Your Question
2

Converting a PointCloud topic into LaserScan topic

asked 2013-08-04 13:27:38 -0500

mozcelikors gravatar image

updated 2013-11-14 11:28:48 -0500

tfoote gravatar image

Hello,

I'm working on a project that uses Kinect for robot navigation. We use ROS Groovy as distro and Gazebo for simulation, and have sensor and model plugins for the robot model. We have manipulated kinect model using the .sdf file and added libgazebo_ros_openni_kinect.so file as plugin. So now, whenever we launch the robot model in Gazebo, it publishes topics like these: /cam3d/depth/image_raw, /cam3d/depth/points, /cam3d/rgb/image_raw ...

Our model.sdf contains this part for the kinect model:

<plugin name="kinect" filename="libgazebo_ros_openni_kinect.so" >
      <alwaysOn>true</alwaysOn>
      <updateRate>10</updateRate>
      <pointCloudCutoff>0.001</pointCloudCutoff>
      <imageTopicName>/cam3d/rgb/image_raw</imageTopicName>
      <pointCloudTopicName>/cam3d/depth/points</pointCloudTopicName>
      <cameraInfoTopicName>/cam3d/camera_info</cameraInfoTopicName>
      <depthImageTopicName>/cam3d/depth/image_raw</depthImageTopicName>
      <depthImageInfoTopicName>/cam3d/depth/camera_info</depthImageInfoTopicName>
      <frameName>kinect</frameName>
      <distortion_k1>0.00000001</distortion_k1>
      <distortion_k2>0.00000001</distortion_k2>
      <distortion_k3>0.00000001</distortion_k3>
      <distortion_t1>0.00000001</distortion_t1>
      <distortion_t2>0.00000001</distortion_t2>
      <imageTopicName>kinectimage</imageTopicName>
      <pointCloudTopicName>pcloud</pointCloudTopicName>
      <depthImageTopicName>depth</depthImageTopicName>
      <depthImageCameraInfoTopicName>depthcamerainfo</depthImageCameraInfoTopicName>
 </plugin>

Every package that ROS offers are used with launch files and is included with openni. Since we intend to use only robot model to achieve this, I have to find a way to write a script or manipulate the existing script, just to convert a PointCloud topic (comes from model plugin) to LaserScan topic (output). Is something like that possible? I found pointcloud_to_laserscan package which has source files like cloud_to_scan.cpp cloud_throttle.cpp, but they also use openni and needed to be called from launch file. Any help regarding this issue, or any other easier methods to deal with this situation will be greately appreciated. Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-08-04 18:42:37 -0500

Hey you can use the pointcloud_to_laserscan package without including openni package. You can edit the launch file that come with the package and change the input pointcloud name according to your needs, Just make sure tf is defined correctly for pointcloud.

edit flag offensive delete link more

Comments

I've been trying it for almost a week and still got nothing. When I disable the openni parts on the launch file, The /kinect_laser node is published but there is not any topics. Could you please help me manipulate the launch file?

mozcelikors gravatar imagemozcelikors ( 2013-08-04 23:51:38 -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

1 follower

Stats

Asked: 2013-08-04 13:27:38 -0500

Seen: 395 times

Last updated: Aug 04 '13