Main Content

sim3d.environment.GeospatialConfiguration

Create 3D environment in Unreal Engine

Since R2024b

    Description

    The sim3d.environment.GeospatialConfiguration object implements a 3D simulation environment that is rendered by using the Unreal Engine® from Epic Games®. The Aerospace Blockset™ Interface for Unreal Engine Projects integrates the 3D simulation environment with Simulink® so that you can query the world around the vehicle and virtually test perception, control, and planning algorithms.

    Note

    sim3d.environment.GeospatialConfiguration requires Simulink 3D Animation™.

    Creation

    Description

    gsConfig = sim3d.environment.GeospatialConfiguration(Name = Value) creates a sim3d.environment.GeospatialConfiguration object that defines the 3D environment in the Unreal Engine specified by options using one or more optional name-value arguments.

    example

    Output Arguments

    expand all

    Geospatial object, returned as a sim3d.environment.GeospatialConfiguration object.

    Properties

    expand all

    ID of stored token, specified as a string. To create this token, create a Cesium Ion® account, then generate the token through this account. The Authentication Manager stores the token from Cesium Ion. For more information, see Visualize with Cesium and https://ion.cesium.com/.

    Use Earth center as origin (ECEF), specified as 0 (false) or 1 (true). Set this property to true to position aerospace vehicles with respect to the Earth center.

    Height at georeference point on the globe, specified as a real scalar. This parameter represents the height above the 1984 World Geodetic System (WGS84) ellipsoid model of the Earth at the latitude and longitude specified in Origin latitude and Origin longitude.

    Dependencies

    To use this property, set Use Earth center as origin (ECEF) to off.

    Latitude, specified as a real scalar in decimal degrees.

    Dependencies

    To use this property, set Use Earth center as origin (ECEF) to off.

    Longitude, specified as a real scalar in decimal degrees.

    Dependencies

    To use this property, set Use Earth center as origin (ECEF) to off.

    Raster overlay type, specified as Aerial, Aerial with labels, or Road.

    Local dataset IDs, specified as an array or vector.

    Georeferenced, location-accurate Sun Sky actor, specified as 0 (false) or 1 (true).

    Current solar time, specified as scalar hours from midnight.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Time zone, specified as hours offset from Greenwich Mean Time (GMT). To specify hours before GMT, use a minus sign (-).

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Day, specified as a scalar in the range 1 and 31.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Month, specified as a scalar from 1 to 12.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Year, specified as a scalar real.

    Select this check box to enable daylight saving time.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Start day of daylight saving time, specified as a scalar from 1 to 31.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Start month of daylight saving time, specified as a scalar from 1 to 12.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Last day of daylight saving time, specified as a scalar from 1 to 31.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Last month of daylight saving time, specified as a scalar from 1 to 12.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Hour when daylight saving time switches, specified as a scalar from 1 to 24.

    Dependencies

    To use this property, set Use advanced Sun sky to on.

    Tileset source, specified as one of 'Earth Terrain', 'Moon Terrain' 'URL', or 'None'.

    Data Types: string

    File path of locally stored 3d tileset data, specified as a string.

    Dependencies

    To use this property, set the TilesetSource property to Url.

    Data Types: string

    Examples

    collapse all

    This example shows how to create a world object and specify GeospatialMap as the scene.

    world = sim3d.World('Map',"/MathWorksGeoSpatial/Maps/GeoSpatialMap");

    Create access token. Enter a unique token ID and token value shown on Cesium ion account. Skip this step if you already have created a token in this MATLAB session. For information on how to create an Access token in your Cesium ion account, see Visualize with Cesium. In the Create new token dialog box, enter the unique token ID string and copy and paste the access token created from the Cesium Ion page. For example, for token ID MyNewToken, enter these values.

    sim3d.environment.GeospatialConfiguration.createAccessToken();

    Configure the Geospatial actor using the token ID you created.

    geoConfig = sim3d.environment.GeospatialConfiguration(AccessTokenID="MyNewToken",...
                                                            UseAdvancedSunSky=true,...
                                                            OriginLatitude=41.881154,...
                                                            OriginLongitude=-87.620836,...
                                                            OriginHeight=200.0);
    ans = 
    ""
    

    Add Geospatial configuration to the world object.

    world.add(geoConfig);

    Run simulation.

    world.createViewport();
    world.run(0.02, inf);

    To view the map from a preset view, left-click in the executable window and select a number from 1 to 9.

    Version History

    Introduced in R2024b

    expand all