VR-Forces 4.1 Class Documentation
8.7 - Ground Vehicle Kinematics Model

Table of Contents

VR-Forces includes a simple, kinematics-based model for motion of ground vehicles.

Implemented in class: DtAutomotiveActuatorComponent

When you tick DtAutomotiveActuatorComponent:

  1. The tick() function checks whether dT is 0.0. If it is, tick() returns. A local heading variable is set to the entity’s current heading. If there is a steering port value this frame, and if the entity has a speed greater than 0.0, the heading value is incremented by:

    the steering port value * dT * current speed / entity turning radius<br>

  2. The tick() function creates a 3x3 rotation matrix that represents the rotation of a body about the Z-axis by the heading amount.

  3. If there is a valid parking brake port and the value on it is 1.0, or if there is no valid throttle or brake port, the acceleration and velocity for this frame is set to 0.0. Otherwise, calculateAcceleration() is called to determine the acceleration in the direction of movement for this frame.

  4. The tick() function takes the acceleration and creates an acceleration vector in body coordinates, for example:

    bodyAcceleration[0] = acceleration * dT;
    bodyAcceleration[1] = 0.0;
    bodyAcceleration[2] = 0.0;

  5. A velocity vector in body coordinates is created with:

    bodyVelocity[0] = current speed + bodyAcceleration[0] * dT;<br>
    bodyVelocity[1] = 0.0;<br>
    bodyVelocity[2] = 0.0;<br>

  6. The velocity in body coordinates is multiplied by the rotation matrix created earlier, to provide an acceleration vector in X-Y coordinates. This is used to determine a new position:

    newPosition[0] = oldPosition[0] + xyVelocity[0];
    newPosition[1] = oldPosition[1] + xyVelocity[1];
    newPosition[2] = oldPosition[2];

  7. The entity is placed on the terrain using the algorithm described in the next section, The Ground Vehicle Support Plane.

  8. The 3x3 rotation matrix determined by the support plane algorithm is used to set the bodyAcceleration and bodyVelocity vectors, calculated earlier, actually pointing down the nose of the entity. The new position, acceleration, velocity, and orientation are passed to updateRepository(). Finally, the actuator calls dataReceived() so that the automotive-control port group can be acquired by a controller in the next simulation frame.

8.7.1 The Ground Vehicle Support Plane

The algorithm for forming a support plane is as follows:

  1. First a 3x3 rotation matrix is created that specifies the rotation from entity coordinates to local (database) coordinates for the desired heading, using DtRotZ() (in kinTools.h). This is a rotation about the Z-axis only.

  2. The 3D position of each support point is found by providing the specified location and rotation matrix just calculated to the DtGroundInteractionPt representing each support point. (The DtGroundInteractionPt applies the specified offsets from the center of the vehicle’s base, rotates the points about Z using the matrix, and then queries the DtSimTerrain object in the DtSimManager for the Z-value at each point.) These three points form the entity’s support plane.

  3. A new 3x3 rotation matrix is calculated for the specified heading and three support points using the function DtOrientationFromThreePointsAndHeading() (in kinTools.h). The normal to the support plane is just the third column of the resulting matrix. This normal is used to find the Z-value on the support plane at the entity origin using DtFindZInPlane() (in kinTools.h). The result is a DtVector (X, Y, and Z) position for the vehicle and an orientation matrix that puts the entity on the ground.

  4. The orientation matrix is converted to Tait-Bryan angles. This is done with the call DtBodyToLocalRef_to_Euler() (in kinTools.h).

  5. The local position, orientation angles, and heading are placed in the state repository.

[<< The Aggregate Entity Behavior Model] [Home] [Top of Page] [Human Kinematics Model >>]


Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)