CARLA
Classes | Public Member Functions | Public Attributes | List of all members
carla::geom::MeshFactory Class Reference

Mesh helper generator. More...

#include <MeshFactory.h>

+ Collaboration diagram for carla::geom::MeshFactory:

Classes

struct  RoadParameters
 Parameters for the road generation. More...
 

Public Member Functions

std::unique_ptr< MeshGenerate (const road::Road &road) const
 Generates a mesh that defines a road. More...
 
std::unique_ptr< MeshGenerate (const road::LaneSection &lane_section) const
 Generates a mesh that defines a lane section. More...
 
std::unique_ptr< MeshGenerate (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a mesh that defines a lane from a given s start and end. More...
 
std::unique_ptr< MeshGenerate (const road::Lane &lane) const
 Generates a mesh that defines the whole lane. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateAllWithMaxLen (const road::Road &road) const
 Generates a chunked road with all the features needed for simulation. More...
 
std::unique_ptr< MeshGenerateLeftWall (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a wall-like mesh at the left side of the lane. More...
 
std::unique_ptr< MeshGenerateRightWall (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a wall-like mesh at the right side of the lane. More...
 
std::unique_ptr< MeshGenerateWalls (const road::LaneSection &lane_section) const
 Genrates a mesh representing a wall on the road corners to avoid cars falling down. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWallsWithMaxLen (const road::Road &road) const
 Generates a list of meshes that defines a road safety wall with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWallsWithMaxLen (const road::LaneSection &lane_section) const
 Generates a list of meshes that defines a lane_section safety wall with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWithMaxLen (const road::Road &road) const
 Generates a list of meshes that defines a road with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWithMaxLen (const road::LaneSection &lane_section) const
 Generates a list of meshes that defines a lane_section with a maximum length. More...
 
std::unique_ptr< MeshMergeAndSmooth (std::vector< std::unique_ptr< Mesh >> &lane_meshes) const
 
 MeshFactory (rpc::OpendriveGenerationParameters params=rpc::OpendriveGenerationParameters())
 

Public Attributes

RoadParameters road_param
 

Detailed Description

Mesh helper generator.

Definition at line 22 of file MeshFactory.h.

Constructor & Destructor Documentation

◆ MeshFactory()

carla::geom::MeshFactory::MeshFactory ( rpc::OpendriveGenerationParameters  params = rpc::OpendriveGenerationParameters())

Member Function Documentation

◆ Generate() [1/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Road road) const

Generates a mesh that defines a road.

Definition at line 29 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by Generate(), carla::road::Map::GenerateChunkedMesh(), carla::road::Map::GenerateMesh(), and GenerateWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Generate() [2/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::LaneSection lane_section) const

Generates a mesh that defines a lane section.

Definition at line 37 of file MeshFactory.cpp.

References Generate(), and carla::road::LaneSection::GetLanes().

+ Here is the call graph for this function:

◆ Generate() [3/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

◆ Generate() [4/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Lane lane) const

Generates a mesh that defines the whole lane.

Definition at line 45 of file MeshFactory.cpp.

References carla::geom::EPSILON, Generate(), carla::road::Lane::GetDistance(), and carla::road::Lane::GetLength().

+ Here is the call graph for this function:

◆ GenerateAllWithMaxLen()

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateAllWithMaxLen ( const road::Road road) const

Generates a chunked road with all the features needed for simulation.

Definition at line 325 of file MeshFactory.cpp.

References GenerateWallsWithMaxLen(), GenerateWithMaxLen(), and carla::road::Road::IsJunction().

Referenced by carla::road::Map::GenerateChunkedMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLeftWall()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateLeftWall ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

Generates a wall-like mesh at the left side of the lane.

Definition at line 174 of file MeshFactory.cpp.

References carla::geom::Mesh::AddMaterial(), carla::geom::Mesh::AddTriangleStrip(), DEBUG_ASSERT, carla::geom::Mesh::EndMaterial(), carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Lane::GetDistance(), carla::road::Lane::GetId(), carla::road::Lane::GetLength(), carla::road::Lane::GetType(), carla::road::Lane::IsStraight(), RELEASE_ASSERT, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::wall_height.

Referenced by GenerateWalls(), and GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateRightWall()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateRightWall ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

Generates a wall-like mesh at the right side of the lane.

Definition at line 123 of file MeshFactory.cpp.

References carla::geom::Mesh::AddMaterial(), carla::geom::Mesh::AddTriangleStrip(), DEBUG_ASSERT, carla::geom::Mesh::EndMaterial(), carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Lane::GetDistance(), carla::road::Lane::GetId(), carla::road::Lane::GetLength(), carla::road::Lane::GetType(), carla::road::Lane::IsStraight(), RELEASE_ASSERT, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::wall_height.

Referenced by GenerateWalls(), and GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWalls()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateWalls ( const road::LaneSection lane_section) const

Genrates a mesh representing a wall on the road corners to avoid cars falling down.

Definition at line 101 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateLeftWall(), GenerateRightWall(), and carla::road::LaneSection::GetLanes().

Referenced by GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWallsWithMaxLen() [1/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWallsWithMaxLen ( const road::Road road) const

Generates a list of meshes that defines a road safety wall with a maximum length.

Definition at line 266 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by GenerateAllWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWallsWithMaxLen() [2/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWallsWithMaxLen ( const road::LaneSection lane_section) const

Generates a list of meshes that defines a lane_section safety wall with a maximum length.

Definition at line 279 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateLeftWall(), GenerateRightWall(), GenerateWalls(), carla::road::LaneSection::GetDistance(), carla::road::LaneSection::GetLanes(), carla::road::LaneSection::GetLength(), carla::geom::MeshFactory::RoadParameters::max_road_len, and road_param.

+ Here is the call graph for this function:

◆ GenerateWithMaxLen() [1/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWithMaxLen ( const road::Road road) const

Generates a list of meshes that defines a road with a maximum length.

Definition at line 225 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by GenerateAllWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWithMaxLen() [2/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWithMaxLen ( const road::LaneSection lane_section) const

Generates a list of meshes that defines a lane_section with a maximum length.

Definition at line 238 of file MeshFactory.cpp.

References carla::geom::EPSILON, Generate(), carla::road::LaneSection::GetDistance(), carla::road::LaneSection::GetLanes(), carla::road::LaneSection::GetLength(), carla::geom::MeshFactory::RoadParameters::max_road_len, and road_param.

+ Here is the call graph for this function:

◆ MergeAndSmooth()

std::unique_ptr< Mesh > carla::geom::MeshFactory::MergeAndSmooth ( std::vector< std::unique_ptr< Mesh >> &  lane_meshes) const

Definition at line 444 of file MeshFactory.cpp.

References carla::geom::GetVertexNeighborhoodAndWeights(), road_param, and carla::geom::Vector3D::z.

Referenced by carla::road::Map::GenerateChunkedMesh(), and carla::road::Map::GenerateMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ road_param

RoadParameters carla::geom::MeshFactory::road_param

The documentation for this class was generated from the following files: