RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

visualizing/collision detection for the spheres #56

Closed JavadHasaneini closed 10 years ago

JavadHasaneini commented 10 years ago

When creating the rigid body object from a URDF file, drake replaces a sphere with a point-mass at its center. This causes two problems at other stages:

Javad

avalenzu commented 10 years ago

Could you post a minimal urdf to reproduce this?

RussTedrake commented 10 years ago

The collision detection using a point was expected, but I had forgotten that the sphere visualization support also got thrown out when we cleaned up the planar rigid body classes to use the 3D classes. It should be easy enough to put back in.

For the collision detection we just have to decide what primitives we want to support. Sphere's are a natural one, but Michael and I were thinking that super-ellipsoids would be the right case to handle.

Andres - also keep in mind that Javad is running with drake-minimal ( precompiled) on windows. So he doesn't have bullet support. But I'm close to providing that now.

On Mar 15, 2014, at 11:38 AM, Andres Valenzuela notifications@github.com wrote:

Could you post a minimal urdf to reproduce this?

— Reply to this email directly or view it on GitHub.

JavadHasaneini commented 10 years ago

Here is a minimal working code (attached)

On 15/03/2014 9:38 AM, Andres Valenzuela wrote:

Could you post a minimal urdf to reproduce this?

— Reply to this email directly or view it on GitHub https://github.com/RobotLocomotion/drake/issues/56#issuecomment-37728853.

%% Sphere is not shown by the visulaizer clc close all;

r = PlanarRigidBodyManipulator('Sphere.urdf');

TimeSpan = [0 2]; x0 = [0; 2; 0; 0; 0; 0]; xtraj = simulate(r,TimeSpan,x0);

v = r.constructVisualizer(); v.playback(xtraj);

%% Sphere penetrates to the ground

dt = 1e-3; options = []; options.floating = true; options.view = 'right'; r = TimeSteppingRigidBodyManipulator('SphereFloat.urdf',dt,options);

TimeSpan = [0 2]; x0 = [0;0;2; zeros(9,1)];

xtraj = simulate(r,TimeSpan,x0); v = r.constructVisualizer(); v.playback(xtraj,struct('slider',true));

JavadHasaneini commented 10 years ago

If you are going to fix collision detection for spheres, you may want to consider fixing the same issue for cylinders as well. As you know, cylinders are treated as boxes for collision detection, casing them to roll a bit when they land on the "virtual" edges.

JavadHasaneini commented 10 years ago

Cylinders are specially important since for modeling the rolling motion of an arc-shape foot (like Ranger feet) cylinders have to be used (unless there is another method that I am not aware of). With the current setting the edges of the "virtual box" that is replaced for the cylinder cause collisions and non-smooth motion.

RussTedrake commented 10 years ago

In the shorter term, you can approximate your geometry by adding your own contact points along the surface, which will still have impacts, but be arbitrarily accurate.

On Mar 15, 2014, at 1:57 PM, Javad notifications@github.com wrote:

Cylinders are specially important since for modeling the rolling motion of an arc-shape foot (like Ranger feet) cylinders have to be used (unless there is another method that I am not aware of). With the current setting the edges of the "virtual box" that is replaced for the cylinder causes collisions and non-smooth motion.

— Reply to this email directly or view it on GitHub.

RussTedrake commented 10 years ago

The visualization is resolved. The collision detection for spheres is coming shortly.