navigation 调试 -2- 小车的配置问题

1.确定传感器(sensors)在小车的位置

影响:导航,建图

a.前提是使用kobuki机器人模板,传感器使用深度+rgb摄像头(例如kinect),默认camera的位置信息由robot_state_publisher节点维护,

配置文件位置在:turtlebot_description/urdf/sensors/kinect.urdf.xacro,文件格式为urdf格式,从中可以看到有些frame是转动了90度(rpy="${-M_PI/2} 0 ${-M_PI/2})。

-rw-r--r-- 1 root root 2890 12月 23  2016 astra.urdf.xacro
-rw-r--r-- 1 root root 2924 12月 23  2016 asus_xtion_pro_offset.urdf.xacro
-rw-r--r-- 1 root root 3717 12月 23  2016 asus_xtion_pro.urdf.xacro
-rw-r--r-- 1 root root 2684 12月 25 15:36 kinect.urdf.xacro
-rw-r--r-- 1 root root 5716 12月 23  2016 r200.urdf.xacro

b.传感器雷达,则需要在launch文件中添加:

<node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.0 0.0 0.30 0 0.0 0.0 base_link laser 100"/>

启动一个名叫base_to_laser节点,周期维护发布雷达的tf消息,雷达的位置是base_link frame基础上的0,0,0.30。


2.确定小车的投影模型

影响:导航

通常小车的投影模型都是圆形,如果不是圆形的话,设计起来就太麻烦。

这个参数在turtlebot_navigation/param/costmap_common_params.yaml配置文件中的robot_radius。

# Obstacle Cost Shaping (http://wiki.ros.org/costmap_2d/hydro/inflation)
robot_radius: 0.30  # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
# footprint: [[x0, y0], [x1, y1], ... [xn, yn]]  # if the robot is not circular


3.确定障碍的膨胀半径

影响:导航

参数在turtlebot_navigation/param/costmap_common_params.yaml配置文件中的inflation radius:

inflation_layer:
  enabled:              true
  cost_scaling_factor:  5.0  # exponential rate at which the obstacle cost drops off (default: 10)
  inflation_radius:     0.3  #default # max. distance from an obstacle at which costs are incurred for planning paths.

此半径说明机器人中心距离的最小安全距离,小于这个距离maybe发生碰撞,大于这个距离则不会发生碰撞。


4.确定小车的转动中心建图

影响:导航,建图

通常使用的小车都是圆形地盘的,但当心小车转动时中心并不一定是圆心,而是车轴中心(2个轮的,4个轮(前后双轮的没玩过))。

此参数在小车的urdf文件中配置。kobuki模型的配置文件kobuki_description/urdf/kobuki.urdf.xacro。修改两个参数,分别是

<joint name="wheel_left_joint" type="continuous">
      <parent link="base_link"/>
      <child link="wheel_left_link"/>
      <origin xyz="0.00 ${0.23/2} 0.0250" rpy="${-M_PI/2} 0 0"/>
      <axis xyz="0 0 1"/>


<joint name="wheel_right_joint" type="continuous">
      <parent link="base_link"/>
      <child link="wheel_right_link"/>
      <origin xyz="0.00 -${0.23/2} 0.0250" rpy="${-M_PI/2} 0 0"/>
      <axis xyz="0 0 1"/>
    </joint>

修改当中的origin参数即可。

这时,控制小车转动就沿着轴中心转动。

备注:在模拟器turtlebot_gazebo中,修改是ok的,但在rviz显示的过程中,修改是无效的,这个好让人无语。

我怀疑是base_link是旋转的中心点,但修改base_link后rviz中也显示不对,很让人无语。


5.确定障碍的inscribed radius,circumscribed_radius

inscribed radius:轴心到底盘边界最近的距离

circumscribed radius:轴心到底盘边界最远的距离

参数在turtlebot_navigation/param/local_costmap_params.yaml,需要增加两个参数,如下:

local_costmap:
   inscribed_radius: 0.20
   circumscribed_radius: 0.30
   global_frame: odom
   robot_base_frame: /base_footprint
   update_frequency: 5.0
   publish_frequency: 2.0


6.

--未完待续


猜你喜欢

转载自blog.csdn.net/sunyoop/article/details/78971417