maliput_integration
maliput_to_obj.cc File Reference

Detailed Description

Builds a dragway, multilane or malidrive road geometry and render the road surface to a WaveFront OBJ output file.

Note
  1. It allows to create an OBJ file from different road geometry implementations. The maliput_backend flag will determine the backend to be used.
    • "dragway": The following flags are supported to use in order to create dragway road geometry: -num_lanes, -length, -lane_width, -shoulder_width, -maximum_height.
    • "multilane": yaml file path must be provided: -yaml_file.
    • "malidrive": xodr file path must be provided and the tolerance is optional: -xodr_file_path -linear_tolerance.
  2. The applications possesses flags to modify the OBJ file builder: -obj_dir, -obj_file, -max_grid_unit, -min_grid_resolution, -draw_elevation_bounds, -simplify_mesh_threshold
  3. An urdf file can also be created by passing -urdf flag.
  4. The level of the logger could be setted by: -log_level.
#include <limits>
#include <string>
#include <gflags/gflags.h>
#include <maliput/common/filesystem.h>
#include <maliput/common/logger.h>
#include <maliput/common/maliput_abort.h>
#include <maliput/utility/generate_obj.h>
#include <maliput/utility/generate_urdf.h>
#include <yaml-cpp/yaml.h>
#include "integration/tools.h"
#include "maliput_gflags.h"
Include dependency graph for maliput_to_obj.cc:

Namespaces

 maliput
 
 maliput::integration
 

Functions

 COMMON_PROPERTIES_FLAGS ()
 
 MULTILANE_PROPERTIES_FLAGS ()
 
 DRAGWAY_PROPERTIES_FLAGS ()
 
 MALIDRIVE_PROPERTIES_FLAGS ()
 
 MALIPUT_OSM_PROPERTIES_FLAGS ()
 
 MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG ()
 
 DEFINE_string (maliput_backend, "dragway", "Whether to use <dragway>, <multilane> or <malidrive>. Default is dragway.")
 
 DEFINE_bool (urdf, false, "Enable URDF file creation.")
 
 DEFINE_string (dirpath, ".", "Directory to contain rendered road surface")
 
 DEFINE_string (file_name_root, "maliput_to_obj", "Basename for output Wavefront OBJ and MTL files")
 
 DEFINE_double (max_grid_unit, maliput::utility::ObjFeatures().max_grid_unit, "Maximum size of a grid unit in the rendered mesh covering the " "road surface")
 
 DEFINE_double (min_grid_resolution, maliput::utility::ObjFeatures().min_grid_resolution, "Minimum number of grid-units in either lateral or longitudinal " "direction in the rendered mesh covering the road surface")
 
 DEFINE_bool (draw_elevation_bounds, maliput::utility::ObjFeatures().draw_elevation_bounds, "Whether to draw the elevation bounds")
 
 DEFINE_double (simplify_mesh_threshold, maliput::utility::ObjFeatures().simplify_mesh_threshold, "Optional tolerance for mesh simplification, in meters. Make it " "equal to the road linear tolerance to get a mesh size reduction " "while keeping geometrical fidelity.")
 
 DEFINE_bool (draw_arrows, maliput::utility::ObjFeatures().draw_arrows, "Whether to draw arrows for indicating the direction of the road ")
 
 DEFINE_bool (draw_branch_points, maliput::utility::ObjFeatures().draw_branch_points, "Whether to draw the branch points of the road")
 
 DEFINE_bool (draw_stripes, maliput::utility::ObjFeatures().draw_stripes, "Whether to draw stripes along boundaries of each lane")
 
 DEFINE_bool (draw_lane_haze, maliput::utility::ObjFeatures().draw_lane_haze, "Whether to draw the highlighting swath with boundaries of each lane")
 
int main (int argc, char *argv[])
 

Function Documentation

◆ COMMON_PROPERTIES_FLAGS()

COMMON_PROPERTIES_FLAGS ( )

◆ DEFINE_bool() [1/6]

DEFINE_bool ( draw_arrows  ,
maliput::utility::ObjFeatures().  draw_arrows,
"Whether to draw arrows for indicating the direction of the road "   
)

◆ DEFINE_bool() [2/6]

DEFINE_bool ( draw_branch_points  ,
maliput::utility::ObjFeatures().  draw_branch_points,
"Whether to draw the branch points of the road"   
)

◆ DEFINE_bool() [3/6]

DEFINE_bool ( draw_elevation_bounds  ,
maliput::utility::ObjFeatures().  draw_elevation_bounds,
"Whether to draw the elevation bounds"   
)

◆ DEFINE_bool() [4/6]

DEFINE_bool ( draw_lane_haze  ,
maliput::utility::ObjFeatures().  draw_lane_haze,
"Whether to draw the highlighting swath with boundaries of each lane  
)

◆ DEFINE_bool() [5/6]

DEFINE_bool ( draw_stripes  ,
maliput::utility::ObjFeatures().  draw_stripes,
"Whether to draw stripes along boundaries of each lane  
)

◆ DEFINE_bool() [6/6]

DEFINE_bool ( urdf  ,
false  ,
"Enable URDF file creation."   
)

◆ DEFINE_double() [1/3]

DEFINE_double ( max_grid_unit  ,
maliput::utility::ObjFeatures().  max_grid_unit,
"Maximum size of a grid unit in the rendered mesh covering the " "road surface"   
)

◆ DEFINE_double() [2/3]

DEFINE_double ( min_grid_resolution  ,
maliput::utility::ObjFeatures().  min_grid_resolution,
"Minimum number of grid-units in either lateral or longitudinal " "direction in the rendered mesh covering the road surface"   
)

◆ DEFINE_double() [3/3]

DEFINE_double ( simplify_mesh_threshold  ,
maliput::utility::ObjFeatures().  simplify_mesh_threshold,
"Optional tolerance for mesh  simplification,
in meters. Make it " "equal to the road linear tolerance to get a mesh size reduction " "while keeping geometrical fidelity."   
)

◆ DEFINE_string() [1/3]

DEFINE_string ( dirpath  ,
"."  ,
"Directory to contain rendered road surface"   
)

◆ DEFINE_string() [2/3]

DEFINE_string ( file_name_root  ,
"maliput_to_obj"  ,
"Basename for output Wavefront OBJ and MTL files"   
)

◆ DEFINE_string() [3/3]

DEFINE_string ( maliput_backend  ,
"dragway"  ,
"Whether to use <dragway>  ,
< multilane > or< malidrive >. Default is dragway."   
)

◆ DRAGWAY_PROPERTIES_FLAGS()

DRAGWAY_PROPERTIES_FLAGS ( )

◆ main()

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

◆ MALIDRIVE_PROPERTIES_FLAGS()

MALIDRIVE_PROPERTIES_FLAGS ( )

◆ MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG()

MALIPUT_APPLICATION_DEFINE_LOG_LEVEL_FLAG ( )

◆ MALIPUT_OSM_PROPERTIES_FLAGS()

MALIPUT_OSM_PROPERTIES_FLAGS ( )

◆ MULTILANE_PROPERTIES_FLAGS()

MULTILANE_PROPERTIES_FLAGS ( )