CRLab / pc_object_completion_cnn

ROS node for shape completion. Referenced in IROS 2017 paper "Shape Completion Enabled Robotic Grasping"
http://shapecompletiongrasping.cs.columbia.edu/
12 stars 8 forks source link

Cannot copy sequence with size 4 to array axis with dimension 3 #4

Open huckl3b3rry87 opened 5 years ago

huckl3b3rry87 commented 5 years ago

After fixing several issues in the pipeline, I get this

[ INFO] [1571772815.804430990, 1571098005.473352630]: object_completion_topic: depth 0 

[ INFO] [1571772815.804484785, 1571098005.473352630]: waitForServer()

[ INFO] [1571772815.804565577, 1571098005.473352630]: sendGoalAndWait()

[INFO] [1571772815.809312, 1571098005.483454]: Received Completion Goal
[ERROR] [1571772815.815073, 1571098005.483454]: Exception in your execute callback: cannot copy sequence with size 4 to array axis with dimension 3
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/actionlib/simple_action_server.py", line 289, in executeLoop
    self.execute_callback(goal)
  File "/root/pc_scene_completion_ws/src/pc_object_completion_cnn/scripts/shape_completion_server/mesh_completion_server.py", line 109, in completion_cb
    goal.partial_cloud)
  File "/usr/local/lib/python2.7/dist-packages/curvox/cloud_conversions.py", line 57, in cloud_msg_to_np
    out[count] = point

and I tried https://github.com/jvarley/curvox and https://github.com/CRLab/curvox

@jvarley and @DavidWatkins do either of you have any ideas why this is not working? Since I am just guessing at the appropriate Curvox package to use , I figured that this may be the issue. It is failing here

I will try to use the recently added CURVOX repo

DavidWatkins commented 5 years ago

What version of Python are you using? I updated the curvox package to use python3 and ideally that's what you should be using moving forward. It looks like you are trying to use python2.7 in your environment.

margaritaG commented 4 years ago

@huckl3b3rry87 The issue is that you are sending a goal partial_cloud consisting of points that have a point type with four fields (e.g. "x", "y", "z", "rgb").

However, the failing curvox function expects only three fields ("x", "y", "z").

Take a ros pointclud message and convert it to
    an nx3 np ndarray.

from here.

The solution is to filter the fields of the goal partial_cloud before sending it to only retain the "x", "y", "z" fields.