I have been working on slam for outdoor environment using zed2i camera and the zed-ros-examples github repo (used to be known as zed-wrapper but now has been bifurgated to zed-ros-wrapper and zed-ros-examples)
Under zed-ros-examples i have come across the zed-rtabmap-example folder that can be used for doing the above task mentioned.
i have been getting okayish results so far.
I'm able to plot the map pretty satisfactorily but one of the problems ive been facing is that the it overdoes its turns i.e., if i try taking a 90 degree turn, it shows it takes a turn which is greater than 90 degrees which kinda messes up my map.
i want my map to be near perfect cause i will be using it for navigation of a relatively bigger vehicle and there can be no room for errors. Unfortunately i dont have any pictures of that happening but I hope i'm making sense so that you can understand it well.
One more problem that im facing is that while localization, even though it is comparing the right frame to the real time frame, it shows "loop closure hypothesis rejected" way too many times which makes the vehicle loose its track and i recieve not very accurate results.
i'm very new to this right now so please bare with me.
Below is my zed_rtabmap.launch file <launch> <arg name="svo_file" default="" /> <arg name="stream" default="" />
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
publish_tf: false # Set to false if fusing different poses (map->odom) with UKF
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
I am also facing huge z axis drifts while mapping. Is there any way i can rectify that as well?
I would also like to know how to go ahead from here if i'm making any mistakes.
please let me know if there are any advices and any changes that can be made as it would be of great great help.
I see you are using ZED's odometry, I think it should be more accurate than that. Maybe the camera is not correctly calibrated? For stereo camera, it is super important that the calibration is good, otherwise motion estimation is drifting a lot more.
For the "loop closure hypothesis rejected", what is the full message? why is it rejected?
(i)I have calibrated the camera again and will try mapping the layout one more time.
(ii) For loop closure hypothesis part, it just shows loop closure hypothesis rejected with its respective frame id it is comparing it to in rtabmap(with the red background instead of green when it detects a loop closure).
The thing I wanted to know was why is it showing me loop closure hypothesis rejected even though it is comparing it with the right frame id with not many feature mismatches.
Is there any way I can change my code to get rid of this problem?
(iii) Can I also know how to use rtabmap instead of zed's odometry?
(ii) You would see a warning in terminal showing why it has been rejected. Sometimes it is because graph deformation error is above RGBD/OptimizeMaxError, which could be increased (default 3) if you confirm that these loop closures should be accepted.
(iii) You may have to disable odom from zed to avoid conflicting TF for same odom frame, but afterwards it could be something like this:
(ii)You were right, that is exactly what is showing up in the terminal(RGBD/OptimizeMaxError)
How to Fix this?
Also by how much should I increase the value(RGBD/OptimizeMaxError) to?
1. Could you please let me know what all things need to be done for setting up RTABMAP in order to use it for navigation using ZED2i camera? I would appreciate any sources that you could kindly provide! I have been through - http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping and other ros-wiki pages related to it. I am not able to get any localization values whatsoever in only localization mode.
I am suspicious of the rejected 180 deg loop closures if they are really good. I would need to reproduce your experiment to see if there ia a bug with the visual proximity detections. I'll to reproduce it in the next days.