ROS move_base

参考博客经验 http://blog.exbot.net/archives/1129

https://blog.csdn.net/heyijia0327/article/details/41823809/

https://www.ncnynl.com/archives/201708/1898.html


move_base 问题https://answers.ros.org/question/226036/move_base-acting-weird-with-nodes-running-on-different-hosts/

[ WARN] [1455012218.435531811]: Map update loop missed its desired rate of 3.0000Hz... the loop actually took 1.0281 seconds
[ WARN] [1455012218.953750145]: Control loop missed its desired rate of 3.0000Hz... the loop actually took 0.5194 seconds

I've figured it out. The control loop on the arm-board takes about 0.7 seconds, so you have to set the rate accordingly. If you do that it just works, which will include the weirdness. This is due to the design of move_base in that it only sets a new /cmd_vel after each loop. I now realise that this is exacly what I see.

So the question is basically answered, but I want a better behaviour of course. I see several possibilities.

First, and that is what I will use as a workaround, is running move_base on the main PC. And this works perfectly. But because we anticipate to have 10 of these robots running around, I really want the code to run on the arm-board.

Getting a more powerful computer on the robot would be defeat, especially because my intuition says that it should be possible with the current processor. And a more powerful computer would need more power etc.

So in the end I probably need to make move_base faster. As I already wrote in my question a possibility would be to let move_base deliver the complete path, instead of /cmd_vel messages. Then a separate node could use these paths to create /cmd_vel messages at a higher rate. The complete path is already available, as seen in rviz. At some future point I will design this, or does something like this already exists?








3.1 Action Subscribed Topics

move_base/goal (move_base_msgs/MoveBaseActionGoal)
move_base的搜索目标
move_base/cancel (actionlib_msgs/GoalID)
取消特定目标的请求
3.2 Action Published Topics
move_base/feedback (move_base_msgs/MoveBaseActionFeedback)
Feedback含有基座当前位置信息
move_base/status (actionlib_msgs/GoalStatusArray)
携带目标执行的状态信息
move_base/result (move_base_msgs/MoveBaseActionResult)
            对于move_base action的result为空


4 Subscribed Topics
move_base_simple/goal (geometry_msgs/PoseStamped)
对于不需要知道goal执行状态的需求,提供的非action接口
5 Published Topics
cmd_vel (geometry_msgs/Twist)
要移动底座执行的速度命令流



~controller_frequency (double, default: 20.0) 

以Hz为单位的速率运行控制循环并向基座发送速度命令。
~planner_patience (double, default: 5.0) 
在空间清理操作执行前,路径规划器等待多长时间(秒)用来找出一个有效规划。

~controller_patience (double, default: 15.0) 
在空间清理操作执行前,控制器会等待多长时间(秒)用来找出一个有效控制。

~conservative_reset_dist (double, default: 3.0) 
当在地图中清理出空间时候,距离机器人几米远的障碍将会从costmap清除。
注意:该参数仅用于move_base使用了默认参数的情况。


~recovery_behavior_enabled (bool, default: true) 
是否启用move_base修复机制来清理出空间
~clearing_rotation_allowed (bool, default: true) 
决定做清理空间操作时候,机器人是否会采用原地旋转。
注意:该参数仅用于move_base使用了默认参数的情况,这意味着用户尚未将recovery_behaviors参数设置为任何自定义形式。

~shutdown_costmaps (bool, default: false) 
当move_base进入inactive状态时候,决定是否停用节点的costmap
~oscillation_timeout (double, default: 0.0) 
执行修复操作之前,允许的震荡时间是几秒。 值0意味着永不超时。New in navigation 1.3.1
~oscillation_distance (double, default: 0.5) 
机器人需要移动多少距离才算作没有震荡。 移动完毕后重置定时器计入参数~oscillation_timeout。 New in navigation 1.3.1
~planner_frequency (double, default: 0.0) 
全局路径规划器loop速率。如果设置这个为0.0, 当收到新目标点或者局部路径规划器报告路径不通时候全局路径规划器才启动。New in navigation 1.6.0
~max_planning_retries (int32_t, default: -1) 


代价地图的配置 (local_costmap)& (global_costmap)

       导航功能包使用两种代价地图存储周围环境中的障碍信息,一种用于全局路径规划,一种用于本地路径规划和实时避障。两种代价地图需要使用一些共同和独立的配置文件:通用配置文件,全局规划配置文件,本地规划配置文件。以下将详细讲解这三种配置文件:

