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

Make log config from rosgraph optional #1797

Merged

Conversation

otamachan
Copy link
Contributor

Hi,

I'm trying to run rospy in a pure Python environment.
Currently rospy.init_node() always fails because rospkg.RosPack().get_path('rosgraph') fails in a pure Python environment(see below).

This PR enables that init_node does not fail even when rosgraph cannot be found by rospkg.

Thank you.

>>> rospy.init_node('test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/otamachan/proj/rospy/venv/lib/python3.6/site-packages/rospy/client.py", line 309, in init_node
    rospy.core.configure_logging(resolved_node_name)
  File "/home/otamachan/proj/rospy/venv/lib/python3.6/site-packages/rospy/core.py", line 405, in configure_logging
    _log_filename = rosgraph.roslogging.configure_logging('rospy', level, filename=filename)
  File "/home/otamachan/proj/rospy/venv/lib/python3.6/site-packages/rosgraph/roslogging.py", line 156, in configure_logging
    rosgraph_d = rospkg.RosPack().get_path('rosgraph')
  File "/home/otamachan/proj/rospy/venv/lib/python3.6/site-packages/rospkg/rospack.py", line 203, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: rosgraph

@dirk-thomas
Copy link
Member

Thanks for the patch.

@dirk-thomas dirk-thomas merged commit 487ee6c into ros:melodic-devel Oct 3, 2019
@otamachan otamachan deleted the make-rosgraph-conf-optional branch October 5, 2019 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants