ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 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.