share_from_this
1,需要对象继承
std::enable_shared_from_this<T>
2,必须确保对象已由 std::shared_ptr
管理,否则调用 shared_from_this()
会导致 运行时错误。
rclcpp::spin(WareNode::getInstance().shared_from_this());
1,需要对象继承
std::enable_shared_from_this<T>
2,必须确保对象已由 std::shared_ptr
管理,否则调用 shared_from_this()
会导致 运行时错误。
rclcpp::spin(WareNode::getInstance().shared_from_this());