ROS-在RVIz上应用2d姿态估计时,局部成本图和足迹在地图附近波动

时间:2019-12-24 13:31:58

标签: ubuntu localization navigation ros robot

因此,我是ROS的新手,过去一周我面临着重大的头痛。具体来说,我遇到的问题实际上是here。每当我设置“机器人”的2D姿态估算值时,足迹和成本图都会在地图周围波动。我正在使用带有静态贴图的amcl节点,因此每当进行姿势估计时,粒子云都会正确更改。由于这个问题,它无法估计到目标节点的准确路径,并且该路径也会发生波动。我的启动文件代码如下。请让我摆脱这个问题。谢谢!


轨迹规划器

TrajectoryPlannerROS:
  max_vel_x: 0.4
  min_vel_x: 0.2
  max_rotational_vel: 0.5
  max_vel_theta: 1.5
  min_vel_theta: -1.5
  min_in_place_rotational_vel: 0.25
  min_in_place_vel_theta: 0.7
  escape_vel: -0.25
  acc_lim_theta: 0.3
  acc_lim_x: 0.5
  acc_lim_Y: 0.07
  holonomic_robot: false
  meter_scoring: true
  xy_goal_tolerance: 0.15
  yaw_goal_tolerance: 0.3
  latch_xy_goal_tolerance: true

本地成本图参数

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 5.0
  publish_frequency: 10.0
  static_map: true
  rolling_window: false
  width: 2
  height: 2
  resolution: 0.025

全局成本图参数

global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 2.0
  static_map: true
  publish_frequency: 1.0
  width: 15
  height: 15
  resolution: 0.1

Costmap常见参数

obstacle_range: 5.0
raytrace_range: 6.0

max_obstacle_height: 0.2
min_obstacle_height: 0.05

robot_radius: 0.20
inflation_radius: 0.15

transform_tolerance: 1.0
map_type: costmap
cost_scaling_factor: 100

map_topic: /map
subscribe_to_updates: true

observation_sources: laser_scan_sensor

我的机器人配置文件

<launch>

<rosparam param="ticks_meter">17825</rosparam>
<node pkg="differential_drive" type="diff_tf.py" name="odometry" output="screen">
        <remap from="lwheel" to="left_encoder" />
        <remap from="rwheel" to="right_encoder" />
        <rosparam param="base_width">0.195</rosparam>
        <rosparam param="odom_frame_id" subst_value="True" > "/odom" </rosparam>
        <rosparam param="base_frame_id" subst_value="True"> "/base_link" </rosparam>
        <rosparam param="global_frame_id" subst_value="True"> "/map" </rosparam>
        <rosparam param="rate">50</rosparam>
</node>
<node pkg="differential_drive" type="pid_velocity.py" name="lpid">
        <remap from="wheel" to= "left_encoder"/>
        <remap from="motor_cmd" to= "left_pwm"/>
        <remap from="wheel_vtarget" to= "left_target"/>
        <remap from="wheel_vel" to= "left_actual"/>
        <rosparam param="Kp">480</rosparam >
        <rosparam param="Ki">250</rosparam >
        <rosparam param="Kd">18</rosparam >
        <rosparam param="out_min">-255</rosparam >
        <rosparam param="out_max">255</rosparam >
        <rosparam param="rate">40</rosparam >
        <rosparam param="timeout_ticks">4</rosparam>
        <rosparam param="rolling_pts">5</rosparam>
</node>
<node pkg="differential_drive" type="pid_velocity.py" name="rpid">
        <remap from="wheel" to="right_encoder"/>
        <remap from="motor_cmd" to="right_pwm"/>
        <remap from="wheel_vtarget" to="right_target"/>
        <remap from="wheel_vel" to="right_actual"/>
        <rosparam param="Kp">480</rosparam>
        <rosparam param="Ki">250</rosparam>
        <rosparam param="Kd">18</rosparam>
        <rosparam param="out_min">-255</rosparam>
        <rosparam param="out_max">255</rosparam>
        <rosparam param="rate">40</rosparam>
        <rosparam param="timeout_ticks">4</rosparam>
        <rosparam param="rolling_pts">5</rosparam>
</node>
<node pkg="differential_drive" type="twist_to_motors.py" name="twist" output="screen">
        <remap from="twist" to="cmd_vel"/>
        <remap from="lwheel_vtarget" to="left_target"/>
        <remap from="rwheel_vtarget" to="right_target"/>
        <rosparam param="base_weight">0.195</rosparam>
</node>
<node pkg="rosserial_python" type="serial_node.py" name="serial_node">
        <param name="port" value="/dev/ttyACM0"/>
        <param name="baud" value="57600"/>
</node>

#<node pkg="tf" type="static_transform_publisher" name="map_transform" args="0 0 0.14 0 0 0 /map /od$
<node pkg="tf" type="static_transform_publisher" name="laser_transform" args="0 0 0.14 0 0 0 base_li$
</launch>

laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan , marking: true, clearing$

移动基地启动

<launch>

   <master auto="start"/>
<arg name="map_file" default=" /home/ubuntu/catkin_ws/src/provide_map/maps/swiftmap.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)">
    <param name="frame_id" type="str" value="map"/>
</node>
<include file="$(find amcl)/examples/amcl_diff.launch"/>
   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap"/>
    <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap"/>
    <rosparam file="$(find my_robot_name_2dnav)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find my_robot_name_2dnav)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find my_robot_name_2dnav)/base_local_planner_params.yaml" command="load" />
    <param name="base_global_planner" type="string" value="navfn/NavfnROS" />
    <param name="controller_frequency" type="double" value="6.0"/>
    <param name="planner_frequency" type="double" value="0.5"/>
 </node>

AMCL启动文件

<launch>
<node pkg="amcl" type="amcl" name="amcl" output="screen">
  <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="odom_model_type" value="diff"/>
  <param name="odom_alpha5" value="0.1"/>
  <param name="transform_tolerance" value="0.2" />
  <param name="gui_publish_rate" value="10.0"/>
  <param name="laser_max_beams" value="30"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <param name="kld_err" value="0.05"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.2"/>
  <param name="odom_alpha2" value="0.2"/>
  <!-- translation std dev, m -->
  <param name="odom_alpha3" value="0.8"/>
  <param name="odom_alpha4" value="0.2"/>
  <param name="laser_z_hit" value="0.5"/>
  <param name="laser_z_short" value="0.05"/>
  <param name="laser_z_max" value="0.05"/>
  <param name="laser_z_rand" value="0.5"/>
  <param name="laser_sigma_hit" value="0.2"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_model_type" value="likelihood_field"/>
  <!-- <param name="laser_model_type" value="beam"/> -->
  <param name="laser_likelihood_max_dist" value="2.0"/>
  <param name="update_min_d" value="0.2"/>
  <param name="update_min_a" value="0.5"/>
  <param name="odom_frame_id" value="/odom"/>
  <param name="base_frame_id" value="base_link"/>
  <param name="global_frame_id" value="/map"/>
  <param name="use_map_topic" value="true"/>
  <param name="resample_interval" value="1"/>
  <param name="transform_tolerance" value="0.1"/>
  <param name="recovery_alpha_slow" value="0.0"/>
  <param name="recovery_alpha_fast" value="0.0"/>
</node>
</launch>

0 个答案:

没有答案