ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The problem is this line
_odom_tb{std::make_shared<tf2_ros::StaticTransformBroadcaster>(shared_from_this())}
You are trying to get a shared pointer from this
in the initialization phase, even though the constructor isn't fully completed yet and therefore this
doesn't point to a correct instance.
As a workaround, you can try to call theconstructor for the StaticTransformBroadcaster [0] with a raw this
pointer or introduce a separate init
function for your odomNode.
[0] https://github.com/ros2/geometry2/blob/ros2/tf2_ros/include/tf2_ros/static_transform_broadcaster.h#L53-L63
2 | No.2 Revision |
The problem is this line
_odom_tb{std::make_shared<tf2_ros::StaticTransformBroadcaster>(shared_from_this())}
You are trying to get a shared pointer from this
in the initialization phase, even though the constructor isn't fully completed yet and therefore this
doesn't point to a correct instance.
As a workaround, you can try to call theconstructor the constructor for the StaticTransformBroadcaster StaticTransformBroadcaster
[0] with a raw this
pointer or introduce a separate init
function for your odomNode.
[0] https://github.com/ros2/geometry2/blob/ros2/tf2_ros/include/tf2_ros/static_transform_broadcaster.h#L53-L63