Flickering/drifting in rviz when using rtabmap and nav2 for mapping with a zed2i

Hello,
I have been trying to generate a map to use later for localization by running a node involving rtabmap and nav2.
But recently i have noticed a lot of flickering or drifting(for example the camera is pointing straight ahead and then suddenly starts pointing say 10 degrees to the right then back again) and sometimes even ends up going below the plane of the map.
I did not encounter this problem before and even generated a few maps but recently it has started happening.
And the biggest problem is that when running the same codes on my friends pc their is no such problem.
I am a bit new to this so can you please help me resolve this issue and explain whether this could be a hardware issue or something else.
Thanks

Hi @an_f1
Welcome to the Stereolabs community.

What you described is too vague, and it’s not possible to understand what’s happening without more details.
Please record and share videos to show the problem and share the configuration parameters.

its not letting me upload attachments here as i am a new user is there some other way i can share the screen recording of the issue so you can understand it better

You can use an external file sharing service (e.g Google Drive, Dropbox, …) and share the link

Here is the drive link with the video please tell me if you need anything else.
Also the issue is not as bad in this but sometimes it can be much more pronounced

Hi @an_f1
What I see in the video is a typical TF issue.
You have different nodes publishing the same TF.

Please check what nodes are publishing the map → odom and the odom → base_link transformations.

I also recommend you read this section of our ROS 2 documentation to learn more about this problem: ZED integration on a Robot - Stereolabs

From this it seems there is no tf issue as only a single transform from map→odom and odom→base_link exists

i am not publishing odom through zed_wrapper i am using rtab for odom and map tf so there shouldn’t be an issue there

Have you disabled the ZED ROS2 Wrapper odometry by setting publish_tf:=false in the launch file?

    'publish_tf':
        Enable publication of the `odom -> camera_link` TF. Valid choices are: ['true', 'false']
        (default: 'true')

You must set it like this:
ros2 launch zed_wrapper zed_camera.launch.py camera_model:=<camera_model> publish_tf:=false

otherwise, if you set it in the parameter file and you use this launch file, it overwrites the value.

oh i just realized i had made changes to the zed_camera launch file (basically made a new modified one) but had been using the previous one this whole time.:sweat_smile:
The problem is fixed now.
Thanks a lot.

1 Like

They both had same names but were in different workspaces