wg-perception / object_recognition_core

The core of object recognition, where the development now happens
48 stars 47 forks source link

Detection crashes with simulated PR2 (ROS Hydro) #35

Closed ZdenekM closed 9 years ago

ZdenekM commented 9 years ago
[ INFO] [1439892673.437634264]: Initialized ROS. node_name: /object_recognition_server
[ INFO] [1439892673.834002765, 478.008000000]: System already initialized. node_name: /object_recognition_server
[ INFO] [1439892673.838442561, 478.009000000]: Subscribed to topic:/head_mount_kinect/depth/camera_info with queue size of 1
[ INFO] [1439892673.839874285, 478.009000000]: Subscribed to topic:/head_mount_kinect/rgb/camera_info with queue size of 1
[ INFO] [1439892673.841825796, 478.010000000]: Subscribed to topic:/head_mount_kinect/depth/image_raw with queue size of 1
[ INFO] [1439892673.843391626, 478.010000000]: Subscribed to topic:/head_mount_kinect/rgb/image_raw with queue size of 1
OpenCV Error: Assertion failed (in.type() == CV_64FC1 || in.type() == CV_32FC1 || in.type() == CV_16UC1 || in.type() == CV_16SC1) in rescaleDepth, file /tmp/buildd/ros-hydro-opencv-candidate-0.2.4-0precise-20150330-1158/src/rgbd/src/utils.cpp, line 55
Traceback (most recent call last):
  File "/opt/ros/hydro/lib/object_recognition_core/detection", line 24, in <module>
    run_plasm(args, plasm)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/ecto/opts.py", line 85, in run_plasm
    sched.execute(options.niter)
ecto.CellException:            exception_type  CellException
                cell_name  source1
                cell_type  ecto::py::BlackBox
            function_name  process_with_only_these_inputs
                     type  std::runtime_error
                     what             exception_type  CellException
                cell_name  Source
                cell_type  ecto::py::BlackBox
            function_name  process_with_only_these_inputs
                     type  std::runtime_error
                     what             exception_type  CellException
                cell_name  <class 'ecto_image_pipeline.base.RescaledRegisteredDepth'>
                cell_type  RescaledRegisteredDepth
            function_name  process_with_only_these_inputs
                     type  cv::Exception
                     what  /tmp/buildd/ros-hydro-opencv-candidate-0.2.4-0precise-20150330-1158/src/rgbd/src/utils.cpp:55: error: (-215) in.type() == CV_64FC1 || in.type() == CV_32FC1 || in.type() == CV_16UC1 || in.type() == CV_16SC1 in function rescaleDepth
ZdenekM commented 9 years ago

Just a note. Depth data from Gazebo has encoding: 32FC1 - which is equivalent to CV_32FC1 I guess.

vrabaud commented 9 years ago

do you have a gazebo scene I could reuse as a unit test ?

ZdenekM commented 9 years ago

It's scene independent so you can use even roslaunch pr2_gazebo pr2_empty_world.launch. This is my config:

source1:
  type: RosKinect
  module: 'object_recognition_ros.io'
  parameters:
    rgb_frame_id: '/head_mount_kinect_rgb_optical_frame'
    rgb_image_topic: '/head_mount_kinect/rgb/image_raw'
    rgb_camera_info: '/head_mount_kinect/rgb/camera_info'
    depth_image_topic: '/head_mount_kinect/depth/image_raw'
    depth_camera_info: '/head_mount_kinect/depth/camera_info'

sink1:
  type: TablePublisher
  module: 'object_recognition_tabletop'
  inputs: [source1]

pipeline1:
  type: TabletopTableDetector
  module: 'object_recognition_tabletop'
  inputs: [source1]
  outputs: [sink1]
  parameters:
    table_detector:
      min_table_size: 4000
      plane_threshold: 0.01

And this is the command I'm using to bring up ORK:

rosrun object_recognition_core detection -c my_conf_file.ork

Thanks for your time.

ZdenekM commented 9 years ago

I have some news. It's probably Gazebo issue. See following:

rostopic echo /head_mount_kinect/depth/image_raw | grep encoding
encoding: mono8
encoding: 32FC1
encoding: 32FC1
encoding: mono8
encoding: 32FC1
encoding: 32FC1
encoding: mono8
encoding: 32FC1
encoding: 32FC1
encoding: mono8
awesomebytes commented 9 years ago

Have you checked that there aren't two publishers publishing in that topic? That looks weird.

rostopic info /head_mount_kinect/depth/image_raw

2015-09-01 12:19 GMT+02:00 Zdeněk Materna notifications@github.com:

I have some news. It's probably Gazebo issue. See following:

rostopic echo /head_mount_kinect/depth/image_raw | grep encoding encoding: mono8 encoding: 32FC1 encoding: 32FC1 encoding: mono8 encoding: 32FC1 encoding: 32FC1 encoding: mono8 encoding: 32FC1 encoding: 32FC1 encoding: mono8

— Reply to this email directly or view it on GitHub https://github.com/wg-perception/object_recognition_core/issues/35#issuecomment-136664593 .

ZdenekM commented 9 years ago

It's definitely weird.

rostopic info /head_mount_kinect/depth/image_raw
Type: sensor_msgs/Image

Publishers: 
 * /gazebo (http://robodev1:39815/)

Subscribers: 
 * /image_view_1441103460258460915 (http://robodev1:45951/)

Btw, I found that in PR2 URDF there are two kinect sensors. One here and second here. The first one publish ir topics and the second one rgb topics. But both of them also publish depth data. Could this cause some issues?

ZdenekM commented 9 years ago

Ok, so it's definitely issue of PR2 URDF: https://github.com/PR2/pr2_simulator/issues/112. Sorry for noise. I will close this issue.