rclpy icon indicating copy to clipboard operation
rclpy copied to clipboard

Node.destroy_node() does not return bool

Open cyuanli opened this issue 3 years ago • 3 comments

Bug report

Expected behavior

When calling Ǹode.destroy_node(), a bool should be returned as specified in the function declaration.

Actual behavior

The implementation does not return anything.

cyuanli avatar Jan 20 '22 13:01 cyuanli

It shouldn't return a bool; there is no way that it can fail. The current implementation is correct, but the annotation is wrong. This was fixed in Rolling as part of 48c785091d2f7b00c9737a0e65e90f6672558323 .

We can't backport that whole change (as it is much too large), but we could backport just the fix to the annotation for destroy_node. @cyuanli if you'd like to open a PR to do that, it would be appreciated.

clalancette avatar Jan 20 '22 14:01 clalancette

Hi @clalancette . Is this issue still open and if yes, can I work on it?

saratrajput avatar Feb 02 '22 22:02 saratrajput

@saratrajput It's still open, and yes you may work on it. It means removing the -> bool annotation on a PR targeting the galactic branch.

https://github.com/ros2/rclpy/blob/133bb0721afaf4d376cdc1066d1f6dfac6b01a73/rclpy/rclpy/node.py#L1653

sloretz avatar Feb 02 '22 22:02 sloretz

@clalancette is this issue still open ?

subhajit20 avatar Apr 02 '23 15:04 subhajit20

Nope, this was solved long ago.

clalancette avatar Apr 02 '23 19:04 clalancette