ros_comm
ros_comm copied to clipboard
rospy.core.is_initialized() is False after rospy.init_node()
I found that after rospy.init_node(), rospy.core.is_initialized() still returns False.
However, in the function rospy.init_node, there is the process of rospy.core.set_initialized(True) here
I'm not sure why this problem is happening. Please use the following test code to check this error.
from mock import patch
from nose.tools import eq_
import rospy
@patch('rospy.init_node')
def test_rospy_core_is_initialized(init_mock):
"""Test rospy.core.is_initialized()"""
eq_(rospy.core.is_initialized(), False)
rospy.init_node("test_node")
eq_(rospy.core.is_initialized(), True)