带有 LIDAR 的 ROS 1 移动机器人无法避开 LIDAR 检测到的障碍物

问题描述 投票:0回答:1

我想分享我的问题,以便更好地了解正在发生的事情。我会尽可能描述性。

情况是这样的:我有一个使用ROS 1并配备激光雷达的移动机器人。机器人的目标是避开预定义地图上的障碍物以及使用激光雷达动态检测到的障碍物(移动障碍物)。机器人成功避开了地图上的预定义障碍物,但我遇到了动态避障问题。

我正在分享我的全局和本地 YAML 文件,以及与导航系统相关的启动文件,供您参考。

  • AMCL 启动文件:
<launch>
<!-- Load the map -->
<!-- <arg name="map_file" default="/home/ubuntu/psybot_ws/testst1.yaml"/> -->
 
    <!-- Run AMCL -->
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<param name="odom_frame_id" value="odom"/>
<param name="base_frame_id" value="base_link"/>
<param name="global_frame_id" value="map"/>
<param name="min_particles" value="100"/>
<param name="max_particles" value="2000"/>
<param name="initial_pose_x" value="0.0"/>
<param name="initial_pose_y" value="0.0"/>
<param name="initial_pose_a" value="0.0"/>
<param name="laser_min_range" value="-1.0"/>
<param name="laser_max_range" value="0.5"/> <!-- change from 2 to 0.5  07/02/2024 -->
<param name="laser_max_beams" value="30"/> 
<param name="gui_publish_rate" value="10.0"/>

<!-- 02/07/2024, these parameters are used to decrease the influence of the lidar. -->
<param name="laser_z_hit" value="0.05"/>
<param name="laser_z_rand" value="0.95"/>
<param name="laser_sigma_hit" value="1.0"/>



<!-- Remap the laser topic -->

</node>
<!-- Transform broadcaster for the static transform between map and odom if needed -->
<!-- You might need to adjust or remove this depending on your setup -->
<node pkg="tf" type="static_transform_publisher" name="odom_to_map_broadcaster"
          args="0 0 0 0 0 0 1 map odom 100"/>

</launch>
  • 移动基础启动文件:
<?xml version="1.0"?>
<launch>

  <!-- Run the map server -->
 <!-- <arg name="map_file" default="/home/ubuntu/psybot_ws/testst1.yaml"/> -->
 <!-- <arg name="move_forward_only" default="true"/> -->
 <!-- <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" /> -->

<!-- <arg name="no_static_map" default="false"/> -->
  

  <arg name="base_global_planner" default="navfn/NavfnROS"/>
  <arg name="base_local_planner" default="dwa_local_planner/DWAPlannerROS"/>

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <param name="base_global_planner" value="$(arg base_global_planner)"/>
    <param name="base_local_planner" value="$(arg base_local_planner)"/> 
    <param name="recovery_behavior_enabled" value="true"/> 
    <param name="controller_frequency" value="1.0"/> 

    <rosparam file="/home/ubuntu/psybot_ws/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="/home/ubuntu/psybot_ws/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="/home/ubuntu/psybot_ws/local_costmap_params.yaml" command="load" />
    <rosparam file="/home/ubuntu/psybot_ws/global_costmap_params.yaml" command="load" />

    <!-- Load DWA Local Planner parameters -->
    <rosparam file="/home/ubuntu/psybot_ws/dwa_local_planner_params.yaml" command="load" />
  </node>

</launch>

  • 本地costmap参数yaml文件:

local_costmap:
   global_frame: map # 14/06 it was odom 
   robot_base_frame: base_link
   update_frequency: 5.0 # 10
   publish_frequency: 2 #10
   #transform_tolerance: 0.5
   width: 4.0
   height: 4.0
   resolution: 0.05
   static_map: false
   rolling_window: true
   
   plugins: 
      - {name: static_layer,            type: "costmap_2d::StaticLayer"}
      - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}
      - {name: obstacle_layer,          type: "costmap_2d::ObstacleLayer"}

   static_layer:
        enabled:              true
        map_topic:            "/map"


   inflation_layer:
        enabled:              true
        cost_scaling_factor:  5  
        inflation_radius:     0.3

   obstacle_layer:
        observation_sources: laser_scan_sensor
        footprint_clearing_enabled: true
        laser_scan_sensor: {data_type: LaserScan, sensor_frame: laser_frame, clearing: true, marking: true, topic: /LaserScan}
  • 全局costmap yaml文件
