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

Exception when instantiating ActionServer as part of ROS package tests #1195

Closed
sea-bass opened this issue Nov 1, 2023 · 2 comments · Fixed by ros2/rcl#1115
Closed

Exception when instantiating ActionServer as part of ROS package tests #1195

sea-bass opened this issue Nov 1, 2023 · 2 comments · Fixed by ros2/rcl#1115
Assignees
Labels
bug Something isn't working

Comments

@sea-bass
Copy link

sea-bass commented Nov 1, 2023

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • Binaries
  • Version or commit hash:
    • Latest binaries of Humble/Iron/Rolling
  • DDS implementation:
    • Fast DDS or Cyclone DDS (doesn't make a difference)
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

I have a test that is failing as part of this PR (RobotWebTools/rosbridge_suite#886) when I try to instantiate an action server, noting that:

  • This only happens on Iron and Rolling, but not on Humble
  • This only happens when I run using colcon test (which in turn uses ament_add_pytest_test CMake capability), but not if I run it directly using Python

Can't seem to figure out why this would be the case, so figured I'd elevate it here? Thank you!

The code:

from example_interfaces.action import Fibonacci

class MyClass:
    def __init__(self, node):
        self.action_server = ActionServer(
            node,  # Just an rclpy.Node
            Fibonacci,
            "/fibonacci_action_1",
            self.execute_callback,
        )

The error:

          self.action_server = ActionServer(
      /opt/ros/rolling/lib/python3.10/site-packages/rclpy/action/server.py:264: in __init__
          self._logger = self._node.get_logger().get_child('action_server')
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      
      self = <rclpy.impl.rcutils_logger.RcutilsLogger object at 0x7f730bfe9270>
      name = 'action_server'
      
          def get_child(self, name):
              if not name:
                  raise ValueError('Child logger name must not be empty.')
          
              if self.name:
                  # Prepend the name of this logger
      >           _rclpy.rclpy_logging_rosout_add_sublogger(self.name, name)
      E           RuntimeError: Failed to call rcl_logging_rosout_add_sublogger

Expected behavior

Should not raise an exception.

Actual behavior

Raises an exception.

@sea-bass
Copy link
Author

sea-bass commented Nov 1, 2023

Seems the issue originates from #982, whereas the exception comes from #1084

@fujitatomoya
Copy link
Collaborator

@iuhilnehc-ynos can you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants