rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

rtabmap not subscribe to odom

Open Bouchrikator opened this issue 1 year ago • 2 comments

so i used the same code a kinect here http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot Kinect + Odometry i tried also Kinect + Odometry + Fake 2D laser from Kinect but it didint work too here is my launch file : `

<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_sync/rgbd_sync" output="screen">
  <remap from="rgb/image"       to="/camera/rgb/image_rect_color"/>
  <remap from="depth/image"     to="/camera/depth_registered/image_raw"/>
  <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
  <remap from="rgbd_image"      to="rgbd_image"/> <!-- output -->
  
  <!-- Should be true for not synchronized camera topics 
       (e.g., false for kinectv2, zed, realsense, true for xtion, kinect360)-->
  <param name="approx_sync"       value="true"/> 
</node>

<node name="rtabmap" pkg="rtabmap_slam" type="rtabmap" output="screen" args="--delete_db_on_start">
      <param name="frame_id" type="string" value="base_link"/>

      <param name="subscribe_depth" type="bool" value="false"/>
      <param name="subscribe_rgbd" type="bool" value="true"/>

      <remap from="odom" to="/odom"/>

      <remap from="rgbd_image" to="rgbd_image"/>

      <param name="queue_size" type="int" value="10"/>

      <!-- RTAB-Map's parameters -->
      <param name="RGBD/AngularUpdate"        type="string" value="0.01"/>
      <param name="RGBD/LinearUpdate"         type="string" value="0.01"/>
      <param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
</node>
`

Screenshot from 2024-06-22 13-50-43

Screenshot from 2024-06-22 13-50-34

here is also the rqt_graph

rosgraph

i'm using also rosrun tf static_transform_publisher 0.2 0 0.1 0 0 0 base_link camera_link 100 to add the kinect into the base link and it can make issues isn't ?

i'm suck i have a deadline

Bouchrikator avatar Jun 22 '24 12:06 Bouchrikator

UPDATE: i tried this when and used that launch file i linked the camera_link with the base_link and here what happend when i start rtabmap it looks like camera link wants to go to the map link where it start:

image

image

i used this launch file:

`

<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_sync/rgbd_sync" output="screen">
  <remap from="rgb/image"        to="/camera/rgb/image_rect_color"/>
  <remap from="depth/image"      to="/camera/depth_registered/image_raw"/>
  <remap from="rgb/camera_info"  to="/camera/rgb/camera_info"/>
  <remap from="rgbd_image"       to="rgbd_image"/> <!-- output -->
  
  <!-- Should be true for not synchronized camera topics 
       (e.g., false for kinectv2, zed, realsense, true for xtion, kinect360)-->
  <param name="approx_sync"       value="true"/> 
</node>

<!-- Odometry -->
<node pkg="rtabmap_odom" type="rgbd_odometry" name="rgbd_odometry" output="screen">
  <param name="subscribe_rgbd" type="bool"   value="true"/>
  <param name="frame_id"       type="string" value="base_link"/>
  <remap from="rgbd_image" to="rgbd_image"/>
</node>

<node name="rtabmap" pkg="rtabmap_slam" type="rtabmap" output="screen" args="--delete_db_on_start">
      <param name="frame_id"        type="string" value="base_link"/>
      <param name="subscribe_depth" type="bool"   value="false"/>
      <param name="subscribe_rgbd"  type="bool"   value="true"/>

      <remap from="odom"       to="odom"/>
      <remap from="rgbd_image" to="rgbd_image"/>

      <param name="queue_size"  type="int"  value="10"/>
      <param name="approx_sync" type="bool" value="false"/>

      <!-- RTAB-Map's parameters -->
      <param name="RGBD/AngularUpdate"        type="string" value="0.01"/>
      <param name="RGBD/LinearUpdate"         type="string" value="0.01"/>
      <param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
</node>
<node pkg="rtabmap_viz" type="rtabmap_viz" name="rtabmap_viz" 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"/>

  <remap from="rgb/image"        to="/camera/rgb/image_rect_color"/>
  <remap from="depth/image"      to="/camera/depth_registered/image_raw"/>
  <remap from="rgb/camera_info"  to="/camera/rgb/camera_info"/>
    <!--remap from="scan"            to="/scan"/-->
</node>
`

Bouchrikator avatar Jun 23 '24 16:06 Bouchrikator

You may have two odometry nodes (rgbd_odometry and your wheel odometry) publishing on same TF. Add this to rgbd_odometry node (assuming your wheel odometry is publishing TF odom->base_link) to avoid TF issues:

<param name="odom_frame_id"       type="string" value="vo"/>
<param name="guess_frame_id"       type="string" value="odom"/>

You may also try without rgbd_odometry too, and just remap your /odom topic in rtabmap node.

matlabbe avatar Jun 24 '24 00:06 matlabbe