天天看點

amcl ROS1.算法2.舉例3.節點3.1.6Transforms

AMCL是機器人在二維地圖移動過程中的機率定位系統。它應用自适應的蒙特卡洛定位方式(或者KLD采樣),采用微粒過濾器來跟蹤已知地圖中機器人的位姿。

1.算法

在Probabilistic Robotics一書中,很好的對AMCL算法和參數進行描述。建議使用者檢視更多的細節。特别是,我們使用以下的算法: sample_motion_model_odometry, beam_range_finder_model, likelihood_field_range_finder_model, Augmented_MCL, and KLD_Sampling_MCL。

目前完成的,這個節點隻用于laser scans和laser map。它可以被擴充應用與其他的雷射資料工作。

2.舉例

在base_scan的topic上利用雷射資料來定位:

amcl scan:=base_scan
           

3.節點

AMCL需要輸入laser-based map, laser scans, 和TF轉換,并且輸出位置估計。在啟動時,AMCL根據所提供的參數來初始化它的顆粒過濾器。由于預設原因,如果沒有參數設定,初始過濾狀态以一個中等大小的粒子雲為中心(0,0,0)。

有三種類型的ROS參數可以用來配置AMCL節點:整體濾波器,雷射模式,odometery模型。

Subscribed Topics

scan  ( sensor_msgs/LaserScan )

  • Laser scans.

tf  ( tf/tfMessage )

  • Transforms.

initialpose  ( geometry_msgs/PoseWithCovarianceStamped )

  • Mean and covariance with which to (re-)initialize the particle filter.

map  ( nav_msgs/OccupancyGrid )

  • When the use_map_topic parameter is set, AMCL subscribes to this topic to retrieve the map used for laser-based localization. New in navigation 1.4.2.

Published Topics

amcl_pose  ( geometry_msgs/PoseWithCovarianceStamped )

  • Robot's estimated pose in the map, with covariance.

particlecloud  ( geometry_msgs/PoseArray )

  • The set of pose estimates being maintained by the filter.

tf  ( tf/tfMessage )

  • Publishes the transform from odom (which can be remapped via the ~odom_frame_id parameter) to map.

Services

global_localization  ( std_srvs/Empty )

  • Initiate global localization, wherein all particles are dispersed randomly through the free space in the map.

Services Called

static_map  ( nav_msgs/GetMap )

  • amcl calls this service to retrieve the map that is used for laser-based localization; startup blocks on getting the map from this service.

Parameters

There are three categories of ROS Parameters that can be used to configure the amcl node: overall filter, laser model, and odometery model.

Overall filter parameters

~min_particles (int, default: 100)

  • Minimum allowed number of particles.

~max_particles  ( int , default: 5000)

  • Maximum allowed number of particles.

~kld_err  ( double , default: 0.01)

  • Maximum error between the true distribution and the estimated distribution.

~kld_z  ( double , default: 0.99)

  • Upper standard normal quantile for (1 - p), where p is the probability that the error on the estimated distrubition will be less than kld_err.

~update_min_d  ( double , default: 0.2 meters)

  • Translational movement required before performing a filter update.

~update_min_a  ( double , default: π/6.0 radians)

  • Rotational movement required before performing a filter update.

~resample_interval  ( int , default: 2)

  • Number of filter updates required before resampling.

~transform_tolerance  ( double , default: 0.1 seconds)

  • Time with which to post-date the transform that is published, to indicate that this transform is valid into the future.

~recovery_alpha_slow  ( double , default: 0.0 ( disabled ))

  • Exponential decay rate for the slow average weight filter, used in deciding when to recover by adding random poses. A good value might be 0.001.

~recovery_alpha_fast  ( double , default: 0.0 ( disabled ))

  • Exponential decay rate for the fast average weight filter, used in deciding when to recover by adding random poses. A good value might be 0.1.

~initial_pose_x  ( double , default: 0.0 meters)

  • Initial pose mean (x), used to initialize filter with Gaussian distribution.

~initial_pose_y  ( double , default: 0.0 meters)

  • Initial pose mean (y), used to initialize filter with Gaussian distribution.

~initial_pose_a  ( double , default: 0.0 radians)

  • Initial pose mean (yaw), used to initialize filter with Gaussian distribution.

~initial_cov_xx  ( double , default: 0.5*0.5 meters)

  • Initial pose covariance (x*x), used to initialize filter with Gaussian distribution.

~initial_cov_yy  ( double , default: 0.5*0.5 meters)

  • Initial pose covariance (y*y), used to initialize filter with Gaussian distribution.

~initial_cov_aa  ( double , default: (π/12)*(π/12) radian)

  • Initial pose covariance (yaw*yaw), used to initialize filter with Gaussian distribution.

~gui_publish_rate  ( double , default: -1.0 Hz)

  • Maximum rate (Hz) at which scans and paths are published for visualization, -1.0 to disable.

