The end stanza of create_datareader() is supposed to be attempting to create a datareader with the underlying Fast-DDS library. If creation of the datareader returns a valid pointer, we've succeeded, and if it returns a nullptr, it has failed.
However, there were two separate problems of the logic checking for these conditions:
It was checking the datareader pointer-to-a-pointer, which should always be non-null. What it really meant to check was the datareader pointer (dereferenced).
There is a fallback mechanism for when unique network flow endpoints were optionally required. The problem with that is that when using the fallback, we never check again to make sure the fallback was successful. Therefore, if we failed for another reason (like security), we would not discover it until a crash later on.
This commit fixes both of these issues.
This commit will improve the error reporting as in https://github.com/ros2/sros2/issues/287 , though it does not completely solve it (I think we need more work at the rclcpp layer).
The end stanza of create_datareader() is supposed to be attempting to create a datareader with the underlying Fast-DDS library. If creation of the datareader returns a valid pointer, we've succeeded, and if it returns a nullptr, it has failed.
However, there were two separate problems of the logic checking for these conditions:
This commit fixes both of these issues.
This commit will improve the error reporting as in https://github.com/ros2/sros2/issues/287 , though it does not completely solve it (I think we need more work at the rclcpp layer).