ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to replace kinect data by sending pointclouds?

asked 2012-11-07 21:12:33 -0500

updated 2012-11-08 01:23:20 -0500

I recently tried to replace kinect data by sending pointcloud data on my own.(The scenario is, I want to test recognition service easily, so I send my pointcloud from pcd file to the topic that recognition service needs.)

I did this by writing this launch file

<launch>
  <!-- set stereo to true for narrow stereo, false for kinect -->
  <arg name="stereo" default="true" />
  <arg name="use_slip_controllers" default="false"/>
  <arg name="use_task_cartesian" default="false"/>
  <arg name="log_to_warehouse" default="false"/>
  <arg name="flatten_table" default="false"/>
  <arg name="sim" default="false"/>

  <!-- alternative option: database server running on a local machine -->
  <rosparam command="load" file="/home/rosfuerte/project/ros/code_training/tabletop_recognition_launch/my_server.yaml"/>
  <node pkg="household_objects_database" name="objects_database_node" type="objects_database_node" respawn="true" output="screen"/>    

  <!-- tabletop segmentation and object recognition -->
  <include file="$(find tabletop_object_detector)/launch/tabletop_complete.launch">
      <arg unless="$(arg stereo)" name="tabletop_segmentation_points_input" value="$(arg kinect_camera_name)/depth_registered/points"/>
      <arg if="$(arg stereo)" name="tabletop_segmentation_points_input" value="narrow_stereo_textured/points2"/>
      <arg name="flatten_table" value="$(arg flatten_table)"/>
  </include>

  <node pkg="pcl_ros" name="send_topic_narrow_stereo_textured_points2" type="pcd_to_pointcloud" 
      args="/home/rosfuerte/project/ros/my_package/table.pcd 1000" ns="ns_pcl2" respawn="true" output="screen">
      <remap from="/ns_pcl2/cloud_pcd" to="/narrow_stereo_textured/points2"/>
  </node>    

</launch>

It seems to be working well until I got segmentation error:

[ INFO] [1352364928.448570345]: Tabletop detection service called; waiting for a point_cloud2 on topic /narrow_stereo_textured/points2
[ INFO] [1352364928.613422339]: Point cloud received after 0.164966323 seconds; processing
[ INFO] [1352364928.644686459]: Input cloud converted to base_link frame after 0.196279652 seconds
[ INFO] [1352364928.644763139]: Starting process on new cloud in frame base_link
[ INFO] [1352364928.702188898]: Step 1 done
[ INFO] [1352364928.716289627]: Downsampled cloud only has 184 points
[ INFO] [1352364928.719293633]: In total, segmentation took 0.270897733 seconds
[ERROR] [1352364928.719764699]: Segmentation service returned error 2

I found the error message was in function TabletopSegmentor::processCloud(...) of tabletop_segmentation.cpp, which states this as NO_TABLE error.It seems like the error is in the pointcloud I sent.

But I got the pcd file from /narrow_stereo_textured/points2 by running pr2 and the scene in gazebo, and used command below to capture the scene which can be recognized when running pr2

rosrun pcl_ros pointcloud_to_pcd input:=/narrow_stereo_textured/points2

So I think sending this pcd file by command below should works

rosrun pcl_ros pcd_to_pointcloud table.pcd 1000 /cloud_pcd:=/narrow_stereo_textured/points2

Does anyone know why this didn't work?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2012-11-08 02:40:12 -0500

I think for your use case it's much better to use rosbag to record a series of point clouds and then play them back later.

edit flag offensive delete link more

Comments

Good idea~Some errors may occur between translation from pointcloud to pcd and pcd to pointcloud. I'll give it a try.

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-11-08 03:33:45 -0500 )edit

@Martin Günther : What's the different between using rosbag to record and replay, and using pcd_to_pointcloud to publish from pcd?

Albert K gravatar image Albert K  ( 2012-11-18 02:02:30 -0500 )edit

Question Tools

Stats

Asked: 2012-11-07 21:12:33 -0500

Seen: 708 times

Last updated: Nov 08 '12