ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

problem with rosrun beginner_tutorials

asked 2018-07-15 22:20:29 -0600

zpz1997 gravatar image

updated 2018-07-16 13:13:52 -0600

jayess gravatar image

the address: . when i use rosrun beginner_tutorials 4 5 in my computer, the terminal told me that

rosrun beginner_tutorials 4 5
Requesting 4+5
Traceback (most recent call last):

  File "/home/zhoupizeng/catkin_ws/src/beginner_tutorials/scripts/", line 27, in <module>
    print "%s + %s = %s"%(x, y, add_two_ints_client(x, y))

  File "/home/zhoupizeng/catkin_ws/src/beginner_tutorials/scripts/", line 8, in add_two_ints_client
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/", line 160, in wait_for_service
    rospy.core.logwarn_throttle(10, "wait_for_service(%s): failed to contact, will keep trying"%resolved_name)

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/", line 243, in logwarn_throttle
    _base_logger(msg, logger_throttle=period, logger_level='warn')

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/", line 184, in _base_logger
    if _logging_throttle(caller_id, throttle):

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/", line 222, in __call__
    now =

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/", line 155, in now
    return get_rostime()

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/", line 190, in get_rostime
    raise rospy.exceptions.ROSInitException("time is not initialized. Have you called init_node()?")

rospy.exceptions.ROSInitException: time is not initialized. Have you called init_node()?
edit retag flag offensive close merge delete


Can you update your question with the code?

jayess gravatar image jayess  ( 2018-07-16 13:14:21 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-16 11:27:44 -0600

ffusco gravatar image

You probably forgot to start a master, type on another console roscore, then try to re-run both the server and the client. Hopefully, they should be working fine!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-07-15 21:49:21 -0600

Seen: 336 times

Last updated: Jul 16 '18