当我尝试启动我的 navigation.launch 时,机器人在 rviz 中以所需的方向进入,但是当我使用 2d 姿势估计时,它会根据它应该是什么将机器人向左旋转 90 度。后来,当我给一个带有 2d nav 目标的目标点时,它无法跟随路径并通过向左滑动移动到其他方向。我使用 roswtf 查找错误并得到以下节点连接错误。我不知道问题出在哪里。如何修复脚印?
roswtf 输出
导航.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>
move_base.launch
<?xml version="1.0"?>
<launch>
<!-- Arguments -->
<arg name="model" default="$(find project_ws)/urdf/wheel.urdf"/>
<arg name="cmd_vel_topic" default="/vehiclediffdrive/cmd_vel" />
<arg name="odom_topic" default="/vehiclediffdrive/odom" />
<arg name="move_forward_only" default="false"/>
<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
<rosparam file="$(find project_ws)/param/costmap_common_params_burger.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find project_ws)/param/costmap_common_params_burger.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find project_ws)/param/local_costmap_params.yaml" command="load" />
<rosparam file="$(find project_ws)/param/global_costmap_params.yaml" command="load" />
<rosparam file="$(find project_ws)/param/move_base_params.yaml" command="load" />
<rosparam file="$(find project_ws)/param/dwa_local_planner_params_burger.yaml" command="load" />
<remap from="cmd_vel" to="$(arg cmd_vel_topic)"/>
<remap from="odom" to="$(arg odom_topic)"/>
<param name="DWAPlannerROS/min_vel_x" value="0.0" if="$(arg move_forward_only)" />
</node>
</launch>
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}
local_costmap_params.yaml
local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 10.0
publish_frequency: 10.0
transform_tolerance: 0.5
static_map: false
rolling_window: true
width: 3
height: 3
resolution: 0.05
global_costmap_params.yaml
global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 10.0
publish_frequency: 10.0
transform_tolerance: 0.5
static_map: true
move_base_params.yaml
shutdown_costmaps: false
controller_frequency: 10.0
planner_patience: 5.0
controller_patience: 15.0
conservative_reset_dist: 3.0
planner_frequency: 5.0
oscillation_timeout: 10.0
oscillation_distance: 0.2
base_local_planner_params.yaml
TrajectoryPlannerROS:
# Robot Configuration Parameters
max_vel_x: 0.10
min_vel_x: 0.08
max_vel_theta: 1.0
min_vel_theta: -1.0
min_in_place_vel_theta: 1.0
acc_lim_x: 1.0
acc_lim_y: 0.0
acc_lim_theta: 0.6
# Goal Tolerance Parameters
xy_goal_tolerance: 0.10
yaw_goal_tolerance: 0.05
# Differential-drive robot configuration
holonomic_robot: true
# Forward Simulation Parameters
sim_time: 0.8
vx_samples: 18
vtheta_samples: 20
sim_granularity: 0.05
dwa_local_planner_params.yaml
DWAPlannerROS:
# Robot Configuration Parameters
max_vel_x: 0.1
min_vel_x: -0.1
max_vel_y: 0.1
min_vel_y: -0.1
# 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: 2.5
acc_lim_y: 2.5
acc_lim_theta: 3.2
# Goal Tolerance Parametes
xy_goal_tolerance: 0.05
yaw_goal_tolerance: 0.17
latch_xy_goal_tolerance: false
# Forward Simulation Parameters
sim_time: 2.0
vx_samples: 20
vy_samples: 0
vth_samples: 40
controller_frequency: 10.0
# Trajectory Scoring Parameters
path_distance_bias: 16.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