global_costmap:
   global_frame: map
   robot_base_frame: base_link
   update_frequency: 5.0
   publish_frequency: 5.0
   #transform_tolerance: 0.5 14/06 change 
   static_map: true

  • costmap常用参数yaml文件:
#map_type: costmap

obstacle_range: 2.5
raytrace_range: 3.0
#transform_tolerance: 0.2
footprint: [[0.1, 0.1], [0.1, -0.1], [-0.1, -0.1], [-0.1, 0.1]]
#robot_radius: 0.0
inflation_radius: 0.1
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}
  • 基础本地规划器yampl文件
base_local_planner: base_local_planner/TrajectoryPlannerROS #14/06 change
TrajectoryPlannerROS:

#Robot Configuration Parameters
   max_vel_x: 0.22
   min_vel_x: -0.22

   max_vel_y: 0.0
   min_vel_y: 0.0

#The velocity when robot is moving in a straight line
   max_vel_trans:  0.22
   min_vel_trans:  0.11

   max_vel_theta: 2.75
   min_vel_theta: 1.37

   acc_lim_x: 1 #2.0
   acc_lim_y: 0.0
   acc_lim_theta: 1  #3.2
   
   holonomic_robot: false # 14/06 change

#Goal Tolerance Parametes
   #xy_goal_tolerance: 0.02
   #yaw_goal_tolerance: 0.04
   #latch_xy_goal_tolerance: false

#Forward Simulation Parameters
   #sim_time: 1.5
   #vx_samples: 5 #2
   #vy_samples: 0
   #vth_samples: 40
   #controller_frequency: 10

#Trajectory Scoring Parameters
   #path_distance_bias: 32.0
   #goal_distance_bias: 20.0
   #occdist_scale: 0.02
   #forward_point_distance: 0.325
   #stop_time_buffer: 0.2
   #scaling_speed: 0.25
   #max_scaling_factor: 0.2

#Oscillation Prevention Parameters
   #oscillation_reset_dist: 0.05

#Debugging
   #publish_traj_pc : true
   #publish_cost_grid_pc: true
  • dwa 本地规划器参数 yaml 文件
DWAPlannerROS:
  max_vel_x: 0.22
  min_vel_x: -0.22
  max_vel_y: 0.0
  min_vel_y: 0.0
  max_vel_trans: 0.22
  min_vel_trans: 0.11
  max_vel_theta: 2.75
  min_vel_theta: 1.37
  acc_lim_x: 2.5
  acc_lim_y: 0.0
  acc_lim_theta: 3.2
  xy_goal_tolerance: 0.05
  yaw_goal_tolerance: 0.17
  latch_xy_goal_tolerance: false
  sim_time: 1.5
  vx_samples: 20
  vy_samples: 0
  vth_samples: 40
  controller_frequency: 10.0
  path_distance_bias: 32.0
  goal_distance_bias: 20.0
  occdist_scale: 0.02
  forward_point_distance: 0.325
  stop_time_buffer: 0.2
  scaling_speed: 0.25
  max_scaling_factor: 0.2
  oscillation_reset_dist: 0.05
  publish_traj_pc: true
  publish_cost_grid_pc: true

TF帧如下:

在此输入图片描述

RQT 结构如下: 在此输入图片描述

备注:

当我执行命令 roswtf 时,显示以下错误:

在此输入图片描述

但是,我无法理解发生了什么,因为变换框架没有显示多个 TF 连接。

对于冗长的描述,我深表歉意,但我无法识别使用激光雷达无法避开障碍物的问题。激光雷达正在正常发布数据,所以我认为问题与此无关。

我很乐意帮助我解决这个问题或进一步调查并解决它的方法。

提前谢谢您。

我尝试更改 YAML 文件中的参数,但使用 LIDAR 避障没有成功。

我希望移动机器人能够通过重新计算新路径来避开激光雷达检测到的障碍物。

navigation ros lidar robot
1个回答
0
投票

我是新来的,目前正在学习 ROS 1。我对 move_base 和避障之间的交互有类似的问题。具体来说,我不确定 move_base 是否可以有效地处理避障。

您能否对此事进行一些澄清?

谢谢你。

© www.soinside.com 2019 - 2024. All rights reserved.