先锋机器人导航仿真

该文详细介绍了如何在ROS环境下配置和使用RosAria控制移动机器人,利用tf工具查看变换关系,通过gmapping进行SLAM建图,并通过teleop键盘遥控模型。文中还提到了关键参数的设置,如map_update_interval、maxRange等,以及参数对建图效果的影响。
摘要由CSDN通过智能技术生成

参考http://blog.csdn.net/eaibot/article/details/51628371
启动MobileSim
运行lx的模型
启动RosAria

<launch>
	<node pkg="rosaria" type="RosAria" name="RosAria" output="screen">
		<remap from="/RosAria/cmd_vel" to="/cmd_vel"/>
		<remap from="/RosAria/pose" to="/odom"/>
		<remap from="/RosAria/sim_S3Series_1_laserscan" to="scan"/>

		<param name="publish_aria_lasers" value="true"/>
	</node>
</launch>

启动rosaria_client/telop

<launch>
	

	<node pkg="rosaria_client" type="teleop" name="RosAria_interface" output="screen">
		<remap from="/RosAria/cmd_vel" to="/cmd_vel"/>
		
	</node>

</launch>

使用tf 工具查看现在的transform 关系

rosrun tf view_frames

这里写图片描述

利用gmapping 建图
编写gmapping.launch 无所谓是否在一个包内!!

<launch>

  <arg name="scan_topic" default="/scan" />

  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">

    <!--value不可有斜杠 -->
    <param name="odom_frame" value="odom"/>
    <param name="base_frame" value="base_link"/>
    <param name="map_frame" value="map"/>

    
    <param name="map_update_interval" value="0.01"/>
    <!--地图更新的一个间隔,两次scanmatch的间隔,地图更新也受scanmach的影响,如果scanmatch没有成功的话,是不会更新地图的-->
    <param name="maxUrange" value="4.0"/>
    <!--set maxUrange < maximum range of the real sensor <= maxRange -->
    <param name="maxRange" value="5.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="3"/>
    <param name="lstep" value="0.05"/>
    <!--optimize机器人移动的初始值(距离)-->
    <param name="astep" value="0.05"/>
    <!--optimize机器人移动的初始值(角度)-->
    <param name="iterations" value="5"/>
    <!--icp的迭代次数-->
    <param name="lsigma" value="0.075"/>
    <param name="ogain" value="3.0"/>
    <param name="lskip" value="0"/>
    <!--为0,表示所有的激光都处理,尽可能为零,如果计算压力过大,可以改成1-->
    <param name="minimumScore" value="30"/>
    <!--很重要,判断scanmatch是否成功的阈值,过高的话会使scanmatch失败,从而影响地图更新速率-->
    <param name="srr" value="0.01"/>
    <!--以下四个参数是运动模型的噪声参数-->
    <param name="srt" value="0.02"/>
    <param name="str" value="0.01"/>
    <param name="stt" value="0.02"/>
    <param name="linearUpdate" value="0.05"/>
    <!--机器人移动linearUpdate距离,进行scanmatch-->
    <param name="angularUpdate" value="0.0436"/>
    <!--机器人选装angularUpdate角度,进行scanmatch-->
    <param name="temporalUpdate" value="-1.0"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="8"/>
    <!--很重要,粒子个数-->
 
    <param name="xmin" value="-50.0"/>
    <param name="ymin" value="-50.0"/>
    <param name="xmax" value="50.0"/>
    <param name="ymax" value="50.0"/>
 
    <param name="xmin" value="-1.0"/>
    <!--map初始化的大小-->
    <param name="ymin" value="-1.0"/>
    <param name="xmax" value="1.0"/>
    <param name="ymax" value="1.0"/>

    <param name="delta" value="0.05"/>
    <param name="llsamplerange" value="0.01"/>
    <param name="llsamplestep" value="0.01"/>
    <param name="lasamplerange" value="0.005"/>
    <param name="lasamplestep" value="0.005"/>
     
  </node>
</launch>

