Re: RTAB-Map launch file for zed2i

Posted by Parastou Bakhtiari on
URL: http://official-rtab-map-forum.206.s1.nabble.com/RTAB-Map-launch-file-for-zed2i-tp10920p11020.html

Hi Mattlabee, Thank you for your reply.

I assume I did the exact same thing you mentioned here.
I used this python code to remove vio/map:
import rosbag
from tf.msg import tfMessage
import argparse

# Parse command-line arguments
parser = argparse.ArgumentParser(description='Remove vio/map frame from a ROS bag.')
parser.add_argument('--input', required=True, help='Input ROS bag file.')
parser.add_argument('--output', required=True, help='Output ROS bag file.')
args = parser.parse_args()

# Process the bag file
with rosbag.Bag(args.output, 'w') as outbag:
    for topic, msg, t in rosbag.Bag(args.input).read_messages():
        if topic == "/tf" and msg.transforms:
            filteredTransforms = []
            for m in msg.transforms:
                if m.header.frame_id != "vio/map":  # Check for vio/map instead of map
                    filteredTransforms.append(m)
                else:
                    print('vio/map frame removed!')
            if len(filteredTransforms) > 0:
                msg.transforms = filteredTransforms
                outbag.write(topic, msg, t)
        else:
            outbag.write(topic, msg, t)

print(f"Processing complete. Output saved to {args.output}")<quote author="matlabbe">

but launching gives me this error:
[ WARN] [1742683066.303884525, 1685653489.214015925]: Could not get transform from base_link to zed2_front_left_camera_optical_frame after 0.200000 seconds (for stamp=1685653488.912728)! Error="canTransform: source_frame zed2_front_left_camera_optical_frame does not exist.. canTransform returned after 0.202284 timeout was 0.2.".
[ERROR] [1742683066.303978734, 1685653489.214015925]: TF of received image 0 at time 1685653488.912728s is not set!
[ERROR] [1742683066.304027361, 1685653489.214015925]: Could not convert rgb/depth msgs! Aborting rtabmap_viz update...

Would you please tell me what can I do?