ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I would guess the problem is the temporary object you use for the tracked_object
parameter in the SubscriberOptions. It will go out of scope immediately which will cause your subscriber to be destroyed right after creation.
I would not suggest to use the version of subscribe that takes an instance of SubscriberOptions. Instead, better use one of the higher-level functions. If you need to use a different callback queue, set it for the complete NodeHandle if possible. See here for more info.