My fake laser layer doesn't appear in the costmap of the robot

asked 2021-07-20 07:02:29 -0600

mariadelmar2497 gravatar image

Hello everyone,

I'm trying to insert a fake laser sensor data in the robot costmap to make obstacle avoidance, but it doesn't seem to be working fine. For doing that, I publish LaserScan type messages in "my_laser" topic, as I can see in Rviz. It seems to work well, the robot can read this fake sensor data, but it doesn't include it in the costmap. In other hand, when I launch the robot/move_base.launch, I can see that robot is trying to include this information in the costmap because it uses my custom plugin "tag_obstacle_layer" subscribed to "tags", as you can see.

process[robot/move_base-1]: started with pid [16779]
[ INFO] [1626777328.033176618]: Using plugin "static_map"
[ INFO] [1626777328.249583878]: Requesting the map...
[ INFO] [1626777328.455648682]: Resizing costmap to 1984 X 1984 at 0.050000 m/pix
[ INFO] [1626777328.553113912]: Received a 1984 X 1984 map at 0.050000 m/pix
[ INFO] [1626777328.556509213]: Using plugin "inflation_layer"
[ INFO] [1626777328.655227862]: Using plugin "obstacle_layer"
[ INFO] [1626777328.658058522]: Subscribed to Topics: front_laser
[ INFO] [1626777328.688737450]: Using plugin "rgbd_obstacle_layer"
[ INFO] [1626777328.691157660]:     Subscribed to Topics: front_rgbd_to_scan
[ INFO] [1626777328.725274551]: Using plugin "inflation_layer"
[ INFO] [1626777328.741370606]: Using plugin "tag_obstacle_layer"
[ INFO] [1626777328.744553187]:     Subscribed to Topics: tags
[ INFO] [1626777329.040558416]: Created local_planner teb_local_planner/TebLocalPlannerROS
[ INFO] [1626777329.117712196]: Footprint model 'circular' (radius: 0.3m) loaded for trajectory optimization.
[ INFO] [1626777329.121654781]: Parallel planning in distinctive topologies disabled.
[ INFO] [1626777329.455280733]: Costmap conversion plugin costmap_converter::CostmapToPolygonsDBSMCCH loaded.
[ INFO] [1626777329.868401507]: Recovery behavior will clear layer obstacles
[ INFO] [1626777329.881106754]: Recovery behavior will clear layer obstacles
[ INFO] [1626777329.940618724]: odom received!

I have modified two files: "costmap_common_params.yaml" and "local_costmap_params.yaml" as it follows.

  1. "costmap_common_params.yaml":

    publish_frequency: 1.0 
    robot_radius: 0.3
    
    inflation_layer:
      inflation_radius: 0.3
    
    obstacle_layer:
      obstacle_range: 2.5
      raytrace_range: 5.5
      observation_sources: front_laser
      front_laser:
        sensor_frame: robot_front_laser_link
        data_type: LaserScan
        topic: front_laser/scan
        marking: true
        clearing: true
        observation_persistence: 0.0
    
    rgbd_obstacle_layer:
      obstacle_range: 2.5
      raytrace_range: 5.5
      observation_sources: front_rgbd_to_scan
      front_rgbd_to_scan:
        data_type: LaserScan
        topic: front_rgbd_camera/point_cloud_scan_filtered
        marking: true
        clearing: true
        observation_persistence: 5.0
    
    tag_obstacle_layer:
      obstacle_range: 2.5
      raytrace_range: 5.5
      observation_sources: tags
      tags:
        sensor_frame: robot_front_laser_link
        data_type: LaserScan
        topic: my_laser
        marking: true
        clearing: true
        observation_persistence: 100.0
    
  2. "local_costmap_params.yaml":

    local_costmap:
      global_frame: robot_odom
      robot_base_frame: robot_base_footprint
      update_frequency: 2.0
      static_map: false
      rolling_window: true
      width: 5.0
      height: 5.0
      resolution: 0.05
      footprint_padding: 0.0
    
    inflation_layer:
      inflation_radius: 0.3
    
    plugins:
     -
       name: obstacle_layer
       type: "costmap_2d::ObstacleLayer"
     -
       name: rgbd_obstacle_layer
       type: "costmap_2d::ObstacleLayer"
     -
       name: inflation_layer
       type: "costmap_2d::InflationLayer"
     - 
       name: tag_obstacle_layer
       type: "costmap_2d::ObstacleLayer"
    

Doing that, It doesn't have any errors, but in Rviz shows the costmap avoiding only real laser sensor data, and not my fake laser sensor data. (I would like to insert an image, but I don't have enough points yet).

I have tried to publish a point goal that goes through my fake obstacle data (trying to see if the error is in Rviz Simulation) but robot doesn't avoid it. So I don't know what I can do to solve this problem. I need my fake ... (more)

edit retag flag offensive close merge delete