使用teleop 键盘遥控模型,跑一圈后,保存地图(当前路径的运行该命令, 地图就会保存在该路径下两个文件mymap.pgm mymap.yaml)

rosrun map_server map_saver -f mymap

这里写图片描述

产生这么大偏移的原因是??参数frame value中加了/ 导致?或者一定要指定miniScore 默认为0

gmapping订阅话题

 - tf(tf/tfMessage)
 - scan(sensor_msgs/LaserScan)

参数:
~base_frame (string, default: “base_link”)
The frame attached to the mobile base.
本体的坐标系
~map_frame (string, default: “map”)
The frame attached to the map.
地图的坐标系
~odom_frame (string, default: “odom”)
The frame attached to the odometry system.
里程计的坐标系
~inverted_laser (string, default: “false”)
Is the laser right side up (scans are ordered CCW), or upside down (scans are ordered CW)?
激光是否倒置安装
~throttle_scans (int, default: 1)
Process 1 out of every this many scans (set it to a higher number to skip more scans)
激光每扫描一周跳过多少扫描
~map_update_interval (float, default: 5.0)
How long (in seconds) between updates to the map. Lowering this number updates the occupancy grid more often, at the expense of greater computational load.
地图更新的时间间隔(单位:seconds)。更新间隔越小,计算负荷越大
~xmin (float, default: -100.0)
Initial map size
~ymin (float, default: -100.0)
Initial map size
~xmax (float, default: 100.0)
Initial map size
~ymax (float, default: 100.0)
Initial map size
~delta (float, default: 0.05)
Resolution of the map
初始化地图的大小 、分辨率 、更新频率
~maxUrange (float, default: 80.0)
The maximum usable range of the laser. A beam is cropped to this value.
激光可用的最大距离,超过该值将被截断,应该比传感器距离略小
~maxRange (float)
The maximum range of the sensor. If regions with no obstacles within the range of the sensor should appear as free space in the map, set maxUrange < maximum range of the real sensor <= maxRange.
应该比传感器距离略大
~sigma (float, default: 0.05)
The sigma used by the greedy endpoint matching
用作结束点匹配。
~kernelSize (int, default: 1)
The kernel in which to look for a correspondence
在内核内寻找一个对应。
~lstep (float, default: 0.05)
The optimization step in translation
平移的最优步长。
~astep (float, default: 0.05)
The optimization step in rotation
旋转的最优步长。
~iterations (int, default: 5)
The number of iterations of the scanmatcher
扫描匹配的迭代次数。
~lsigma (float, default: 0.075)
The sigma of a beam used for likelihood computation
波束的sigma,用来计算似然估计。
~ogain (float, default: 3.0)
Gain to be used while evaluating the likelihood, for smoothing the resampling effects
评估似然的增益,用来平滑重采样的影响。
~lskip (int, default: 0)
Number of beams to skip in each scan.
每次扫描跳过的波束。
~minimumScore (float, default: 0.0)
Minimum score for considering the outcome of the scan matching good. Can avoid jumping pose estimates in large open spaces when using laser scanners with limited range (e.g. 5m). Scores go up to 600+, try 50 for example when experiencing jumping estimate issues.
评价扫描匹配良好结果的最低分数。
~srr (float, default: 0.1)
Odometry error in translation as a function of translation (rho/rho)
平移函数在平移时的里程计误差 (rho/rho)。
~srt (float, default: 0.2)
Odometry error in translation as a function of rotation (rho/theta)
旋转函数在平移时的里程计误差 (rho/theta)
~str (float, default: 0.1)
Odometry error in rotation as a function of translation (theta/rho)
平移函数在旋转时的里程计误差 (theta/rho)
~stt (float, default: 0.2)
Odometry error in rotation as a function of rotation (theta/theta)
旋转函数在旋转时的里程计误差 (theta/theta)
~linearUpdate (float, default: 1.0)
Process a scan each time the robot translates this far
机器人平移这么远,处理一次扫描。
~angularUpdate (float, default: 0.5)
Process a scan each time the robot rotates this far
机器人旋转这个角度,处理一次扫描。
~temporalUpdate (float, default: -1.0)
Process a scan if the last scan processed is older than the update time in seconds. A value less than zero will turn time based updates off.
如果上一次扫描处理比更新时间长,处理一次扫描。值小于0,将会关闭更新相关 的时间。
~resampleThreshold (float, default: 0.5)
The Neff based resampling threshold
基于重采样阈值的Neff。
~particles (int, default: 30)
Number of particles in the filter
例子数
~llsamplerange (float, default: 0.01)
Translational sampling range for the likelihood
基于重采样阈值的Neff。
~llsamplestep (float, default: 0.01)
Translational sampling step for the likelihood
似然的平移采样步长。
~lasamplerange (float, default: 0.005)
Angular sampling range for the likelihood
似然的角度采样距离。
~lasamplestep (float, default: 0.005)
Angular sampling step for the likelihood
似然的角度采样步长。
~transform_publish_period (float, default: 0.05)
How long (in seconds) between transform publications.
转换发布间隔,单位:seconds
~occ_thresh (float, default: 0.25)
Threshold on gmapping’s occupancy values. Cells with greater occupancy are considered occupied (i.e., set to 100 in the resulting sensor_msgs/LaserScan). New in 1.1.0.
Gmapping占用值的阈值。有大一些的占用值的单元格,被视为占用。

