How to replace kinect data by sending pointclouds?
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?