Drake
drake::maliput::utility Namespace Reference

Classes

struct  ObjFeatures
 Multitude of parameters for generating an OBJ model of a road surface, with sensible defaults. More...
 

Functions

void GenerateObjFile (const api::RoadGeometry *road_geometry, const std::string &dirpath, const std::string &fileroot, const ObjFeatures &features)
 Generates a Wavefront OBJ model of the road surface of an api::RoadGeometry. More...
 
void GenerateUrdfFile (const api::RoadGeometry *road_geometry, const std::string &dirpath, const std::string &fileroot, const ObjFeatures &features)
 Generates a URDF file which models the road surface of an api::RoadGeometry. More...
 
std::unordered_set< const api::Segment * > FindConfluentSegments (const api::Segment *seed_segment)
 Finds all Segments connected to seed_segment via confluent Lanes. More...
 
std::vector< std::unordered_set< const api::Segment * > > AnalyzeConfluentSegments (const api::RoadGeometry *road_geometry)
 Analyzes how Segments in road_geometry are connected via confluency of their Lanes at BranchPoints. More...
 
 TEST_F (GenerateObjBasicDutTest, DefaultObjContent)
 
 TEST_F (GenerateObjBasicDutTest, ChangeOrigin)
 
 TEST_F (GenerateObjBasicDutTest, MtlContent)
 
 TEST_F (GenerateObjBasicDutTest, NoBranchPointsObjContent)
 
 TEST_F (GenerateObjBasicDutTest, StackedBranchPointsObjContent)
 
 TEST_F (GenerateObjTest, DontTickleDrawLaneArrowAssert)
 
 TEST_F (GenerateObjBasicDutTest, HighlightedSegments)
 
 TEST_F (GenerateUrdfTest, AtLeastRunIt)
 

Function Documentation

◆ AnalyzeConfluentSegments()

std::vector< std::unordered_set< const api::Segment * > > AnalyzeConfluentSegments ( const api::RoadGeometry road_geometry)

Analyzes how Segments in road_geometry are connected via confluency of their Lanes at BranchPoints.

Two Lanes which are confluent at a BranchPoint necessarily overlap near the BranchPoint, so the Segments which own those Lanes ought to belong to a common Junction. The output of this function is thus a lower-bound for how Segments should be grouped together into Junctions, which can be used for verifying or synthesizing (approximately) the Junction structure. (This function will not detect Lanes which have overlapping geometries independent of their BranchPoints.)

Returns
the set of connected components of Segments, as a vector of unordered_sets. The ordering of the components in the vector is arbitrary. Each Segment in road_geometry shall belong to exactly one component.

◆ FindConfluentSegments()

std::unordered_set< const api::Segment * > FindConfluentSegments ( const api::Segment seed_segment)

Finds all Segments connected to seed_segment via confluent Lanes.

This function performs a breadth-first search over the graph of Segments, Lanes, and BranchPoints originating at seed_segment. It does not explore any other elements and does not require these elements to have valid ownership pointers upwards to Junctions or to a RoadGeometry.

Returns
an unordered_set of Segments connected to seed_segment, including seed_segment itself.

◆ GenerateObjFile()

void GenerateObjFile ( const api::RoadGeometry road_geometry,
const std::string &  dirpath,
const std::string &  fileroot,
const ObjFeatures features 
)

Generates a Wavefront OBJ model of the road surface of an api::RoadGeometry.

Parameters
road_geometrythe api::RoadGeometry to model
dirpathdirectory component of the output pathnames
filerootroot of the filename component of the output pathnames
featuresparameters for constructing the mesh

GenerateObjFile actually produces two files: the first, named [dirpath]/[fileroot].obj, is a Wavefront OBJ containing the mesh which models the api::RoadGeometry. The second file is a Wavefront MTL file named [dirpath]/[fileroot].mtl, containing descriptions of materials referenced by the OBJ file.

The produced mesh covers the area within the driveable-bounds of the road surface described by the RoadGeometry.

◆ GenerateUrdfFile()

void GenerateUrdfFile ( const api::RoadGeometry road_geometry,
const std::string &  dirpath,
const std::string &  fileroot,
const ObjFeatures features 
)

Generates a URDF file which models the road surface of an api::RoadGeometry.

Parameters
road_geometrythe api::RoadGeometry to model
dirpathdirectory component of the output pathnames
filerootroot of the filename component of the output pathnames
featuresparameters for constructing the mesh

GenerateUrdfFile() actually produces three files:

  • [dirpath]/[fileroot].urdf the URDF file, which is little more than a wrapper for an OBJ file;
  • [dirpath]/[fileroot].obj a Wavefront OBJ file containing the visual mesh which models the surface;
  • [dirpath]/[fileroot].mtl a Wavefront MTL file describing the materials referenced by the OBJ file.

The produced mesh covers the area within the lane-bounds of every api::Lane in the RoadGeometry.

◆ TEST_F() [1/8]

drake::maliput::utility::TEST_F ( GenerateUrdfTest  ,
AtLeastRunIt   
)

◆ TEST_F() [2/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
DefaultObjContent   
)

◆ TEST_F() [3/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
ChangeOrigin   
)

◆ TEST_F() [4/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
MtlContent   
)

◆ TEST_F() [5/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
NoBranchPointsObjContent   
)

◆ TEST_F() [6/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
StackedBranchPointsObjContent   
)

◆ TEST_F() [7/8]

drake::maliput::utility::TEST_F ( GenerateObjTest  ,
DontTickleDrawLaneArrowAssert   
)

◆ TEST_F() [8/8]

drake::maliput::utility::TEST_F ( GenerateObjBasicDutTest  ,
HighlightedSegments   
)