Hi everyone,
I’m encountering an issue while working with rigid body collisions in Project Chrono. I’ve created two cubes with a certain distance apart using the following code:
auto box = chrono_types::make_shared<ChBodyEasyMesh>(
GetChronoDataFile("models/cube.obj"), // mesh filename
500, // density (kg/m^3)
true, // automatically compute mass and inertia
true, // visualize?
true, // collide?
mat,
0.001 // mesh sweep sphere radius
);
Even though I’ve set gravity to 0 and no external forces are applied, the cubes experience rotation and translation over time when collide is enabled. If I disable collide, the cubes remain stationary. Clearly, the issue is related to the collision behavior.
Interestingly, when I create the cubes using ChBodyEasyBox with the same gravity and collision enabled, they remain stationary as expected:
auto box = chrono_types::make_shared<ChBodyEasyBox>(
3.96, 2, 4, // dimensions (x, y, z)
500, // density (kg/m^3)
true, // visualization?
true, // collision?
mat
);
Both cubes in this case are stable with no unexpected motion.
Could anyone help me understand why the behavior is different between ChBodyEasyMesh and ChBodyEasyBox? Is there something specific about the collision setup for ChBodyEasyMesh that I’m missing?
Thanks!
Best regards,
Jay
Hi Jay,
Could you please provide a complete minimal code that shows the problem?
By the way, note that the two cases you list below are not exactly the same, as the cube generated by the first one will have dimensions 2x2x2.
--Radu
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/projectchrono/941afeb8-5f8a-4268-b7f9-aba820c8e55en%40googlegroups.com.
Hi Jay,
It took a while until I got a chance to look at this closer.
The main issue here is that the Chrono API is confusing and unintuitive in this particular regard. I intend to change this sometime soon.
Until then, here’s what’s going on:
To make a long story short, to fix the problem you saw you can either:
Hope that this helps,
--Radu
From: projec...@googlegroups.com <projec...@googlegroups.com>
On Behalf Of Jay Jay
Sent: Sunday, January 19, 2025 8:20 PM
To: ProjectChrono <projec...@googlegroups.com>
Subject: Re: [chrono] Issue with unexpected motion in ChBodyEasyMesh with Collide Enabled
Hi Radu,
Please see the attachment. I change the cube size in the case below to 2x2x2. The problems are still there. If I use :
auto box = chrono_types::make_shared<ChBodyEasyBox>(2, 2, 2, // x,y,z size
500, // density
true, // visualization?
true, // collision?
mat);
It works well. The two cubes are stationary:
If I use:
auto box= chrono_types::make_shared<ChBodyEasyMesh>(GetChronoDataFile("models/cube.obj"), // mesh filename
500, // density kg/m^3
true, // automatically compute mass and inertia
true, // visualize?>
true, // collide?
mat,
0.001
);
Then the results are as follows:
To view this discussion visit https://groups.google.com/d/msgid/projectchrono/45222c59-3105-4a2e-82ca-028a2c4f22d9n%40googlegroups.com.