主要内容

roadrunnerHDMapQuery

Query RoadRunner HD Map

Since R2026a

    Description

    A roadrunnerHDMapQuery object enables you to query specified information from a RoadRunner HD Map using MATLAB®. You can retrieve information about the current lane, neighboring lanes, road geometry, and projection point on the centerline of a lane at a specified actor pose within the HD map. You can use this information to get lane attributes, determine lane connectivity, and analyze road topology to support the localization of actors such as vehicles on the road network. You can use this object to access both road network topology and geometric details during scenario simulations to test and validate ADAS algorithms and systems.

    Creation

    Description

    rrHDMapQuery = roadrunnerHDMapQuery(rrHDMapStruct) returns a roadrunnerHDMapQuery object, rrHDMapQuery, that enables you to query information from the specified RoadRunner HD Map data rrHDMapStruct.

    example

    Input Arguments

    expand all

    RoadRunner HD Map to query, specified as a structure. The fields of this structure must correspond to the Lanes, LaneBoundaries, Junctions, and SpeedLimits properties of a roadrunnerHDMap object. Because the values of these properties are also objects, the corresponding structure fields contain structures. To create this structure from a roadrunnerHDMap object, use the convertToStruct function.

    Output Arguments

    expand all

    RoadRunner HD Map query object, returned as a roadrunnerHDMapQuery object.

    Object Functions

    getLaneGet information about lane from RoadRunner HD Map
    getNeighborLanesGet information about neighboring lanes from RoadRunner HD Map
    getRoadTerrainGet road information from RoadRunner HD Map
    getProjectionPointOnLaneGet information about projection point on lane from RoadRunner HD Map

    Examples

    collapse all

    Create an empty RoadRunner HD Map object.

    rrHDMap = roadrunnerHDMap;

    Specify the path to a RoadRunner HD Map binary file, and use the read function to populate the empty RoadRunner HD Map object with the map data.

    Note: Replace the file path specified in this code block with the absolute path to an .rrhd file on your system.

    filename = "C:\RR\MyProject\Exports\SimpleBankedRoad.rrhd";
    read(rrHDMap,filename);

    Convert the RoadRunner HD Map object into a MATLAB structure.

    rrHDMapStruct = convertToStruct(rrHDMap);

    Create a RoadRunner HD Map query object using the RoadRunner HD Map structure rrHDMapStruct.

    rrHDMapQuery = roadrunnerHDMapQuery(rrHDMapStruct);

    Specify a driving scenario-compatible actor pose structure. This structure must include the position, orientation, and velocities of an actor in the scenario.

    actorPose = struct("ActorID",1,"Position",[-18.57 102.40 -2.76],"Velocity",[0 0 0],"Roll",0,"Pitch",0,"Yaw",92.09,"AngularVelocity",[0 0 0]);

    Get the information for the current lane at the specified actor pose from the RoadRunner HD Map.

    laneInfo = getLane(rrHDMapQuery,actorPose,ActorPoseType="drivingscenario")
    laneInfo = struct with fields:
                 LaneID: '{de577e4a-213c-38d6-8ec5-04e4cd425e61}'
            Coordinates: [190×3 double]
               LaneType: OnRamp
        TravelDirection: Backward
              LaneWidth: 4.7598
              LaneSpeed: 11.1760
    
    

    Create an empty RoadRunner HD Map object.

    rrHDMap = roadrunnerHDMap;

    Specify the path to a RoadRunner HD Map binary file, and use the read function to populate the empty RoadRunner HD Map object with the map data.

    Note: Replace the file path specified in this code block with the absolute path to an .rrhd file on your system.

    filename = "C:\RR\MyProject\Exports\SimpleBankedRoad.rrhd";
    read(rrHDMap,filename);

    Convert the RoadRunner HD Map object into a MATLAB structure.

    rrHDMapStruct = convertToStruct(rrHDMap);

    Create a RoadRunner HD Map query object using the RoadRunner HD Map structure.

    rrHDMapQuery = roadrunnerHDMapQuery(rrHDMapStruct);

    Specify a driving scenario-compatible actor pose structure. This structure must include the position, orientation, and velocity of an actor in the scenario.

    actorPose = struct("ActorID",1,"Position",[-18.57 102.40 -2.76],"Velocity",[0 0 0],"Roll",0,"Pitch",0,"Yaw",92.09,"AngularVelocity",[0 0 0]);

    Get the information for the neighboring lanes at the specified actor pose from the RoadRunner HD Map.

    NeighborLaneInfo = getNeighborLanes(rrHDMapQuery,actorPose,ActorPoseType="drivingscenario")
    NeighborLaneInfo = struct with fields:
              NumLanes: 4
           ActorLaneID: 3
                 Lanes: [4×1 struct]
        LaneBoundaries: [5×1 struct]
    
    

    Create an empty RoadRunner HD Map object.

    rrHDMap = roadrunnerHDMap;

    Specify the path to a RoadRunner HD Map binary file, and use the read function to populate the empty RoadRunner HD Map object with the map data.

    Note: Replace the file path specified in this code block with the absolute path to an .rrhd file on your system.

    filename = "C:\RR\MyProject\Exports\SimpleBankedRoad.rrhd";
    read(rrHDMap,filename);

    Convert the RoadRunner HD Map object into a MATLAB structure.

    rrHDMapStruct = convertToStruct(rrHDMap);

    Create a RoadRunner HD Map query object using the RoadRunner HD Map structure.

    rrHDMapQuery = roadrunnerHDMapQuery(rrHDMapStruct);

    Specify a driving scenario-compatible actor pose structure. This structure must include the position, orientation, and velocity of an actor in the scenario.

    poseType = "drivingscenario";
    actorPose = struct("ActorID",1,"Position",[-18.57 102.40 -2.76],"Velocity",[0 0 0],"Roll",0,"Pitch",0,"Yaw",92.09,"AngularVelocity",[0 0 0]);

    Get the information for the road attributes at the specified actor pose from the RoadRunner HD Map.

    roadInfo= getRoadTerrain(rrHDMapQuery,actorPose,ActorPoseType=poseType)
    roadInfo = struct with fields:
        Elevation: -2.7687
            Grade: 0.0424
          Banking: 0.1392
    
    

    Create an empty RoadRunner HD Map object.

    rrHDMap = roadrunnerHDMap;

    Specify the path to a RoadRunner HD Map binary file, and use the read function to populate the empty RoadRunner HD Map object with the map data.

    Note: Replace the file path specified in this code block with the absolute path to an .rrhd file on your system.

    filename = "C:\RR\MyProject\Exports\SimpleBankedRoad.rrhd";
    read(rrHDMap,filename)

    Convert the RoadRunner HD Map object into a MATLAB structure.

    rrHDMapStruct = convertToStruct(rrHDMap);

    Create a RoadRunner HD Map query object using the RoadRunner HD Map structure.

    rrHDMapQuery = roadrunnerHDMapQuery(rrHDMapStruct);

    Specify a lane ID and a driving scenario-compatible actor pose structure. The structure must include the position, orientation, and velocity of an actor in the scenario.

    laneID = "{de577e4a-213c-38d6-8ec5-04e4cd425e61}";
    poseType = "drivingscenario";
    actorPose = struct("ActorID",1,"Position",[-18.57 102.40 -2.76],"Velocity",[0 0 0],"Roll",0,"Pitch",0,"Yaw",92.09,"AngularVelocity",[0 0 0]);

    Retrieve the information of road attributes at the specified actor pose from RoadRunner HD Map.

    roadInfo= getProjectionPointOnLane(rrHDMapQuery,laneID,actorPose,ActorPoseType=poseType)
    roadInfo = struct with fields:
         Position: [-18.5709 102.4032 -2.7679]
        Curvature: -0.0168
          Heading: 0.2863
          Banking: 0.1392
            Grade: -0.0424
    
    

    Version History

    Introduced in R2026a