(1)通用配置文件(Common Configuration (local_costmap) &(global_costmap))

      代价地图用来存储周围环境的障碍信息,其中需要注明地图关注的机器人传感器消息,以便于地图信息进行更行。针对两种代价地图通用的配置选项,创建名为costmap_common_params.yaml的配置文件:

[html]  view plain  copy
  1. obstacle_range: 2.5  
  2. raytrace_range: 3.0  
  3. footprint: [[x0, y0], [x1, y1], ... [xn, yn]]  
  4. #robot_radius: ir_of_robot  
  5. inflation_radius: 0.55  
  6.   
  7. observation_sources: laser_scan_sensor point_cloud_sensor  
  8.   
  9. laser_scan_sensor: {sensor_frame: frame_name, data_type: LaserScan, topic: topic_name, marking: true, clearing: true}  
  10.   
  11. point_cloud_sensor: {sensor_frame: frame_name, data_type: PointCloud, topic: topic_name, marking: true, clearing: true}  

      详细解析以上配置文件的内容:

[html]  view plain  copy
  1. obstacle_range: 2.5  
  2. raytrace_range: 3.0  

       这两个参数用来设置代价地图中障碍物的相关阈值。obstacle_range参数用来设置机器人检测障碍物的最大范围,设置为2.5意为在2.5米范围内检测到的障碍信息,才会在地图中进行更新。raytrace_range参数用来设置机器人检测自由空间的最大范围,设置为3.0意为在3米范围内,机器人将根据传感器的信息,清除范围内的自由空间。

[html]  view plain  copy
  1. footprint: [[x0, y0], [x1, y1], ... [xn, yn]]  
  2. #robot_radius: ir_of_robot  
  3. inflation_radius: 0.55  

       这些参数用来设置机器人在二维地图上的占用面积,如果机器人外形是圆形,则需要设置机器人的外形半径。所有参数以机器人的中心作为坐标(00)点。inflation_radius参数是设置障碍物的膨胀参数,也就是机器人应该与障碍物保持的最小安全距离,这里设置为0.55意为为机器人规划的路径应该与机器人保持0.55米以上的安全距离。

[html]  view plain  copy
  1. observation_sources: laser_scan_sensorpoint_cloud_sensor  

     observation_sources参数列出了代价地图需要关注的所有传感器信息,每一个传感器信息都将在后边列出详细信息。

[html]  view plain  copy
  1. laser_scan_sensor: {sensor_frame: frame_name, data_type:LaserScan, topic: topic_name, marking: true, clearing: true}  

       以激光雷达为例,sensor_frame标识传感器的参考系名称,data_type表示激光数据或者点云数据使用的消息类型,topic_name表示传感器发布的话题名称,而markingclearing参数用来表示是否需要使用传感器的实时信息来添加或清楚代价地图中的障碍物信息。

