Robotics StackExchange | Archived questions

how can i use costmap_2d with sonar sensor

i am working on an obstacle avoiding robot which should build a map i am practically using a sonar sensor to avoid the obstacles can someone help me on how to build a map based on a sonar sensor data instead of a laser sensor.

the .yaml file i am using is as follow it uses a laser sensor how can i convert it to sonar sensor

`#Sample parameters footprint: [[0.1, 0.0], [0.0, 0.1], [0.0, -0.1], [-0.1, 0.0]] #robot_radius: 0.10

        transform_tolerance: 0.3
        update_frequency: 5.0
        publish_frequency: 2.0

        global_frame: robot_0/odom
        robot_base_frame: robot_0/base_link
        resolution: 0.02
        width: 20.0
        height: 20.0

        rolling_window: true
        track_unknown_space: true

        plugins: 

            - {name: explore_boundary, type: "frontier_exploration::BoundedExploreLayer"}
            - {name: sensor,           type: "costmap_2d::ObstacleLayer"}
            - {name: inflation,        type: "costmap_2d::InflationLayer"}

        explore_boundary:
            resize_to_boundary: true
            frontier_travel_point: closest

        sensor:
            observation_sources: laser
            laser: {data_type: LaserScan, clearing: true, marking: true, topic: /robot_0/base_scan, inf_is_valid: true, raytrace_range: 1.5, obstacle_range: 0.9}

        inflation:
            inflation_radius: 0.15`

plz help me thank you.

Asked by naqi.nick on 2016-06-05 14:25:57 UTC

Comments

Answers

Me to i have the same problem i should do mapping and localization using ultrasonic sensor and IMU. I found this but i am not sure if it's the solution of the problem : Other sensor and ros gmapping (SLAM)

Asked by أسامة الادريسي on 2017-06-28 04:50:01 UTC

Comments