Apollo  6.0
Open source self driving car software
Static Public Member Functions | List of all members
apollo::common::VehicleConfigHelper Class Reference

#include <vehicle_config_helper.h>

Collaboration diagram for apollo::common::VehicleConfigHelper:
Collaboration graph

Static Public Member Functions

static void Init ()
 Initialize vehicle configurations with default configuration file pointed by gflags FLAGS_vehicle_config_path. The code will crash if FLAGS_vehicle_config_path does not exist or it points to a file with invalid format. More...
 
static void Init (const VehicleConfig &config)
 Initialize vehicle configurations with config. More...
 
static void Init (const std::string &config_file)
 Initialize vehicle configurations with config_file. The code will crash if config_file does not exist or config_file has invalid format. More...
 
static const VehicleConfig & GetConfig ()
 Get the current vehicle configuration. More...
 
static double MinSafeTurnRadius ()
 Get the safe turning radius when the vehicle is turning with maximum steering angle. More...
 
static common::math::Box2d GetBoundingBox (const common::PathPoint &path_point)
 Get the box (four corners: ABCD) of the vehicle. More...
 

Detailed Description

This is a helper class that can load vehicle configurations. The vehicle configurations are defined modules/common/configs/proto/vehicle_config.proto

Member Function Documentation

◆ GetBoundingBox()

static common::math::Box2d apollo::common::VehicleConfigHelper::GetBoundingBox ( const common::PathPoint &  path_point)
static

Get the box (four corners: ABCD) of the vehicle.

Parameters
path_pointof a vehicle (which contains point X and heading).
Returns
a box2d which contains the ABCD points info.

◆ GetConfig()

static const VehicleConfig& apollo::common::VehicleConfigHelper::GetConfig ( )
static

Get the current vehicle configuration.

Returns
the current VehicleConfig instance reference.

◆ Init() [1/3]

static void apollo::common::VehicleConfigHelper::Init ( )
static

Initialize vehicle configurations with default configuration file pointed by gflags FLAGS_vehicle_config_path. The code will crash if FLAGS_vehicle_config_path does not exist or it points to a file with invalid format.

◆ Init() [2/3]

static void apollo::common::VehicleConfigHelper::Init ( const VehicleConfig &  config)
static

Initialize vehicle configurations with config.

Parameters
configA VehicleConfig class instance. The VehicleConfig class is defined by modules/common/configs/proto/vehicle_config.proto.

◆ Init() [3/3]

static void apollo::common::VehicleConfigHelper::Init ( const std::string &  config_file)
static

Initialize vehicle configurations with config_file. The code will crash if config_file does not exist or config_file has invalid format.

Parameters
config_fileThe configuration file path. The format of the file is defined by protobuf file modules/common/configs/proto/vehicle_config.proto.

◆ MinSafeTurnRadius()

static double apollo::common::VehicleConfigHelper::MinSafeTurnRadius ( )
static

Get the safe turning radius when the vehicle is turning with maximum steering angle.

The calculation is described by the following figure.

   front of car
A +----------+ B
  |          |
  /          / turn with maximum steering angle
  |          |
  |          |
  |          |
  |    X     |                                       O
  |<-->.<----|-------------------------------------->* (turn center)
  |          |   VehicleParam.min_turn_radius()
  |          |
D +----------+ C
   back of car
 

In the above figure, The four corner points of the vehicle is A, B, C, and D. XO is VehicleParam.min_turn_radius(), X to AD is left_edge_to_center, X to AB is VehicleParam.front_edge_to_center(). Then AO = sqrt((XO + left_edge_to_center) ^2 + front_edge_to_center^2).

Returns
AO in the above figure, which is the minimum turn radius when the vehicle turns with maximum steering angle

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