ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thank you so much! With your help the new situation is:

http://www.youtube.com/watch?v=wcHE1yCuq8w

Now everything works, but still it seems there is a problem with amcl, since it constantly changes (incorrectly) the transformation between /map and /odom.

The green lines are the inflated obstacles, so they are correct, I do not display obstacles because they are too heavy for rviz, but they works.

I tried to change amcl.launch in order to reduce the corrections, but the problem remains...

Here are the configuration files

costmap_common_params.yaml

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: base_laser, data_type: LaserScan, topic: scan, marking: false, clearing: false}

#Set the tolerance we're willing to have for tf transforms
transform_tolerance: 0.8

#Obstacle marking parameters
obstacle_range: 2.5
max_obstacle_height: 2.0
raytrace_range: 3.0

#The footprint of the robot and associated padding
footprint: [[0.290,0.190], [0.290,-0.190], [-0.290,-0.190], [-0.290,0.190]]
footprint_padding: 0.05

#Cost function parameters
inflation_radius: 0.1
cost_scaling_factor: 10.0

#The cost at which a cell is considered an obstacle when a map is read from the map_server
lethal_cost_threshold: 100

local_costmap:
  #Set the global and robot frames for the costmap
  global_frame: map
  robot_base_frame: base_link

  #Set the update and publish frequency of the costmap
  update_frequency: 5.0
  publish_frequency: 2.0

  static_map: true
  rolling_window: false


global_costmap:
  #Set the global and robot frames for the costmap
  global_frame: /map
  robot_base_frame: base_link

  #Set the update and publish frequency of the costmap
  update_frequency: 5.0
  publish_frequency: 0.0

  #We'll use a map served by the map_server to initialize this costmap
  static_map: true
  rolling_window: false

TrajectoryPlannerROS:
  #Set the acceleration limits of the robot
  acc_lim_th: 4.0
  acc_lim_x: 3.7
  acc_lim_y: 3.5

  #Set the velocity limits of the robot
  max_vel_x: 0.2
  min_vel_x: 0.05
  max_rotational_vel: 0.3
  min_in_place_rotational_vel: 0.05

  #The velocity the robot will command when trying to escape from a stuck situation
  escape_vel: -0.1

  #For this example, we'll use a holonomic robot
  holonomic_robot: true

  #Since we're using a holonomic robot, we'll set the set of y velocities it will sample
  y_vels: [-0.3, -0.1, 0.1, 0.3]

  #Set the tolerance on achieving a goal
  xy_goal_tolerance: 0.1
  yaw_goal_tolerance: 0.05

  #We'll configure how long and with what granularity we'll forward simulate trajectories
  sim_time: 1.7
  sim_granularity: 0.025
  vx_samples: 3
  vtheta_samples: 20
      #Parameters for scoring trajectories 
      goal_distance_bias: 1.5
      path_distance_bias: 0.6
      occdist_scale: 0.01
      heading_lookahead: 0.325

      #We'll use the Dynamic Window Approach to control instead of Trajectory Rollout for this example
      dwa: true

      #How far the robot must travel before oscillation flags are reset
      oscillation_reset_dist: 0.05

      #Eat up the plan as the robot moves along it
      prune_plan: true

and this is the amcl launch file:

<launch>
<node pkg="amcl" type="amcl" name="amcl">
  <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="odom_model_type" value="omni"/>
  <param name="odom_alpha5" value="0.001"/>
  <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.001"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.001"/>
  <param name="odom_alpha2" value="0.001"/>
  <!-- translation std dev, m -->
  <param name="odom_alpha3" value="0.001"/>
  <param name="odom_alpha4" value="0.001"/>
  <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_footprint"/>
  <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"/>
  <param name="initial_cov_xx" value="0.05*0.05"/>
  <param name="initial_cov_yy" value="0.05*0.05"/>
  <param name="initial_cov_aa" value="0.26*0.26"/>
</node>
</launch>

Any suggestions? Thank you so much for the help