2)全局规划配置文件(Global Configuration (global_costmap)

        全局规划配置文件用来存储用于全局代价地图的配置参数,我们使用global_costmap_params.yaml来命名,内容如下:

[html]  view plain  copy
  1. global_costmap:  
  2.  global_frame: /map  
  3.  robot_base_frame: base_link  
  4.  update_frequency: 5.0  
  5.   static_map:true  

     global_frame参数用来表示全局代价地图需要在那个参考系下运行,这里我们选择了map这个参考系。robot_base_frame参数表示代价地图可以参考的机器人本体的参考系。update_frequency参数绝地全局地图信息更新的频率,单位是Hzstatic_map参数决定代价地图是否需要根据map_server提供的地图信息进行初始化,如果你不需要使用已有的地图或者map_server,最好将该参数设置为false

3)本地规划配置文件(Local Configuration (local_costmap)

       本地规划配置文件用来存储用于本地代价地图的配置参数,命名为local_costmap_params.yaml,内容如下:

[html]  view plain  copy
  1. local_costmap:  
  2.  global_frame: odom  
  3.  robot_base_frame: base_link  
  4.  update_frequency: 5.0  
  5.  publish_frequency: 2.0  
  6.   static_map:false  
  7.  rolling_window: true  
  8.   width: 6.0  
  9.   height: 6.0  
  10.   resolution:0.05  

      "global_frame", "robot_base_frame","update_frequency",  "static_map"参数的意义与全局规划配置文件中的参数相同。publish_frequency设置代价地图发布可视化信息的频率,单位是Hzrolling_window参数是用来设置在机器人移动过程中是否需要滚动窗口,以保持机器人处于中心位置。"width," "height," "resolution" 设置设置代价地图长(米)、高(米)和分辨率(米/格)。分辨率可以设置的与静态地图不同,但是一般情况下两者是相同的。


    本地规划器base_local_planner的主要作用是根据规划的全局路径,计算发布给机器人的速度指令。该规划器需要我们根据机器人的规格,配置一些相应的参数。我们创建名为base_local_planner_params.yaml的配置文件

base_local_planner_params.yaml:


       controller_frequency:更新规划的频率,建议3~5

       max_vel_x:最大线速度,单位m/s。Create的turtlebot限制速度为0.5m/s,一般建议室内在0.3m/s以内。

       min_vel_x:最小线速度,单位同上。

       max_vel_y,min_vel_y:不知道是什么速度,官方解释差速轮驱动这两个值为0。个人理解应该对于两个差速轮,只有x方向的一个线速度。而像麦克纳姆轮多个轮,可以有y方向的线速度


       max_vel_theta: 最大角速度,单位rad/s。这个值不要设置太高。默认1.0rad/s。


       min_vel_theta:最小角速度,单位rad/s。默认-1.0rad/s。(上面两个速度我的rbx1包中竟然没有)


       min_in_place_vel_theta:原地旋转角速度的最小值,单位rad/s,默认0.5rad/s。


       escape_vel:逃逸速度,单位m/s默认-0.1m/s。为什么叫逃逸速度呢?反正这个速度是反转,姑且算是‘逃逸’速度吧。


    


acc_lim_x:x方向的最大线速度的加速度,单位m/s2。默认2.5m/s2。


       acc_lim_y:同上,只是y方向的加速度。故对于两轮差速驱动,该值为0。


       acc_lim_theta:角速度加速度限值,单位rad/s2。默认为3.2rad/s2。


 


holonomic_robot:全方向机器人。对于两轮差速,该值为false。


yaw_goal_tolerance:允许机器人缩到目标的方向(弧度)偏差,该值设置小可能导致机器人接近目标振荡。默认为0.1。


xy_goal_tolerance:允许机器人所到目标的坐标(以米为单位)偏差,该值过小可能导致机器人在目标位置附近不断调整到精确的目标位置。默认为0.1。


latch_xy_goal_tolerance:目标坐标偏差锁存,如果上锁,机器人到达过坐标后只进行简单的方向调整,即使在公差外。默认为false。


pdist_scale:(path distance)地图单元格的路径距离系数,默认为0.6。决定有多接近路径。


gdist_scale:(goal distance)地图单元格两点距离的系数,默认为0.6。决定有多接近局部目标。


occdist_scale:沿障碍物轨迹最大距离系数


cost =  pdist_scale * (distance to path from the endpoint of the trajectory in map cells or meters depending on the meter_scoring parameter)  + gdist_scale * (distance to local goal from the endpoint of the trajectory in map cells or meters depending on the meter_scoring parameter) + occdist_scale * (maximum obstacle cost along the trajectory in obstacle cost (0-254))


meter_scoring: true   以米为单位


 


heading_lookahead:原地旋转时向前看多少米,默认0.35


heading_scoring: 通过机器人航向计算还是通过路径计算距离,默认false     heading_scoring_timestep: 航向计算距离时,沿着模拟轨迹向前看的时间,默认0.8


occdist_scale:控制器应该避开障碍物的的轻易程度,默认0.1


oscillation_reset_dist: 在振荡标志被清零前,机器人必须在出行多远。默认0.05.


publish_cost_grid_pc:是否使用cost_grid发布。如果为true,在/ cost_cloud话题生成sensor_msgs/ PointCloud2。


prune_plan: 设置为true,机器人行走1m后,结束动作。


 


sim_time: 模拟轨迹的时间,默认1.0s


sim_granularity: 给定轨迹的步长,默认0.025米


angular_sim_granularity: 给定角度轨迹的弧长,默认0.025弧度


vx_samples: x方向速度的样本数,默认为8


vy_samples: y方向速度的样本数,两轮差速为0.


vtheta_samples: 角速度的样本数,默认为20


dwa:是否使用动态窗口方法(DWA),或者是否使用轨迹。默认为true


simple_attractor: false  不知道是什么作用


 

猜你喜欢

转载自blog.csdn.net/fantasysolo/article/details/80322522