introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.62k stars 763 forks source link

No 3D map in rviz #841

Open UdayRockzz opened 2 years ago

UdayRockzz commented 2 years ago

I am working on a pepper robot with rtabmap. the robot as a Xtion 3D camera. 2 RGB cameras and 3 lasers. here is the launch file and it is working fine. but there is no 3D map on rviz.

<?xml version="1.0" encoding="UTF-8"?>
<launch> <arg name="database_path" default="$(find my_robot)/launch/rtabmap.db"/> 
<arg name="rgb_topic" default="/pepper_robot/camera/front/image_raw"/> 
<arg name="depth_topic" default="/pepper_robot/camera/depth/image_raw"/> 
<arg name="camera_info_topic" default="/pepper_robot/camera/front/camera_info"/>
<arg name="scan" default="/pepper_robot/laser"/>

<!-- Mapping Node -->
<group ns="rtabmap">
    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">

        <!-- Basic RTAB-Map Parameters -->
        <param name="database_path"       type="string" value="$(arg database_path)"/>
        <param name="frame_id"            type="string" value="base_link"/>
        <param name="odom_frame_id"       type="string" value="odom"/>
        <param name="subscribe_depth"     type="bool"   value="false"/>
        <param name="subscribe_scan"      type="bool"   value="true"/>

        <!-- RTAB-Map Inputs -->
        <remap from="scan"            to="/pepper_robot/laser"/>
        <remap from="rgb/image"       to="/pepper_robot/camera/front/image_raw"/>
        <remap from="depth/image"     to="/pepper_robot/camera/depth/image_raw"/>
        <remap from="rgb/camera_info" to="/pepper_robot/camera/front/camera_info"/>
        <remap from="odom"       to="/pepper_robot/odom"/>

        <!-- RTAB-Map Output -->
        <remap from="/rtabmap/grid_map" to="/map"/>

        <!-- Rate (Hz) at which new nodes are added to map -->
        <param name="Rtabmap/DetectionRate" type="string" value="1"/>
    <param name="RGBD/OptimizeFromGraphEnd"     type="string" value="false"/>

        <!-- 2D SLAM -->
        <param name="Reg/Force3DoF" type="string" value="true"/>

        <!-- Loop Closure Detection -->
        <param name="Kp/DetectorStrategy" type="string" value="0"/>

        <!-- Maximum visual words per image (bag-of-words) -->
        <param name="Kp/MaxFeatures" type="string" value="400"/>

        <!-- Used to extract more or less SURF features -->
        <param name="SURF/HessianThreshold" type="string" value="100"/>

        <!-- Loop Closure Constraint -->
        <!-- 0=Visual, 1=ICP (1 requires scan)-->
        <param name="Reg/Strategy" type="string" value="0"/>

        <!-- Minimum visual inliers to accept loop closure -->
        <param name="Vis/MinInliers" type="string" value="15"/>

        <!-- Set to false to avoid saving data when robot is not moving -->
        <param name="Mem/NotLinkedNodesKept" type="string" value="false"/>
    </node>

    <!-- visualization with rtabmapviz -->
    <node pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
        <param name="subscribe_depth"             type="bool" value="true"/>
        <param name="subscribe_scan"              type="bool" value="true"/>
        <param name="frame_id"                    type="string" value="base_link"/>
        <param name="queue_size"                  type="int" value="10"/>
        <remap from="odom"            to="/pepper_robot/odom"/>
        <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="scan"            to="/pepper_robot/laser"/>
    </node>
</group>

here is the rviz filelink text. and rostopic list is here,.

matlabbe commented 2 years ago

Is rtabmap showing a log info at 1 Hz? If not, the mapping may not be working. Is rviz launched on same computer? Is rtabmap launched on the robot or remotely?