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

Support different logging levels in ROS 2 #104

Open
matthias-mayr opened this issue Mar 1, 2024 · 0 comments
Open

Support different logging levels in ROS 2 #104

matthias-mayr opened this issue Mar 1, 2024 · 0 comments
Assignees
Labels
bug ROS 2 Issue affects ROS 2

Comments

@matthias-mayr
Copy link
Member

When using the logger with different logging levels it crashes. Line reference:
https://github.com/RVMI/skiros2/blob/ed5bc907f8509f8223bf5c75ff2b7bcf9ff056e7/skiros2_common/skiros2_common/tools/logger.py#L180-L181

Stack trace when crashing:

Fiile "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/impl/rcutils_logger.py", line 299, in log
    raise ValueError('Logger severity cannot be changed between calls.')
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_common/skiros2_common/tools/logger.py", line 181, in log
    self.__log.log(self.msgToString(self.__LOG[-1]), logToLoggingMode[mode])
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_common/skiros2_common/tools/logger.py", line 91, in logWarn
    def logWarn(self, msg, desc=None):     self.log(logMode.WARN, msg, desc)
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_world_model/skiros2_world_model/ros/ontology_interface.py", line 32, in __init__
    log.warn("[{}]".format(self.__class__.__name__), "Service {} not available, waiting again ...".format(s.srv_name))
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_world_model/skiros2_world_model/ros/world_model_interface.py", line 30, in __init__
    OntologyInterface.__init__(self, node, author_name, allow_spinning)
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/ros/skill_manager.py", line 188, in __init__
    self._wmi = wmi.WorldModelInterface(node, agent_name, make_cache=True, allow_spinning=True)
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/ros/skill_manager.py", line 385, in __init__
    self.sm = SkillManager(self, self.get_parameter('prefix').value, full_name, verbose=self.get_parameter('verbose').value)
  File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/nodes/skill_manager_node.py", line 7, in main
    node = SkillManagerNode()
  File "/home/matthias/Workspaces/skiros2_ws/install/skiros2_skill/lib/skiros2_skill/skill_manager_node", line 33, in <module>
    sys.exit(load_entry_point('skiros2-skill', 'console_scripts', 'skill_manager_node')())
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,
ValueError: Logger severity cannot be changed between calls
@matthias-mayr matthias-mayr added bug ROS 2 Issue affects ROS 2 labels Mar 1, 2024
matthias-mayr added a commit that referenced this issue Sep 18, 2024
Can be re-enabled once #104 is addressed.
matthias-mayr added a commit that referenced this issue Sep 18, 2024
Can be re-enabled once #104 is addressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ROS 2 Issue affects ROS 2
Projects
None yet
Development

No branches or pull requests

2 participants