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

ROS Beginner Tutorials: Examining the Simple Service and Client (python) - need some help

asked 2013-08-01 12:37:23 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hey guys,

I'm following the ROS Tutorials and, using the Python language, I'm currently having some issues trying to solve the item Examining the Simple Service and Client item (www.ros .org/wiki/ROS/Tutorials/ExaminingServiceClient">link text).

When I try to run the server (the first step in the tutorial), I get the following message:

viki@ROS:~/catkin_ws/src$ rosrun beginner_tutorials add_two_ints_server.py
Unable to register with master node [http :// localhost:11311]: master may not be running yet. Will keep trying.

And then my Terminal window gets blocked. Before that, when I compiled the code (from the previous tutorial: <link>http :// www.ros .org/wiki/ROS/Tutorials/WritingServiceClient%28python%29</link>) everything seems to work fine:

viki@ROS:~/catkin_ws$ catkin_make
Base path: /home/viki/catkin_ws
Source space: /home/viki/catkin_ws/src
Build space: /home/viki/catkin_ws/build
Devel space: /home/viki/catkin_ws/devel
Install space: /home/viki/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/viki/catkin_ws/build"
####
####
#### Running command: "make -j1 -l1" in "/home/viki/catkin_ws/build"
####
[  0%] Built target std_msgs_generate_messages_lisp
[  2%] Built target beginner_tutorials_generate_messages_lisp
[  2%] Built target std_msgs_generate_messages_py
[  7%] Built target beginner_tutorials_generate_messages_py
[  7%] Built target std_msgs_generate_messages_cpp
[ 10%] Built target beginner_tutorials_generate_messages_cpp
[ 10%] Built target beginner_tutorials_generate_messages
[ 11%] Built target roscpp_tutorials_generate_messages_cpp
[ 11%] Built target roscpp_tutorials_gencpp
[ 12%] Built target add_two_ints_client
[ 14%] Built target add_two_ints_server
[ 15%] Built target add_two_ints_server_class
[ 16%] Built target anonymous_listener
[ 18%] Built target babbler
[ 19%] Built target custom_callback_processing
[ 20%] Built target listener
[ 22%] Built target listener_async_spin
[ 23%] Built target listener_class
[ 24%] Built target listener_multiple
[ 25%] Built target listener_threaded_spin
[ 27%] Built target listener_unreliable
[ 28%] Built target listener_with_tracked_object
[ 29%] Built target listener_with_userdata
[ 31%] Built target node_handle_namespaces
[ 32%] Built target notify_connect
[ 33%] Built target parameters
[ 36%] Built target roscpp_tutorials_generate_messages_py
[ 37%] Built target roscpp_tutorials_generate_messages_lisp
[ 37%] Built target roscpp_tutorials_generate_messages
[ 38%] Built target talker
[ 40%] Built target time_api_sleep
[ 41%] Built target timers
[ 49%] Built target rospy_tutorials_generate_messages_py
[ 54%] Built target rospy_tutorials_generate_messages_lisp
[ 59%] Built target rospy_tutorials_generate_messages_cpp
[ 59%] Built target rospy_tutorials_generate_messages
[ 59%] Built target std_srvs_generate_messages_cpp
[ 59%] Built target geometry_msgs_generate_messages_cpp
[ 68%] Built target turtlesim_generate_messages_cpp
[ 68%] Built target turtlesim_gencpp
[ 70%] Built target draw_square
[ 71%] Built target mimic
[ 72%] Built target turtle_teleop_key
[ 72%] Built target std_srvs_generate_messages_py
[ 72%] Built target geometry_msgs_generate_messages_py
[ 84%] Built target turtlesim_generate_messages_py
[ 84%] Built target std_srvs_generate_messages_lisp
[ 84%] Built target geometry_msgs_generate_messages_lisp
[ 93%] Built target turtlesim_generate_messages_lisp
[ 93%] Built target turtlesim_generate_messages
[100%] Built target turtlesim_node
viki@ROS:~/catkin_ws$

When I try roswtf I get no error:

viki@ROS:~/catkin_ws$ roswtf
No package or stack in context
================================================================================ Static checks summary:

No errors or warnings
================================================================================

ROS Master does not appear to be
running. Online graph checks will not
be run. ROS_MASTER_URI is
[http :// localhost:11311]

I haven't found any clues on the web related to this and I can't figure it out what's really happening.

Can anyone help me? Thanks in advance,

Batta

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-08-01 15:48:41 -0600

lifelonglearner gravatar image

updated 2013-08-01 15:55:42 -0600

This is normally the problem when you have not done Environment setup
There are few steps you need to perform before doing any thing else. I think you missed one step out of that which we need to perform after proper installation of ROS that is Environment setup

Please visit following link and make sure you have perform steps from 1.1 to 1.7 if you have not done so far ....

http://www.ros.org/wiki/groovy/Installation/Ubuntu

If you have already done the environmental setup then you need to run roscore command that is the master program through which all other program communicate to get performed in ROS .....

$ roscore

I hope your problem will be solved by that.

edit flag offensive delete link more

Comments

1

Since catkin_make succeeded, the environment is probably configured properly. But, as @lifelonglearner says, you must start `roscore` in a separate terminal before you can issue `rosrun beginner_tutorials add_two_ints_server.py`.

dPackard gravatar image dPackard  ( 2013-08-02 03:49:23 -0600 )edit
0

answered 2013-08-02 07:22:36 -0600

Batta gravatar image

Actually, starting 'roscore' in a separate terminal before issuing 'rosrun beginner_tutorials add_two_ints_server.py' solved my problem with the server (I got the message "Ready to add two ints").

The clients didn't work as expected, but I'll try to see the steps I missed here, @dPackard and @lifelonglearner.

Thanks.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-01 12:37:23 -0600

Seen: 756 times

Last updated: Aug 02 '13