rigidBodyDynamics: Added rotating joint

This joint allows two bodies to rotate relative to each other at a
specified speed. The relative motion is completely specified, so this
joint has zero degrees of freedom.

It could be used, for example, to attach a rotating propeller to a
moving ship:

    bodies
    {
        hull
        {
            ...
        }
        propeller
        {
            type            rigidBody;

            // Dynamic properties
            mass            ...;
            centreOfMass    ...;
            inertia         ...;

            // The propeller is connected to the hull
            parent          hull;

            // The position relative to the hull
            transform       (1 0 0 0 1 0 0 0 1) (20 0 0);

            // Rotation settings
            joint
            {
                type            rotating;
                omega           (6 0 0);
            }
        }
    }
This commit is contained in:
Will Bainbridge
2022-04-05 11:26:07 +01:00
parent 9d702d58b5
commit 0289f383eb
4 changed files with 280 additions and 0 deletions

View File

@ -0,0 +1,59 @@
solver
{
type symplectic;
}
bodies
{
bar1
{
type rigidBody;
mass 3;
centreOfMass (0 -0.5 0);
inertia (0.2575 0 0 0.015 0 0.2575);
parent root;
transform (1 0 0 0 1 0 0 0 1) (0 0 0);
joint
{
type Rz;
}
outline ((0 0 0) (0 -1 0));
}
bar2
{
type rigidBody;
mass 3;
centreOfMass (0 -0.5 0);
inertia (0.2575 0 0 0.015 0 0.2575);
parent bar1;
transform (1 0 0 0 1 0 0 0 1) (0 -1 0);
joint
{
type Rz;
}
outline ((0 0 0) (0 -1 0));
}
rotor
{
type rigidBody;
mass 3;
centreOfMass (0 -0.5 0);
inertia (0.2575 0 0 0.015 0 0.2575);
parent bar2;
transform (1 0 0 0 1 0 0 0 1) (0 -1 0);
joint
{
type rotating;
omega (0 0 1);
}
outline ((0 0 0) (0 -1 0));
}
}
g (0 -9.81 0);
q (1.5707963267948966 0 0);
deltaT 0.01;
endTime 20;