Main Content

addInertialFrame

Define new inertial frame in UAV scenario

Since R2020b

    Description

    example

    addInertialFrame(scene,base,name,position,orientation) adds a new inertial frame to the UAV scenario scene by specifying the base, name, position, and orientation of the new inertial frame.

    addInertialFrame(scene,base,name,transformMatrix) adds a new inertial frame to the UAV scenario scene by specifying the base, name, and transformation matrix of the new inertial frame.

    Examples

    collapse all

    Create a UAV scenario. By default, the inertial frames are the ENU and the NED frames.

    scene = uavScenario()
    scene = 
      uavScenario with properties:
    
               UpdateRate: 10
                 StopTime: Inf
        HistoryBufferSize: 100
        ReferenceLocation: [0 0 0]
             MaxNumFrames: 10
              CurrentTime: 0
                IsRunning: 0
            TransformTree: [1x1 transformTree]
           InertialFrames: ["ENU"    "NED"]
                   Meshes: {}
                Platforms: [0x0 uavPlatform]
    
    

    Add a new inertial frame named Map to the scenario.

    addInertialFrame(scene,"NED","Map",[100 100 100],[1 0 0 0]);

    You can now use the Map frame as a reference frame to define other objects in the scenario.

    scene.InertialFrames(3)
    ans = 
    "Map"
    

    Input Arguments

    collapse all

    UAV scenario, specified as a uavScenario object.

    Base of the new inertial frame, specified as a string scalar. The base frame must be defined in the scenario in advance.

    Example: "ENU"

    Name of the new inertial frame, specified as a string scalar.

    Example: "newFrame"

    Position of the new inertial frame with respect to the base frame (specified in the base argument), specified as a 1-by-3 vector of scalars in meters.

    Orientation of the new inertial frame with respect to the base frame (specified in the base argument), specified as a quaternion or a 1-by-4 quaternion vector of scalars. The specified orientation is from the base frame to the new inertial frame.

    Transformation matrix that maps points in the new frame (specified in the base argument) to the base frame, specified as a 4-by-4 homogeneous transform matrix that maps points in the base frame to the new inertial frame.

    Example: [0 0 1 0; 0 1 0 0; -1 0 0 0; 0 0 0 1]

    Version History

    Introduced in R2020b