重要参数:
particles (int, default: 30) gmapping算法中的粒子数,因为gmapping使用的是粒子滤波算法,粒子在不断地迭代更新,所以选取一个合适的粒子数可以让算法在保证比较准确的同时有较高的速度。
minimumScore (float, default: 0.0) 最小匹配得分,这个参数很重要,它决定了对激光的一个置信度,越高说明对激光匹配算法的要求越高,激光的匹配也越容易失败而转去使用里程计数据,而设的太低又会使地图中出现大量噪声,所以需要权衡调整。

move_base

AMCL
http://blog.csdn.net/lanhuadechenmo/article/details/46456483

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要进行ROS机器人导航仿真,你需要安装一些必要的软件包。首先,你可以使用以下命令安装turtlebot相关的软件包:sudo apt-get install ros-kinetic-turtlebot-bringup ros-kinetic-turtlebot-create ros-kinetic-openni-* ros-kinetic-openni2-* ros-kinetic-freenect-* ros-kinetic-usb-cam ros-kinetic-laser-* ros-kinetic-hokuyo-node ros-kinetic-audio-common gstreamer0.10-pocketsphinx ros-kinetic-pocketsphinx ros-kinetic-slam-gmapping ros-kinetic-joystick-drivers python-rosinstall ros-kinetic-orocos-kdl ros-kinetic-python-orocos-kdl python-setuptools ros-kinetic-dynamixel-motor libopencv-dev python-opencv ros-kinetic-vision-opencv ros-kinetic-depthimage-to-laserscan ros-kinetic-arbotix-* ros-kinetic-turtlebot-teleop ros-kinetic-move-base ros-kinetic-map-server ros-kinetic-fake-localization ros-kinetic-amcl。\[1\] 接下来,在安装好ROS kinetic版本的Ubuntu系统中,你可以打开一个终端窗口,并输入以下命令来安装turtlebot包:sudo apt-get install ros-kinetic-turtlebot-*。\[2\] 安装完成后,你可以使用以下命令启动仿真环境并进行自主导航:roslaunch racecar_gazebo racecar_runway_navigation.launch roslaunch racecar_gazebo racecar_rviz.launch。\[3\] 这样,你就可以开始进行ROS机器人导航仿真了。 #### 引用[.reference_title] - *1* *2* [ROS机器人导航仿真(kinetic版本)](https://blog.csdn.net/sinolover/article/details/90721486)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ROS机器人定位导航仿真(包括智能车、无人机飞行的仿真)](https://blog.csdn.net/weixin_43749019/article/details/107284304)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值