Localization#
This page describes the interface of the Localization component. See the Localization component design for the concepts.
The Localization component estimates the pose, the velocity, and the acceleration of the vehicle. The diagram shows the default setup of autoware_launch: the ndt pose source and the gyro_odom twist source. Other pose sources are YabLoc, Eagleye, AR tags, and LiDAR markers.
The pose initializer also calls the NDT scan matcher to align the first pose with the point cloud map.
Inputs#
| Name | Topic or service | Type | Description |
|---|---|---|---|
| Point cloud map | /map/get_differential_pointcloud_map (service) | autoware_map_msgs/srv/GetDifferentialPointCloudMap | The NDT scan matcher loads the map areas around the vehicle. See the outputs of Map. |
| Point cloud map | /map/get_partial_pointcloud_map (service) | autoware_map_msgs/srv/GetPartialPointCloudMap | The pose initializer uses the map to fit the height of a GNSS pose. If the map loader does not enable partial loading, it uses the /map/pointcloud_map topic instead. |
| LiDAR point cloud | /sensing/lidar/concatenated/pointcloud | sensor_msgs/msg/PointCloud2 | The point cloud for NDT matching. It must first go through the point cloud preprocessing. Localization then crops and downsamples it again. |
| GNSS pose | /sensing/gnss/pose_with_covariance | geometry_msgs/msg/PoseWithCovarianceStamped | The pose from GNSS. The pose initializer uses it for automatic initialization, and the NDT scan matcher can use it for regularization. |
| IMU data | /sensing/imu/imu_data | sensor_msgs/msg/Imu | The angular velocity of the vehicle, after the IMU corrector. |
| Vehicle twist | /sensing/vehicle_velocity_converter/twist_with_covariance | geometry_msgs/msg/TwistWithCovarianceStamped | The velocity of the vehicle. autoware_vehicle_velocity_converter makes it from /vehicle/status/velocity_status (autoware_vehicle_msgs/msg/VelocityReport). |
| Initialize | /localization/initialize (service) | autoware_localization_msgs/srv/InitializeLocalization | A request to initialize the pose. The AUTO method aligns the given pose with the NDT scan matcher. If no pose is given, it uses the GNSS pose. The DIRECT method uses the given pose as it is. The AD API calls this service. |
The GNSS pose comes from the Sensing component. Its gnss_poser node makes it from the GNSS position (sensor_msgs/msg/NavSatFix) and the GNSS-INS orientation (autoware_sensing_msgs/msg/GnssInsOrientationStamped). See Sensing.
In RViz, the 2D Pose Estimate tool publishes /initialpose. The initial pose adaptor of autoware_adapi_adaptors turns it into a call of the AD API /api/localization/initialize. The AD API then calls /localization/initialize.
Outputs#
| Name | Topic | Type | Description |
|---|---|---|---|
| Vehicle kinematic state | /localization/kinematic_state | nav_msgs/msg/Odometry | The current pose and twist of the vehicle. Planning, Control, Perception, and others use it. |
| Vehicle acceleration | /localization/acceleration | geometry_msgs/msg/AccelWithCovarianceStamped | The current acceleration of the vehicle, from the autoware_twist2accel node. |
| Vehicle pose | /localization/pose_with_covariance | geometry_msgs/msg/PoseWithCovarianceStamped | The current pose of the vehicle, from the EKF localizer. |
| Vehicle twist | /localization/pose_twist_fusion_filter/twist_with_covariance | geometry_msgs/msg/TwistWithCovarianceStamped | The current twist of the vehicle, from the EKF localizer. |
| Transform | /tf | tf2_msgs/msg/TFMessage | The transform from map to base_link. |
| Initialization state | /localization/initialization_state | autoware_adapi_v1_msgs/msg/LocalizationInitializationState | The state of the pose initialization. |
| Localization accuracy | /diagnostics | diagnostic_msgs/msg/DiagnosticArray | The autoware_localization_error_monitor node reports when the error ellipse of the pose is too large. |
Use /localization/kinematic_state for the pose and the velocity of the vehicle. The autoware_localization_msgs/msg/KinematicState message holds a pose, a twist, and an acceleration in one message, but no node in the default setup publishes it.