Toriyung

导航

(报错)ROS2:terminate called after throwing an instance of 'std::runtime_error' what(): Node has already been added to an executor.

在学习使用坐标变换监听tf2_ros::TransformListener时报错

创建监听对象

listener_ = std::make_shared<tf2_ros::TransformListener>(*buffer_,this); 

按教程这里构造传入了两个参数,第二个是自身节点对象,可能导致了重复spin

 

解决方法:把this去了,只传入*buffer_一个参数

posted on 2024-05-17 23:01  Toriyung  阅读(140)  评论(0编辑  收藏  举报