Converting a PointCloud topic into LaserScan topic
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.