~save_pose_rate  ( double , default: 0.5 Hz)

  • Maximum rate (Hz) at which to store the last estimated pose and covariance to the parameter server, in the variables ~initial_pose_* and ~initial_cov_*. This saved pose will be used on subsequent runs to initialize the filter. -1.0 to disable.

~use_map_topic  ( bool , default: false)

  • When set to true, AMCL will subscribe to the map topic rather than making a service call to receive its map. New in navigation 1.4.2

~first_map_only  ( bool , default: false)

  • When set to true, AMCL will only use the first map it subscribes to, rather than updating each time a new one is received. New in navigation 1.4.2
Laser model parameters

Note that whichever mixture weights are in use should sum to 1. The beam model uses all 4: z_hit, z_short, z_max, and z_rand. The likelihood_field model uses only 2: z_hit and z_rand.

~laser_min_range (double, default: -1.0)

  • Minimum scan range to be considered; -1.0 will cause the laser's reported minimum range to be used.

~laser_max_range  ( double , default: -1.0)

  • Maximum scan range to be considered; -1.0 will cause the laser's reported maximum range to be used.

~laser_max_beams  ( int , default: 30)

  • How many evenly-spaced beams in each scan to be used when updating the filter.

~laser_z_hit  ( double , default: 0.95)

  • Mixture weight for the z_hit part of the model.

~laser_z_short  ( double , default: 0.1)

  • Mixture weight for the z_short part of the model.

~laser_z_max  ( double , default: 0.05)

  • Mixture weight for the z_max part of the model.

~laser_z_rand  ( double , default: 0.05)

  • Mixture weight for the z_rand part of the model.

~laser_sigma_hit  ( double , default: 0.2 meters)

  • Standard deviation for Gaussian model used in z_hit part of the model.

~laser_lambda_short  ( double , default: 0.1)

  • Exponential decay parameter for z_short part of model.

~laser_likelihood_max_dist  ( double , default: 2.0 meters)

  • Maximum distance to do obstacle inflation on map, for use in likelihood_field model.

~laser_model_type  ( string , default:  "likelihood_field" )

  • Which model to use, either beam, likelihood_field, or likelihood_field_prob (same as likelihood_field but incorporates the beamskip feature, if enabled).
Odometery model parameters

If ~odom_model_type is "diff" then we use the sample_motion_model_odometry algorithm from Probabilistic Robotics, p136; this model uses the noise parameters odom_alpha_1 through odom_alpha4, as defined in the book.

If ~odom_model_type is "omni" then we use a custom model for an omni-directional base, which uses odom_alpha_1 throughodom_alpha_5. The meaning of the first four parameters is similar to that for the "diff" model. The fifth parameter capture the tendency of the robot to translate (without rotating) perpendicular to the observed direction of travel.

~odom_model_type (string, default: "diff")

  • Which model to use, either "diff" or "omni".

~odom_alpha1  ( double , default: 0.2)

  • Specifies the expected noise in odometry's rotation estimate from the rotational component of the robot's motion.

~odom_alpha2  ( double , default: 0.2)

  • Specifies the expected noise in odometry's rotation estimate from translational component of the robot's motion.

~odom_alpha3  ( double , default: 0.2)

  • Specifies the expected noise in odometry's translation estimate from the translational component of the robot's motion.

~odom_alpha4  ( double , default: 0.2)

  • Specifies the expected noise in odometry's translation estimate from the rotational component of the robot's motion.

~odom_alpha5  ( double , default: 0.2)

  • Translation-related noise parameter (only used if model is "omni").

~odom_frame_id  ( string , default:  "odom" )

  • Which frame to use for odometry.

~base_frame_id  ( string , default:  "base_link" )

  • Which frame to use for the robot base

~global_frame_id  ( string , default:  "map" )

  • The name of the coordinate frame published by the localization system

~tf_broadcast  ( bool , default: true)

  • Set this to false to prevent amcl from publishing the transform between the global frame and the odometry frame.

3.1.6Transforms

AMCL将傳入的雷射掃描資料轉為裡程計結構(odom_frame_id)。是以,必須存在從雷射釋出到裡程計的tf樹轉換。

實作細節:在接收第一個雷射掃描,AMCL查找雷射結構和base計結構的TF轉換,并且鎖存。是以AMCL不能處理雷射于base相對移動的情況。

下面的圖檔顯示用裡程計和AMCL定位的不同之處。在操作過程中,AMCL估計base結構相當于global結構TF轉換,但是,它隻是放global和裡程計之間的TF轉換。從本質上,這種轉換利用航位推算來處理漂移,所釋出的轉換是遠期的。

amcl ROS1.算法2.舉例3.節點3.1.6Transforms

Odometry Location -- 隻是通過裡程計的資料來處理/base和/odom之間的TF轉換;

AMCL  Map Location -- 查找/base和雷射的TF。/base通過/odom在/map中行走,機器人根據已知雷射資料,估計/base相對于相對于/global的TF,那麼我們可以知道/map和/base之間的TF,進而估計位置。

繼續閱讀