amcl ROS

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 beamlikelihood_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_localization.png

Odometry Location -- 只是通过里程计的数据来处理/base和/odom之间的TF转换;

AMCL  Map Location -- 查找/base和激光的TF。/base通过/odom在/map中行走,机器人根据已知激光数据,估计/base相对于相对于/global的TF,那么我们可以知道/map和/base之间的TF,从而估计位置。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ROS Cartographer 是一种用于激光雷达SLAM(Simultaneous Localization and Mapping,同时定位与建图)的开源软件包,可以在机器人导航过程中进行环境建图和自主定位。而AMCL(Adaptive Monte Carlo Localization,自适应蒙特卡洛定位)则是ROS中常用的一种定位算法。 替换AMCL 使用ROS Cartographer 主要有以下几个好处: 首先,ROS Cartographer 是一种基于激光雷达SLAM的技术,相对于AMCL 只能进行定位的缺点,Cartographer 不仅可以进行定位,还可以同时进行环境建图。这意味着,在使用Cartographer 进行定位的同时,我们也可以通过建图功能得到一个更准确的环境地图,有助于机器人更好地感知和理解周围环境。 其次,ROS Cartographer 提供了更高的定位精度和更稳定的定位性能。相对于蒙特卡洛算法,Cartographer 使用了更多的传感器数据,例如IMU(惯性测量单元)和里程计信息,可以更准确地估计机器人在地图中的位置。 另外,Cartographer 还提供了一些高级功能,例如闭环检测和连接不同地图的能力。这些功能可以进一步提高定位和建图的质量,同时减少定位误差。 此外,ROS Cartographer 是一个非常活跃且受到广泛关注和使用的开源软件包,其社区和文档资源非常丰富。无论是在使用上遇到问题还是想要了解更多关于SLAM的知识,都可以方便地在ROS Cartographer 社区获得帮助。 总而言之,替换AMCL 使用ROS Cartographer 可以提供更全面、更准确和更稳定的定位和建图功能,为机器人导航提供更高的性能和可能性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值