OctoMap / octomap_mapping

ROS stack for mapping with OctoMap, contains octomap_server package
http://www.ros.org/wiki/octomap_mapping
335 stars 280 forks source link

Can not filter ground in foxy #104

Open ShuiYunXi opened 2 years ago

ShuiYunXi commented 2 years ago

Hello,Could you tell me why not filtet the ground when I use launch the octomap_server. environment:Ubuntu20.04 ROS's Version:foxy launch file:

<!--
  Example launch file for octomap_server mapping:
  Listens to incoming PointCloud2 data and incrementally builds an octomap.
  The data is sent out in different representations.

  Copy this file into your workspace and adjust as needed, see
  www.ros.org/wiki/octomap_server for details
-->
<launch>
    <node pkg="octomap_server" exec="octomap_server_node" name="octomap_server">
        <param name="resolution" value="0.1" />

        <!-- fixed map frame (set to 'map' if SLAM or localization running!) -->
        <!-- <param name="frame_id" value="laser" /> -->
        <!-- <param name="frame_id" value="laser" /> -->
        <param name="frame_id" value="map" />
        <param name="base_frame_id" value="base_footprint" />

        <!-- maximum range to integrate (speedup!) -->
        <param name="sensor_model.max_range" value="5.0" />
        <param name="filter_ground" value="true" />
        <param name = "ground_filter/plane_distance"  value = "1" />
        <param name = "ground_filter/angle"  value = "1" />

        <param name = "filter_speckles"  value = "true" />

        <param name = "outrem_radius" value = "1.0" />
        <param name = "outrem_neighbors"  value = "10" />

        <!-- data source to integrate (PointCloud2) -->
        <remap from="cloud_in" to="/PointCloud2" />
        <!-- <remap from="projection_map" to="/map" /> -->

    </node>
    <!-- <node pkg="joint_state_publisher" exec="joint_state_publisher" name="joint_state_publisher" />
    <node pkg="robot_state_publisher" exec="robot_state_publisher" name="robot_state_publisher" />
    <node pkg="tf2_ros" exec="static_transform_publisher" name="static_transform_publisher" args="0 0 0 0 0 0 /base_footprint /laser" /> -->

</launch>
kJh19 commented 2 years ago

The actual parameter name for ros2 is "filter_ground_plane". Went trough octomap_server.cpp and looked at the "declare_parameter" functions. At least for the ros2 branch this one and some others do not match the names on the ros wiki (which I suppose is for ros1, so just no documentation for the changes yet) There are some extra parameters there as well, so check it out!