Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aligh with rcl that a rosout publisher of a node might not exist #1196

Conversation

iuhilnehc-ynos
Copy link
Contributor

align with ros2/rcl#1115

Chen Lihui added 2 commits November 6, 2023 09:30
Signed-off-by: Chen Lihui <[email protected]>
reset error message for RCL_RET_NOT_FOUND as well

Signed-off-by: Chen Lihui <[email protected]>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add a test for this situation, but it otherwise looks good.

@@ -114,13 +114,6 @@ def call_logger(logger):
self.executor.spin_until_future_complete(self.fut, 3)
self.assertTrue(self.fut.done())

def test_node_logger_not_exist(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to add a test to ensure that the situation from #1195 doesn't occur again. The following code (which needs to be adapted into a test) reproduced for me:

import rclpy
from rclpy.action import ActionServer

from example_interfaces.action import Fibonacci

class MyClass:
    def __init__(self, node):
        self.action_server = ActionServer(
            node,
            Fibonacci,
            "/fibonacci_action_1",
            self.execute_callback,
        )

    def execute_callback(self):
        print("Execute callback")

rclpy.init()
node = rclpy.create_node("mynode", enable_rosout=False)
x = MyClass(node)
node.destroy_node()
rclpy.try_shutdown()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
I used the similar logic to test the case. Updated in fc84c5e.

Chen Lihui added 2 commits November 14, 2023 09:27
@clalancette
Copy link
Contributor

CI for this is in ros2/rcl#1115 (comment)

@clalancette clalancette merged commit f909278 into ros2:rolling Nov 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants