When should I see an rcl node show up in rqt_graph?

asked 2021-06-15 17:20:50 -0500

BrettHemes gravatar image

updated 2021-06-16 17:37:19 -0500

I am working with rcl directly and from what I can tell have succeeded in initializing a node. I can queury its name and get a true result when checking its validity (via rcl_node_is_valid()), however, the node does not show up as I had expected as a sanity check (when running an instance of rqt_graph in another terminal). Running > ros2 node list also does not show any indication of success.

My question is: at what point through the rcl API should I be able to see my node? So far I have done the following:

init_opts = rcl_get_zero_initialized_inti_options();
context = rcl_get_zero_initialized_context();
alloc = rcl_get_default_allocator();
rcl_init_options_init(init_opts, alloc);
rcl_init(init_opts, context);
node = rcl_get_zero_initialized_node();
node_opts = rcl_node_get_default_options();
rcl_node_init(node, "node_name", "node_ns", context, node_opts);

Am I missing something before I can see my node?

Thanks, Brett

UPDATE (6/16):

I worked some more on this today and was able to see my node in the graph after initializing a publisher for the node in question. Using a demo_nodes_cpp to test I am still, however, not getting the first (few) published messages but it seems stable after the first receipt.

edit retag flag offensive close merge delete