Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtabmap not subscribe to odom #1178

Open
Bouchrikator opened this issue Jun 22, 2024 · 2 comments
Open

rtabmap not subscribe to odom #1178

Bouchrikator opened this issue Jun 22, 2024 · 2 comments

Comments

@Bouchrikator
Copy link

Bouchrikator commented Jun 22, 2024

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
Copy link
Author

Bouchrikator commented Jun 23, 2024

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>
`

@matlabbe
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants