Ask Your Question
0

problem with rosrun beginner_tutorials add_two_ints_client.py

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

zpz1997 gravatar image

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

jayess gravatar image

the address: http://wiki.ros.org/rospy_tutorials/T... . when i use rosrun beginner_tutorials add_two_ints_client.py 4 5 in my computer, the terminal told me that

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

  File "/home/zhoupizeng/catkin_ws/src/beginner_tutorials/scripts/add_two_ints_client.py", 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/add_two_ints_client.py", line 8, in add_two_ints_client
    rospy.wait_for_service('add_two_ints')
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", 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/core.py", line 243, in logwarn_throttle
    _base_logger(msg, logger_throttle=period, logger_level='warn')

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

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

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

  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/rostime.py", 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

Comments

Can you update your question with the code?

jayess gravatar imagejayess ( 2018-07-16 13:14:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 63 times

Last updated: Jul 16 '18