[ros-users] Add MESH into planning scene collision object FAILED

Gil Jones gjones at willowgarage.com
Mon Mar 12 16:38:54 UTC 2012


Please ask this question, and questions like this, on answers.ros.org.

I expect the problem is that in adding a single triangle you are adding a
2D shape, and the convex hull code isn't happy with a single 2D shape
without volume.  I don't think collision checking will work against a 2D
shape either.  I'm not sure how many triangles you'll have to add to
compute a convex hull and collision check successfully. A much better
approach than trying to code this by hand is taking an .stl file for the
mesh and using the function in geometric_shapes called
createMeshFromFilename.  Then you can use the constuctObjectMsg function in
planning_environment/util/construct_object.h to form the message.

-Gil

On Sat, Mar 10, 2012 at 6:25 PM, Arkapravo Bhaumik <
arkapravobhaumik at gmail.com> wrote:

> Consider putting this question to answer.ros <http://answers.ros.org>,
> chances are that you may get better replies.
>
>
> On 11 March 2012 03:11, Paul Heran Yang <heranyang at gmail.com> wrote:
>
>> Hi all,
>>
>> I've been trying to add meshes into collision object, but always get
>> error: "Unable to compute convex hull"
>>
>>     trimesh_object.type = arm_navigation_msgs::Shape::MESH;
>>     for (int i = 0; i < 3; i++) {
>>         geometry_msgs::Point p;
>>         p.x = i;
>>         p.y = i+1;
>>         p.z = i+2;
>>         trimesh_object.vertices.push_back(p);
>>     }
>>
>>     // then add {0, 1, 2} into trimesh_object.triangles
>>     collision_object.shapes.push_back(trimesh_object);
>>
>>     geometry_msgs::Pose pose;
>>     collision_object.poses.push_back(pose);
>>
>>     ...
>>
>>
>> planning_scene_req.planning_scene_diff.collision_objects.push_back(collision_object);
>>     get_planning_scene_client.call(planning_scene_req,
>> planning_scene_res) ...
>>
>> I've followed the instructions on
>> http://www.ros.org/wiki/arm_navigation/Tutorials/Planning%20Scene/Adding%20Virtual%20Objects%20to%20the%20Planning%20Scene
>>
>> All I'm trying to do is just to add a simple triangle into the scene, but
>> so far no luck. The above code just adds {0,1,2},{1,2,3},{2,3,4} into it. I
>> also tried {0,0,1},{0,1,0},{1,0,0}. Nothing works.
>>
>> I don't get why there's "unable to compute convex hull" error. Thanks in
>> advance.
>>
>> -Paul
>>
>>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20120312/e8dccf4d/attachment-0004.html>


More information about the ros-users mailing list