ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Using shared_from_this()
is the correct way to obtain a rclcpp::Node::SharedPtr
. But note that it only works if there already exists a shared_ptr
that has ownership of the node. If you had only created a local OdomNode
object instead of using std::make_shared
, you would get that bad_weak_ptr
error.