Using pcl_to_scan without OpenNI to convert PointCloud into LaserScan [closed]

asked 2013-08-01 01:37:14 -0500

mozcelikors gravatar image

updated 2013-11-14 11:29:18 -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>

We intend to use pcl_to_scan package in order to convert the point cloud data into LaserScan. I've done a little research about it. People say that I have to create a launch file to use the pcl_to_scan package. I took a look at the example launch files and realized that they use openni.launch and openni_manager in order to convert /camera/depth/points into laserscan data. I need to manipulate that launch file in order to work with the model that we have created, since we're not using openni at the moment.

The launch file that they offer is like this:

<launch>
  <!-- kinect nodes -->
  <include file="$(find openni_launch)/launch/openni.launch"/>

  <!-- openni_manager -->
  <node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>

  <!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager">
    <param name="max_rate" value="2"/>
    <remap from="cloud_in" to="/camera/depth/points"/>
    <remap from="cloud_out" to="cloud_throttled"/>
  </node>

  <!-- fake laser -->
  <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager">
  <!--Setting the parameters for obtaining scan data within desired ranges-->
    <param name="max_height" value="0.30"/>
    <param name="min_height" value="-0.15"/>
    <param name="angle_min" value="-0.5233"/>
    <param name="angle_max" value="0.5233"/>
    <param name="range_min" value="0.50"/>
    <param name="range_max" value="6.0"/>
    <param name="output_frame_id" value="/camera_depth_frame"/>
    <remap from="cloud" to="cloud_throttled"/>
  </node>
</launch>

I've also stumbled into depthimage_to_laserscan and pointcloud_to_laserscan packages, that can also be useful for dealing with this issue. Any help regarding the pcl_to_scan issue, or any other easier methods to deal with this situation will be greately appreciated. Thanks in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-04-27 01:53:06.823639