rtabmap_ros maps basically nothing on rviz

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

rtabmap_ros maps basically nothing on rviz

I posted it in zed mini support: https://github.com/stereolabs/zed-ros-examples/issues/46 and they told me to come here to post.

Basically, I am using a zed mini and using their ROS package. I use ubuntu 20.04, ros noetic, ros1, with a gtx 1080 gpu. I follow the installation instruction: https://www.stereolabs.com/docs/ros/
And I used rtabmap ros. In the beginning, both rtabmapviz and rviz wasn't that good as seen here.

RVIZ with  _/zed/zed_node/point_cloud/cloud_registered_ topic:
![Screenshot from 2023-01-20 00-26-16](https://user-images.githubusercontent.com/46792357/213650161-0ede2c4c-b22c-4ac6-964c-871718255ae9.png)

RVIZ without  _/zed/zed_node/point_cloud/cloud_registered_ topic:
![Screenshot from 2023-01-20 00-26-38](https://user-images.githubusercontent.com/46792357/213650165-43d7f96c-9b73-4e29-8afb-50cdaf0705bb.png)

So I **changed** the param _subscribe_scan_cloud_ to true and add <remap from="scan_cloud"        to="/zed/zed_node/point_cloud/cloud_registered"/> to rtabmap_ros and rtabmapviz. That really helped rtabmapviz, but rviz still just doesn't have the good quality of mapping like I see in other youtube. The command I ran was _roslaunch zed_rtabmap_example zed_rtabmap.launch_


<?xml version="1.0"?>

    <arg name="svo_file"             default="" /> 
    <arg name="stream"               default="" /> 

    <arg name="zed_node_name"        default="zed_node" />
    <arg name="camera_model"         default="zedm" />
    <arg name="publish_urdf"         default="true" />

    <arg name="camera_name"          default="zed" />

    <arg name="base_frame"           default="base_link" />

    <group ns="$(arg camera_name)">
        <include file="$(find zed_wrapper)/launch/include/zed_camera.launch.xml">
            <arg name="camera_name"         value="$(arg camera_name)" />
            <arg name="svo_file"            value="$(arg svo_file)" />
            <arg name="stream"              value="$(arg stream)" />
            <arg name="node_name"           value="$(arg zed_node_name)" />
            <arg name="camera_model"        value="$(arg camera_model)" />
            <arg name="base_frame"          value="$(arg base_frame)" />
            <arg name="publish_urdf"        value="$(arg publish_urdf)" />
        <arg name="custom_rtabmap_launch_file" default="$(find zed_rtabmap_example)/launch/include/sl_rtabmap.launch.xml"/>
        <include file="$(arg custom_rtabmap_launch_file)">
            <arg name="odom_topic"              default="$(arg zed_node_name)/odom" />
            <arg name="rgb_topic"               default="$(arg zed_node_name)/rgb/image_rect_color" />
            <arg name="depth_topic"             default="$(arg zed_node_name)/depth/depth_registered" />
            <arg name="camera_info_topic"       default="$(arg zed_node_name)/rgb/camera_info" />
            <arg name="depth_camera_info_topic" default="$(arg zed_node_name)/depth/camera_info" />

        <node name="rviz" pkg="rviz" type="rviz" args="-d $(find zed_rtabmap_example)/rviz/zed-rtabmap.rviz" output="screen" /> 


    <arg name="localization"            default="false"/>

    <arg     if="$(arg localization)" name="args" default=""/>
    <arg unless="$(arg localization)" name="args" default="--delete_db_on_start"/>

    <arg name="rgb_topic"               default="/zed/zed_node/rgb/image_rect_color" />
    <arg name="depth_topic"             default="/zed/zed_node/depth/depth_registered" />
    <arg name="camera_info_topic"       default="/zed/zed_node/rgb/camera_info" />
    <arg name="depth_camera_info_topic" default="/zed/zed_node/depth/camera_info" />

    <arg name="odom_topic"              default="/zed/zed_node/odom" />   


    <node name="rtabmapviz" pkg="rtabmap_ros" type="rtabmapviz" output="screen" args="" launch-prefix="">   
        <remap from="rgb/image"         to="$(arg rgb_topic)"/>
        <remap from="depth/image"       to="$(arg depth_topic)"/>
        <remap from="rgb/camera_info"   to="$(arg camera_info_topic)"/>

        <remap from="grid_map"          to="map" />
        <remap from="odom"              to="$(arg odom_topic)"/>
        <remap from="scan_cloud"        to="/zed/zed_node/point_cloud/cloud_registered"/>       

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg args)" launch-prefix="">
        <rosparam command="load" file="$(find zed_rtabmap_example)/params/rtabmap.yaml" />
        <remap from="rgb/image"         to="$(arg rgb_topic)"/>
        <remap from="depth/image"       to="$(arg depth_topic)"/>
        <remap from="rgb/camera_info"   to="$(arg camera_info_topic)"/>

        <remap from="grid_map"          to="map" />
        <remap from="odom"              to="$(arg odom_topic)"/>       
        <remap from="scan_cloud"        to="/zed/zed_node/point_cloud/cloud_registered"/>               



subscribe_depth:        true
subscribe_rgbd:         false
subscribe_stereo:       false
subscribe_stereo:       false
subscribe_scan:         false
subscribe_scan_cloud:   true
subscribe_user_data:    false
subscribe_odom_info:    false

database_path:      "~/.ros/rtabmap.db"
config_path:        "~/.ros/rtabmap.cfg"

frame_id:       "base_link"
map_frame_id:   "map"
odom_frame_id:  "odom"                   # odometry from odom msg to have covariance - Remapped by launch file
odom_tf_angular_variance:  0.001     # If TF is used to get odometry, this is the default angular variance
odom_tf_linear_variance:   0.001     # If TF is used to get odometry, this is the default linear variance
tf_delay:       0.02
publish_tf:     false                # Set to false if fusing different poses (map->odom) with UKF

odom_sensor_sync:               true
wait_for_transform_duration:    0.2
approx_sync:                    true

queue_size: 100

scan_normal_k:  0

    3D:                     true
    FlatObstacleDetected:   true
    MapFrameProjection:     false
    GroundIsObstacle:       false
    PreVoxelFiltering:      true
    RayTracing:             true
    FromDepth:              true
    NormalsSegmentation:    false
    CellSize:               0.05
    ClusterRadius:          0.1
    MinClusterSize:         3
    DepthDecimation:        1
    DepthRoiRatios:         [0.0, 0.0, 0.0, 0.0]
    FootprintHeight:        2.0
    FootprintLength:        0.18
    FootprintWidth:         0.18
    MaxGroundAngle:         30.0
    MinGroundHeight:        -0.5
    MaxGroundHeight:        -0.4
    MaxObstacleHeight:      0.1
    NoiseFilteringMinNeighbors: 5
    NoiseFilteringRadius:   0.1
    NormalK:                20
    RangeMin:               0.7
    RangeMax:               3.0

    Eroded:                 false       # Erode obstacle cells
    FootprintRadius:        0.18        # Footprint radius (m) used to clear all obstacles under the graph
    FullUpdate:             true        # When the graph is changed, the whole map will be reconstructed instead of moving individually each cells of the map. Also, data added to cache won't be released after updating the map. This process is longer but more robust to drift that would erase some parts of the map when it should not
    MaxNodes:               0           # Maximum nodes assembled in the map starting from the last node (0=unlimited)
    MinSize:                1.0        # Minimum map size (m)
    OccupancyThr:           0.55        # Occupancy threshold (value between 0 and 1)
    ProbClampingMax:        0.971       # Probability clamping maximum (value between 0 and 1)
    ProbClampingMin:        0.1192      # Probability clamping minimum (value between 0 and 1)
    ProbHit:                0.7         # Probability of a hit (value between 0.5 and 1)
    ProbMiss:               0.4         # Probability of a miss (value between 0 and 0.5)
    UpdateError:            0.01        # Graph changed detection error (m). Update map only if poses in new optimized graph have moved more than this value

Here's a picture of what it looks like:

RVIZ with  _/zed/zed_node/point_cloud/cloud_registered_ topic:
![Screenshot from 2023-01-20 00-33-14](https://user-images.githubusercontent.com/46792357/213651440-0693cd8e-e0a3-4086-bfe4-ccd3d45e0ca4.png)

RVIZ with  _/zed/zed_node/point_cloud/cloud_registered_ topic:
![Screenshot from 2023-01-20 00-34-05](https://user-images.githubusercontent.com/46792357/213651443-28895626-d955-43d9-8c7d-f0e38118601a.png)

As you can see, in rtabmapviz, the quality improved drastically, but rviz mapping mapping points barely had anything. I don't really understand why. Any thought and help is appreciated. Let me know if you have any questions. Thank you!
Reply | Threaded
Open this post in threaded view

Re: rtabmap_ros maps basically nothing on rviz