maliput
|
Namespaces | |
mesh | |
Classes | |
struct | GenerateStringOptions |
Parameters that specify what details about an api::RoadGeometry to print. More... | |
struct | Material |
Material information for built meshes. More... | |
struct | ObjFeatures |
Multitude of parameters for generating an OBJ model of a road surface, with sensible defaults. More... | |
struct | RoadGeometryMesh |
class | ThreadPool |
Creates a pool of threads and a pool of tasks to be executed by the threads simultaneously. More... | |
Enumerations | |
enum | MaterialType { Asphalt, Lane, Marker, HBounds, BranchPointGlow, GrayedAsphalt, GrayedLane, GrayedMarker, Sidewalk } |
Functions | |
std::string | GetSuffixFromPath (const std::string &filepath) |
Extracts the suffix of a file. More... | |
std::vector< std::string > | GetAllFilePathsFromDirectory (const std::string &directory_path, const std::optional< std::string > &ends_with_suffix) |
Get all filepaths from a particular directory. More... | |
std::vector< std::string > | GetAllPathsFromEnvironment (const std::string &env_var) |
Retrieves a list of paths that live in a environment variable. More... | |
void | GenerateDotStream (const routing::graph::Graph &graph, std::ostream *os) |
Generates a string representation in os of the graph using the DOT language. More... | |
void | GenerateDotStream (const routing::graph::Graph &graph, const routing::Route &route, std::ostream *os) |
Generates a string representation in os of the graph and route using the DOT language. More... | |
std::pair< mesh::GeoMesh, Material > | BuildMesh (const api::RoadGeometry *rg, const ObjFeatures &features, const api::LaneId &lane_id, const MaterialType &mesh_material) |
Builds a map of meshes based on features properties and the RoadGeometry. More... | |
std::pair< mesh::GeoMesh, Material > | BuildMesh (const api::RoadGeometry *rg, const ObjFeatures &features, const api::BranchPointId &branch_point_id, const MaterialType &mesh_material) |
Builds a map of meshes based on features properties and the RoadGeometry. More... | |
std::pair< mesh::GeoMesh, Material > | BuildMesh (const api::RoadGeometry *rg, const ObjFeatures &features, const api::SegmentId &segment_id, const MaterialType &mesh_material) |
Builds a map of meshes based on features properties and the RoadGeometry. More... | |
RoadGeometryMesh | BuildRoadGeometryMesh (const api::RoadGeometry *rg, const ObjFeatures &features) |
Builds a complete RoadGeometryMesh based on features properties and the RoadGeometry. More... | |
std::map< std::string, std::pair< mesh::GeoMesh, Material > > | BuildMeshes (const api::RoadGeometry *road_geometry, const ObjFeatures &features) |
Builds a map of meshes based on features properties and the api::RoadGeometry. More... | |
std::map< std::string, std::pair< mesh::GeoMesh, Material > > | BuildMeshes (const api::RoadNetwork *road_network, const ObjFeatures &features) |
Builds a map of meshes based on features properties and the api::RoadNetwork. More... | |
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 | GenerateObjFile (const api::RoadNetwork *road_network, const std::string &dirpath, const std::string &fileroot, const ObjFeatures &features) |
Generates a Wavefront OBJ model of the road surface of an api::RoadNetwork. More... | |
const Material & | GetMaterialByName (const std::string &material_name) |
Gets a Material based on material_name key. More... | |
std::string | GenerateString (const api::RoadGeometry &road_geometry, const GenerateStringOptions &options) |
Generates and returns a string containing details about the provided 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... | |
std::string | to_str (double value, int precision) |
Converts a double to a string with the specified precision. More... | |
Material | GetMaterialFromMesh (const MaterialType mesh_material) |
|
strong |
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.)
road_geometry
shall belong to exactly one component. std::pair< mesh::GeoMesh, Material > BuildMesh | ( | const api::RoadGeometry * | rg, |
const ObjFeatures & | features, | ||
const api::BranchPointId & | branch_point_id, | ||
const MaterialType & | mesh_material | ||
) |
Builds a map of meshes based on features
properties and the RoadGeometry.
rg | The api::RoadGeometry to model. |
features | Parameters for constructing the mesh. |
branch_point_id | The ID of the api::BranchPoint to model. |
mesh_material | The material to use for the api::BranchPoint. |
std::pair< mesh::GeoMesh, Material > BuildMesh | ( | const api::RoadGeometry * | rg, |
const ObjFeatures & | features, | ||
const api::LaneId & | lane_id, | ||
const MaterialType & | mesh_material | ||
) |
Builds a map of meshes based on features
properties and the RoadGeometry.
rg | the api::RoadGeometry to model. |
features | Parameters for constructing the mesh. |
lane_id | The ID of the api::Lane to model. |
mesh_material | The material to use for the api::Lane. |
if | mesh_material is not one of Lane's valid mesh materials |
std::pair< mesh::GeoMesh, Material > BuildMesh | ( | const api::RoadGeometry * | rg, |
const ObjFeatures & | features, | ||
const api::SegmentId & | segment_id, | ||
const MaterialType & | mesh_material | ||
) |
Builds a map of meshes based on features
properties and the RoadGeometry.
rg | The api::RoadGeometry to model. |
features | Parameters for constructing the mesh. |
segment_id | The ID of the api::Segment to model. |
mesh_material | The material to use for the api::Segment. |
if | mesh_material is not one of Segment's valid mesh materials |
std::map< std::string, std::pair< mesh::GeoMesh, Material > > BuildMeshes | ( | const api::RoadGeometry * | road_geometry, |
const ObjFeatures & | features | ||
) |
Builds a map of meshes based on features
properties and the api::RoadGeometry.
road_geometry | The api::RoadGeometry to model. |
features | Parameters for constructing the mesh. |
std::map< std::string, std::pair< mesh::GeoMesh, Material > > BuildMeshes | ( | const api::RoadNetwork * | road_network, |
const ObjFeatures & | features | ||
) |
Builds a map of meshes based on features
properties and the api::RoadNetwork.
Rules in the api::RoadRulebook will be used to change the direction of the of the lanes and the type of lanes when that information is available.
road_network | The api::RoadNetwork to model. |
features | Parameters for constructing the mesh. |
maliput::common::assertion_error | When road_geometry is nullptr. |
RoadGeometryMesh BuildRoadGeometryMesh | ( | const api::RoadGeometry * | rg, |
const ObjFeatures & | features | ||
) |
Builds a complete RoadGeometryMesh based on features
properties and the RoadGeometry.
rg | the api::RoadGeometry to model. |
features | parameters for constructing the mesh. |
if | mesh_material is not one of BranchPoint's valid mesh materials |
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.
seed_segment
, including seed_segment
itself. void GenerateDotStream | ( | const routing::graph::Graph & | graph, |
const routing::Route & | route, | ||
std::ostream * | os | ||
) |
Generates a string representation in os
of the graph
and route
using the DOT language.
routing::graph::Edges are created as bidirectional, and labels are added to indicate api::Segment::id(). routing::graph::Nodes only indicate their routing::graph::NodeId. The route
is indicated by changing the color to red of edges where it lays.
graph | The routing::graph::Graph to serialize. |
route | The routing::Route to highlight in red on top of the graph . |
os | A pointer to a std::ostream to serialize the graph . It must not be nullptr. |
common::assertion_error | When os is nullptr. |
common::assertion_error | When route's involved api::Segments are not in graph . |
void GenerateDotStream | ( | const routing::graph::Graph & | graph, |
std::ostream * | os | ||
) |
Generates a string representation in os
of the graph
using the DOT language.
routing::graph::Edges are created as bidirectional, and labels are added to indicate api::Segment::id(). routing::graph::Nodes only indicate their routing::graph::NodeId.
graph | The routing::graph::Graph to serialize. |
os | A pointer to a std::ostream to serialize the graph . It must not be nullptr. |
common::assertion_error | When os is nullptr. |
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.
road_geometry | the api::RoadGeometry to model |
dirpath | directory component of the output pathnames |
fileroot | root of the filename component of the output pathnames |
features | parameters 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 segment-bounds of the road surface described by the RoadGeometry.
maliput::common::assertion_error | When road_geometry is nullptr. |
maliput::common::assertion_error | When road_geometry->linear_tolerance() is zero. |
void GenerateObjFile | ( | const api::RoadNetwork * | road_network, |
const std::string & | dirpath, | ||
const std::string & | fileroot, | ||
const ObjFeatures & | features | ||
) |
Generates a Wavefront OBJ model of the road surface of an api::RoadNetwork.
Rules in the api::RoadRulebook will be used to change the direction of the lanes and the type of lanes when that information is available.
road_network | The api::RoadNetwork to model. |
dirpath | Directory component of the output pathnames. |
fileroot | Root of the filename component of the output pathnames. |
features | Parameters 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::RoadNetwork. 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 segment-bounds of the road surface described by the road_network->road_geometry()
.
maliput::common::assertion_error | When road_network is nullptr. |
std::string GenerateString | ( | const api::RoadGeometry & | road_geometry, |
const GenerateStringOptions & | options | ||
) |
Generates and returns a string containing details about the provided api::RoadGeometry.
road_geometry | The api::RoadGeometry. |
options | Options that affect the types of information to include in the returned string. |
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.
road_geometry | the api::RoadGeometry to model |
dirpath | directory component of the output pathnames |
fileroot | root of the filename component of the output pathnames |
features | parameters 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.
std::vector< std::string > GetAllFilePathsFromDirectory | ( | const std::string & | directory_path, |
const std::optional< std::string > & | ends_with_suffix | ||
) |
Get all filepaths from a particular directory.
directory_path | Path to the directory. |
ends_with_suffix | When it is not nullopt, filepaths must end with the ends_with_suffix value. |
directory_path
. The returned paths are absolute if the directory_path
is an absolute path, otherwise it will return relative paths. std::vector< std::string > GetAllPathsFromEnvironment | ( | const std::string & | env_var | ) |
Retrieves a list of paths that live in a environment variable.
When environment variable isn't set the list will be empty.
env_var | Environemnt variable. |
env_var
. const Material & GetMaterialByName | ( | const std::string & | material_name | ) |
Gets a Material based on material_name
key.
Possible material_name
values may be any of the following:
material_name | The key to get the material. |
std::out_of_range | if key is not found. |
Material maliput::utility::GetMaterialFromMesh | ( | const MaterialType | mesh_material | ) |
std::string GetSuffixFromPath | ( | const std::string & | filepath | ) |
Extracts the suffix of a file.
filepath | Path to a file. |
std::string to_str | ( | double | value, |
int | precision | ||
) |
Converts a double to a string with the specified precision.
value | The double to convert. |
precision | The number of digits after the decimal point. |