当我们在 rviz 中将目标交给我的机器人时,它会尝试前往目标,但机器人最初直接向左移动。由于这种情况,它无法跟随地图上的路径,也无法到达所需的目标。机器人在终端屏幕上没有给出任何错误。为什么它没有正确遵循路径,无法到达所需的位置。
导航.launch
<?xml version="1.0"?>
<launch>
<!-- Arguments -->
<arg name="model" default="$(find project_ws)/urdf/wheel.urdf"/>
<arg name="map_file" default="$(find project_ws)/gazebo_map/map.yaml"/>
<arg name="open_rviz" default="true"/>
<arg name="move_forward_only" default="false"/>
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="x" default="1.0"/>
<arg name="y" default="-5.0"/>
<arg name="z" default="1.0"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/turtlebot3_house.world"/>
<arg name="debug" value="$(arg debug)" />
<arg name="gui" value="$(arg gui)" />
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<!--arg name="world_name" value="world/mud.world"/-->
<arg name="headless" value="$(arg headless)"/>
</include>
<param name="robot_description" command="$(find xacro)/xacro $(arg model)" />
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
args="-z 1.0 -unpause -urdf -model robot -param robot_description -x $(arg x) -y $(arg y) -z $(arg z)" respawn="false" output="screen" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
respawn="false" output="screen">
</node>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
</node>
<!-- Map server -->
<node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"/>
<!-- AMCL -->
<include file="$(find project_ws)/launch/amcl.launch"/>
<!-- move_base -->
<include file="$(find project_ws)/launch/move_base.launch">
<arg name="model" value="$(arg model)" />
<arg name="move_forward_only" value="$(arg move_forward_only)"/>
</include>
<!-- rviz -->
<group if="$(arg open_rviz)">
<node pkg="rviz" type="rviz" name="rviz" required="true"
args="-d $(find project_ws)/rviz/navigation.rviz"/>
</group>
</launch>
问题可能是由costmap common params.yaml
文件中的足迹引起的吗?如何使足迹中的值适应我的机器人?costmap_common_params.yaml
obstacle_range: 3.0
raytrace_range: 3.5
footprint: [[-0.105, -0.105], [-0.105, 0.105], [0.041, 0.105], [0.041, -0.105]]
#robot_radius: 0.105
inflation_radius: 1.0
cost_scaling_factor: 3.0
map_type: costmap
observation_sources: vehiclediffdrive/laser/scan
vehiclediffdrive/laser/scan: {sensor_frame: laser_scan, data_type: LaserScan, topic: vehiclediffdrive/laser/scan, marking: true, clearing: true}