This module provides localization service. There are two methods provided by default. One is RTK(Real Time Kinematic) based method which incorporates GPS and IMU information, the other is multi-sensor fusion method which incorporates GPS, IMU, and LiDAR information.
In the provided RTK localization method, there are two inputs:
- GPS - The Global Position System.
- IMU - Inertial Measurement Unit.
In the provided multi-sensor fusion localization method, there are three inputs:
- GPS - The Global Position System.
- IMU - Inertial Measurement Unit.
- LiDAR - Light Detection And Ranging Sensor. For more information, refer to multi-sensor fusion localizaiton.
- An object instance defined by Protobuf message
LocalizationEstimate
, which can be found in filelocalization/proto/localization.proto
.
Currently the RTK based localization is implemented in class RTKLocalization
. If a new localization method need to be implemented with a name such as FooLocalization
, you can follow the following steps:
-
In
proto/localization_config.proto
, addFOO
in theLocalizationType
enum type. -
Go to the
modules/localization
directory, and create afoo
directory. In thefoo
directory, implement classFooLocalization
following theRTKLocalization
class in thertk
directory.FooLocalization
has to be a subclass ofLocalizationBase
. Also create file foo/BUILD following filertk/BUILD
. -
You need to register
FooLocalizatoin
class in functionLocalization::RegisterLocalizationMethods()
, which is located in cpp filelocalization.cc
. You can register by inserting the following code at the end of the function:
localization_factory_.Register(LocalizationConfing::FOO, []()->LocalizationBase* { return new FooLocalization(); });
Make sure your code can be compiled by including the header files that defines class FooLocalization
.
- Now you can go back to the
apollo
root directory and build your code with commandbash apollo.sh build
.