0
$\begingroup$

Rosanswers logo

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?


Originally posted by Po-Jen Lai on ROS Answers with karma: 1371 on 2012-11-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Martin Günther with karma: 11816 on 2012-11-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Po-Jen Lai on 2012-11-08:
Good idea~Some errors may occur between translation from pointcloud to pcd and pcd to pointcloud. I'll give it a try.

Comment by Albert K on 2012-11-18:
@Martin Günther : What's the different between using rosbag to record and replay, and using pcd_to_pointcloud to publish from pcd?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.