introlab / rtabmap

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

localization delay time too long when moving. how to increase the publish frequency. please help me !!!! #1277

Open qetuo105487900 opened 6 months ago

qetuo105487900 commented 6 months ago

i run sensor on robot, and run rtabmap on my computer like this: Screenshot from 2024-05-07 22-50-34 i use this parameter on demo_husky.launch

  <arg name="initial_pose"   default="0.00841955 0.085911 0 0 0 -1.6405"/>
  <arg name="database_path" default="~/.ros/itc_1F.db"/>
  <arg name="navigation"   default="true"/>
  <arg name="localization" default="true"/>
  <arg name="icp_odometry" default="true"/>
  <arg name="rtabmap_viz"  default="false"/>
  <arg name="camera"       default="true"/>
  <arg name="lidar2d"      default="false"/>
  <arg name="lidar3d"      default="true"/>
  <arg name="lidar3d_ray_tracing" default="true"/>
  <arg name="slam2d"       default="true"/>
  <arg name="depth_from_lidar" default="false"/>

its delay time is too long that can't deliver my destination with path follow

qetuo105487900 commented 6 months ago

i want to go to r317-1 here can see

https://github.com/introlab/rtabmap/assets/67533597/fb5bf7bc-094b-45f0-afb4-69a3b4d2ed98

the costmap is reatime but the tf from tf is long time ago's pose

qetuo105487900 commented 6 months ago

here. maybe i found the problem between cartographer and rtabmap.

based on cartographer, the rate from map to odom is 195. but based on rtabmap, the rate from map to icp_odom only 20. having a huge difference between them.

so, rtabmap can change rate from map to icp_odom and from icp_odom to odom ?

Screenshot from 2024-05-09 00-09-54 Screenshot from 2024-05-09 00-09-24

qetuo105487900 commented 6 months ago

if i only use 3d lidar and wheel odom to do slam, rtabmap can increased the map -> odom frequency on localization mode to maybe 100 or 200 hz ?

matlabbe commented 6 months ago

map -> odom rate doesn't need to be increased. It is already post stamped 1 second in the future (so always available). The costmap is using which frame? I would not expect the costmap itself to rotate as the odom frame should be fixed. Which frame is used as global frame in rviz?

icp_odometry is 10 Hz matching the frame rate of the lidar (we cannot make it publishing faster than input sensor rate).

Try also rostopic delay to see which topic is causing so much delay.

Are the two computer clocks synchronized?

qetuo105487900 commented 6 months ago

hello, @matlabbe . the costmap is based on "base_footprint" frame. tf based on map. rviz gloab frame fixed on map which generated from rtabmap. my mean is delay for a long time when i use joystick to rotate the robot, costmap can rotate immediately, but the tf after rtabmap is delay for a long time. --.......................................................................-- sorry, i can't find "rostopic delay". if you have any more detail description.

qetuo105487900 commented 6 months ago

i want to go to r317-1 here can see

2024._11_36_17PM.Copy.mp4 the costmap is reatime but the tf from tf is long time ago's pose

at this video 0:02, can see. i turn left, but the tf which localizate on map delay for a long time.

qetuo105487900 commented 6 months ago

https://github.com/introlab/rtabmap/assets/67533597/02d98b11-0922-47b8-b4dd-73202078cbe8

the left side is rtabmap/localization_pose topic the right side is camera topic we can see the stamp from rtabmap/localization_pose is very older than camera topic, i think is this problem, so delay for a long time.

matlabbe commented 6 months ago

What is the processing time shown in rtabmap log? It seems there is a 2 sec delay, meaning 2 sec processing time? If so, so tuning about ICP parameters may be needed to use less points for localization. Can you launch rtabmap node with "--udebug" argument and show log of one update here?

qetuo105487900 commented 6 months ago

sorry, i launch rtabmap node with "--udebug" argument , but where is the log path?

qetuo105487900 commented 6 months ago

by the way, i try yesterday, only use camera with superpoint, the rate of locailzation_pose only 0.5hz (under 1 hz), this can localization on the correct position. only use lidar, the rate of locailzation_pose can get approximately 10hz, but this can't localization on the correct position. use lidar and camera , the rate of locailzslation_pose about 4~5hz. this can localization on the correct position. so maybe problem on feature map too slow?

matlabbe commented 6 months ago

If you start the node with output="screen", the log should appear in the terminal directly.

If you are using Rtabmap/DetectionRate at 0, the visual dictionary will increase in size super fast, slowing down overall frame rate. Without seeing the whole launch file and a rtabmap database, it is difficult to assess why some config are slower on your computer. If you are using Superpoint, I hope you are using cuda version, otherwise it is super slow.