打开/home/ps/你自己的路径/ros2_orb_ws/src/orbslam3_ros2/src/stereo目录找到stereo-slam-node.cpp文件打开。找到left_sub std::make_sharedmessage_filters::SubscriberImageMsg (shared_ptrrclcpp::Node(this), camera/rgb); right_sub std::make_sharedmessage_filters::SubscriberImageMsg (shared_ptrrclcpp::Node(this), camera/depth);将其改为这个也就是替换成thisleft_sub std::make_sharedmessage_filters::SubscriberImageMsg (this, camera/left); right_sub std::make_sharedmessage_filters::SubscriberImageMsg (this, camera/right);然后重新编译如果还是报错多试几次就可以。