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

can't use laserscan and range sensor simultaneously [closed]

asked 2021-11-22 05:55:39 -0500

dinesh gravatar image

updated 2021-11-23 05:39:26 -0500

Here is the common costmap parameter for my robot:

obstacle_range: 3.0
raytrace_range: 3.5

footprint: [[-0.25,-0.25],[-0.25,0.25],[0.37,0.25],[0.37,-0.25]]
# robot_radius: 0.25

inflation_radius: 1.0
cost_scaling_factor: 20.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: camera_depth_virtual_frame, data_type: LaserScan, topic: depth/scan_filtered, marking: true, clearing: true}

plugins:  
- {name: ultrasonic, ns: "ultrasonic", topics: ["ir_back", "ir_front"], type: "range_sensor_layer::RangeSensorLayer"}

Here when i remove the plugins the move base is subscribing to the laserscan topic but when i add the plugin at same time their is issue in move base that it is not subscribing to the ir_back and front topic.

common costmap fro both local_costmap: and global_costsmap:

obstacle_range: 3.0
raytrace_range: 3.5

footprint: [[-0.25,-0.25],[-0.25,0.25],[0.37,0.25],[0.37,-0.25]]
# robot_radius: 0.25
footprint_padding: 0.05

inflation_radius: 1.0
cost_scaling_factor: 100.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: camera_depth_virtual_frame, data_type: LaserScan, topic: depth/scan_filtered, marking: true, clearing: true}

local clostmap

local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint

  update_frequency: 10.0
  publish_frequency: 10.0
  transform_tolerance: 0.5  

  static_map: false  
  rolling_window: true
  width: 5
  height: 5
  resolution: 0.05

  plugins:  
    - {name: ultrasonic_layer, type: "range_sensor_layer::RangeSensorLayer"} 
    - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

  ultrasonic_layer:
    topics: ["/ultrasonic/ir_back", "/ultrasonic/ir_front"]
    no_readings_timeout: 1.0
    clear_on_max_reading: true

global_costmap:

global_costmap:
  global_frame: map
  robot_base_frame: base_footprint

  update_frequency: 10.0
  publish_frequency: 10.0
  transform_tolerance: 0.5

  static_map: true

As i tried this instruction, i found that with laserscan directly from the 2d lidar it is working somewhat. I am currently trying to use the laserscan from point cloud to laserscan filter.

image description

As shown in the above screenshot, the costmap created from the range sensor is very much visible while the costmap created from the laserscan are not properly visible/intense. And problem i.e is comming here is theat global path is passing through the local costmap as a result robot is colliding with obstacles.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Mike Scheutzow
close date 2021-11-25 09:22:12.088450

Comments

This seems to have been answered in your followup question #q391511

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-11-25 09:22:53 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-11-22 06:59:03 -0500

Dragonslayer gravatar image

Hi, have a look here (as a guidline). If you still got problems please post all config files and rosparam dump. yaml is indent sensitive, I assume your code above isnt what it is in the files.

edit flag offensive delete link more

Comments

I've updated the question with costmap parameters.

dinesh gravatar image dinesh  ( 2021-11-23 01:13:02 -0500 )edit

Latest update is that only range sensors costmap is comming with intensity but the scan based costmap is not looking very intense due to whicch thge global path is pasing through the costmaps of the scan itself.

dinesh gravatar image dinesh  ( 2021-11-23 02:59:50 -0500 )edit

The config files look much better now. What do you mean by "intensity". I also dont understand your second sentence, the global path should have nothing to do with the marking/rendering of obstacles in the local costmap. You use a 360° 2d-lidar as scan sensor? A picture would be helpful.

Dragonslayer gravatar image Dragonslayer  ( 2021-11-23 05:29:57 -0500 )edit

I have updated the question with the screenshot.

dinesh gravatar image dinesh  ( 2021-11-23 05:39:35 -0500 )edit

Thanks for the update. Sadly I am not sure what is what in the picture. Is the global map shown here? Is the grey cone the ultrasonic sensor's range? What sensor marks what obstacles. A picture straight down zoomed out with only the local costmap (no global map) would be appreciated, also include the whole rviz window. If you are alreday at it maybe also a picture of the map (in rviz). Even a video might be good, I dont get whats going on.

Iam not sure if your config files are complete but they dont correspond to the linked (implementing proximity...) ones. I dont see a obstacle_layer defined as the ultrasonic_layer is (in your local_costmap) define the layers in common_costmap like in the example you linked. I also dont see an inflation_layer (should also go in common_costmap check your link) But be aware that you need to launch ...(more)

Dragonslayer gravatar image Dragonslayer  ( 2021-11-23 06:52:30 -0500 )edit

Since the problem seems to be only with scan from depth sensor which was converted than used. i'll be opening new question.

dinesh gravatar image dinesh  ( 2021-11-23 08:34:51 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-11-22 05:55:39 -0500

Seen: 111 times

Last updated: Nov 23 '21