maliput_integration
maliput_to_string_with_plugin.cc File Reference

Detailed Description

Builds an api::RoadNetwork and lists its entities. The road network is created using the maliput plugin architecture.

Available backends are dragway, multilane and malidrive, flags are provided to correctly configure the requested paramteres for building the road network.

See also
maliput::plugin::MaliputPluginManager
Note
  1. The plugin_name flag will determine the maliput::plugin::RoadNetworkLoader plugin to be selected.
    • "maliput_dragway": The following flags are supported to use in order to create dragway road geometry: -num_lanes, -length, -lane_width, -shoulder_width, -maximum_height.
    • "maliput_multilane": yaml file path must be provided: -yaml_file.
    • "maliput_malidrive": xodr file path must be provided, the tolerances and scale length are optional: -xodr_file_path, -linear_tolerance, -angular_tolerance, -scale_length.
  2. The applications possesses flags to modify the output serialization: -include_type_labels, -include_road_geometry_id, -include_junction_ids, -include_segment_ids, -include_lane_ids, -include_lane_details.
  3. The level of the logger is selected with -log_level.
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <gflags/gflags.h>
#include <maliput/common/logger.h>
#include <maliput/plugin/maliput_plugin.h>
#include <maliput/plugin/maliput_plugin_manager.h>
#include <maliput/plugin/road_network_loader.h>
#include <maliput/utility/generate_string.h>
#include "maliput_gflags.h"
Include dependency graph for maliput_to_string_with_plugin.cc:

Namespaces

 maliput
 
 maliput::integration
 

Functions

 DEFINE_string (plugin_name, "maliput_malidrive", "Id of the RoadNetwork plugin to use.")
 
 DEFINE_string (num_lanes, "2", "The number of lanes.")
 
 DEFINE_string (length, "10", "The length of the dragway in meters.")
 
 DEFINE_string (lane_width, "3.7", "The width of each lane in meters.")
 
 DEFINE_string (shoulder_width, "3.0", "The width of the shoulders in meters. Both shoulders have the same width.")
 
 DEFINE_string (maximum_height, "5.2", "The maximum modelled height above the road surface (meters).")
 
 DEFINE_string (yaml_file, "install/maliput_multilane/share/maliput_multilane/2x2_intersection.yaml", "yaml input file defining a multilane road geometry")
 
 DEFINE_string (opendrive_file, "install/maliput_malidrive/share/maliput_malidrive/resources/odr/LShapeRoad.xodr", "XODR file path. Default LShapeRoad.xodr")
 
 DEFINE_string (linear_tolerance, "5e-2", "Linear tolerance used to load the map.")
 
 DEFINE_string (angular_tolerance, "1e-3", "Angular tolerance used to load the map.")
 
 DEFINE_string (scale_length, "1", "Scale length")
 
 DEFINE_string (standard_strictness_policy, "permissive", "OpenDrive standard strictness, it could be `permissive`, `allow_schema_errors`, `allow_semantic_errors` or " "`strict`. Union of policies are also allowed: 'allow_schema_errors|allow_semantic_errors'")
 
 DEFINE_bool (include_type_labels, false, "Whether to include type labels in the output string")
 
 DEFINE_bool (include_road_geometry_id, false, "Whether to include road geometry IDs in the output string")
 
 DEFINE_bool (include_junction_ids, false, "Whether to include junction IDs in the output string")
 
 DEFINE_bool (include_segment_ids, false, "Whether to include segment IDs in the output string")
 
 DEFINE_bool (include_lane_ids, false, "Whether to include lane IDs in the output string")
 
 DEFINE_bool (include_lane_details, false, "Whether to include lane details in the output string")
 
 MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ DEFINE_bool() [1/6]

DEFINE_bool ( include_junction_ids  ,
false  ,
"Whether to include junction IDs in the output string"   
)

◆ DEFINE_bool() [2/6]

DEFINE_bool ( include_lane_details  ,
false  ,
"Whether to include lane details in the output string"   
)

◆ DEFINE_bool() [3/6]

DEFINE_bool ( include_lane_ids  ,
false  ,
"Whether to include lane IDs in the output string"   
)

◆ DEFINE_bool() [4/6]

DEFINE_bool ( include_road_geometry_id  ,
false  ,
"Whether to include road geometry IDs in the output string"   
)

◆ DEFINE_bool() [5/6]

DEFINE_bool ( include_segment_ids  ,
false  ,
"Whether to include segment IDs in the output string"   
)

◆ DEFINE_bool() [6/6]

DEFINE_bool ( include_type_labels  ,
false  ,
"Whether to include type labels in the output string"   
)

◆ DEFINE_string() [1/12]

DEFINE_string ( angular_tolerance  ,
"1e-3"  ,
"Angular tolerance used to load the map."   
)

◆ DEFINE_string() [2/12]

DEFINE_string ( lane_width  ,
"3.7"  ,
"The width of each lane in meters."   
)

◆ DEFINE_string() [3/12]

DEFINE_string ( length  ,
"10"  ,
"The length of the dragway in meters."   
)

◆ DEFINE_string() [4/12]

DEFINE_string ( linear_tolerance  ,
"5e-2"  ,
"Linear tolerance used to load the map."   
)

◆ DEFINE_string() [5/12]

DEFINE_string ( maximum_height  ,
"5.2"  ,
"The maximum modelled height above the road surface (meters)."   
)

◆ DEFINE_string() [6/12]

DEFINE_string ( num_lanes  ,
"2"  ,
"The number of lanes."   
)

◆ DEFINE_string() [7/12]

DEFINE_string ( opendrive_file  ,
"install/maliput_malidrive/share/maliput_malidrive/resources/odr/LShapeRoad.xodr"  ,
"XODR file path. Default LShapeRoad.xodr"   
)

◆ DEFINE_string() [8/12]

DEFINE_string ( plugin_name  ,
"maliput_malidrive"  ,
"Id of the RoadNetwork plugin to use."   
)

◆ DEFINE_string() [9/12]

DEFINE_string ( scale_length  ,
"1"  ,
"Scale length"   
)

◆ DEFINE_string() [10/12]

DEFINE_string ( shoulder_width  ,
"3.0"  ,
"The width of the shoulders in meters. Both shoulders have the same width."   
)

◆ DEFINE_string() [11/12]

DEFINE_string ( standard_strictness_policy  ,
"permissive"  ,
"OpenDrive standard  strictness,
it could be `permissive`  ,
`allow_schema_errors`  ,
`allow_semantic_errors` or " "`strict`. Union of policies are also allowed:'allow_schema_errors|allow_semantic_errors'"   
)

◆ DEFINE_string() [12/12]

DEFINE_string ( yaml_file  ,
"install/maliput_multilane/share/maliput_multilane/2x2_intersection.yaml"  ,
"yaml input file defining a multilane road geometry"   
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG()

MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG ( )