Ask Your Question
0

Unable to communicate to some of ROS services

asked 2012-11-15 15:23:04 -0500

jys gravatar image

updated 2014-11-22 17:05:30 -0500

ngrennan gravatar image

I am trying to call ros services but I am unable to call some rosservices...

It works for /rosout/get_loggers but doesn't work with gazebo related services.. rosservice list shows all services.

(I intentionally added spaces between rosrpc and localhost because the system thinks I am posting some URL links and I don't have enough karma)

$ rosservice uri /rosout/get_loggers 
rosrpc: // localhost:59423
$ rosservice type /rosout/get_loggers 
roscpp/GetLoggers
$ rosservice uri /gazebo/unpause_physics
rosrpc : // localhost:41557
$ rosservice type /gazebo/unpause_physics
ERROR: Unable to communicate with service [/gazebo/unpause_physics], address [rosrpc : // localhost:41557]
$ rosservice call /gazebo/unpause_physics
ERROR: Unable to communicate with service [/gazebo/unpause_physics], address [rosrpc : // localhost:41557]

I read about network setup but still not able to figure out what is going on.. Please help.

$ echo $ROS_MASTER_URI 
http : // localhost:11311
$ echo $ROS_HOSTNAME 
localhost
edit retag flag offensive close merge delete

Comments

rosservice list shows all. Fixing /etc/hosts didn't help.

jys gravatar image jys  ( 2012-11-16 03:19:47 -0500 )edit

Maybe a stupid question but is gazebo running? What's the output of rosservice info /gazebo/unpause_physics?

Lorenz gravatar image Lorenz  ( 2012-11-18 21:49:06 -0500 )edit

I get same error.. Gazebo is running.. It is in "paused" state and GUI botton for "resume" doesn't respond.. Node: /gazebo URI: rosrpc://localhost:36586 ERROR: Unable to communicate with service [/gazebo/unpause_physics], address [rosrpc://localhost:36586]

jys gravatar image jys  ( 2012-11-19 05:20:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-11-15 21:23:45 -0500

michikarg gravatar image

updated 2012-11-15 21:24:24 -0500

Does rosservice list show the services?

Also I had some trouble with some entries in the /etc/hosts file since the entries there usually overwrite the information from the DNS/DHCP Server. If you have some entries there, you can make a backup of your /etc/hosts file and delete every entry except the following:

127.0.0.1   localhost

At least this was the cause for a similar problem in a network with non-static IP addresses....

edit flag offensive delete link more

Comments

rosservice list shows all. Fixing /etc/hosts didn't help.

jys gravatar image jys  ( 2012-11-19 14:46:26 -0500 )edit

so, it turns out that ROS register the names of hosts with the variables of the terminal in which the roslaunch/rosrun command was ran. I managed to solve it by executing export ROS_HOSTNAME=xxx.Home, where xxx is the name of the pc that was providing the service. this name (with the home suffix) was provided by the router, so no need to add it to /etc/hosts. That said, changing etc/hosts is a more permanent and possibly better solution.

fbelmonteklein gravatar image fbelmonteklein  ( 2021-02-18 10:49:15 -0500 )edit

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: 2012-11-15 15:23:04 -0500

Seen: 4,083 times

Last updated: Nov 16 '12