0
$\begingroup$

Rosanswers logo

Hi All,

I am trying to run ROS across 2 machines, master is starting with out any issues when I tried to run listener getting below errors.

root@test:/opt/ros/indigo# rosrun rospy_tutorials listener.py
[rospack] Error: package ‘rospy_tutorials’ not found
find: ‘’: No such file or directory

I have followed below procedures.

System 1-

setting static IP-

ifconfig eth0 192.168.0.1 netmask 255.255.255.0
route add default gw 192.168.0.1 dev eth0

export ROS_IP=192.168.0.1
export ROS_HOSTNAME=192.168.0.1

roscore &

export ROS_MASTER_URI=http://192.168.0.1:11311/
rosrun rospy_tutorials listener.py

System-2

setting static IP-

ifconfig eth0 192.168.0.2 netmask 255.255.255.0
route add default gw 192.168.0.2 dev eth0

export ROS_IP=192.168.0.2
export ROS_HOSTNAME=192.168.0.2

export ROS_MASTER_URI=http://192.168.0.1:11311/
rosrun rospy_tutorials talker.py

Note: I could able to ping between system 1 & 2.

Kindly help us to debug this issue in my setup.

Kindly let me know if you need any more information,

Regards


Originally posted by Bharathraj on ROS Answers with karma: 1 on 2018-01-04

Post score: 0


Original comments

Comment by jayess on 2018-01-04:
Welcome! What's the issue here? The error message or a network problem? Being able to ping isn't sufficient. You need to make sure that you can communicate over all ports.

Comment by jayess on 2018-01-04:
Also, ROS_HOSTNAME is for host names, not IP addresses. For an IP address use ROS_IP. http://wiki.ros.org/ROS/EnvironmentVariables#ROS_IP.2BAC8-ROS_HOSTNAME

Comment by Bharathraj on 2018-01-05:
export ROS_HOSTNAME=localhost $ export ROS_MASTER_URI=http://localhost:11311

roslaunch rospy_tutorials talker_listener.launch

with the above steps, it works fine ..

As you pointed out Looks like it's a network/setup issue. Since I am new to ROS finding difficult to figure it out

Comment by Bharathraj on 2018-01-05:
after adding this to env setup it's resolved now

export ROS_PACKAGE_PATH=/home/hjt/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

Thanks for ur support,

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I doubt this is a problem that is caused by "multiple machines" being involved.

The error is:

[rospack] Error: package ‘rospy_tutorials’ not found
find: ‘’: No such file or directory

That error seems to indicate that the package rospy_tutorials is either not installed on the machine, or is not part of the workspace that is currently sourced.

Can you make sure that:

  1. the rospy_tutorials package is installed on the machine called test?
  2. the root user has sourced the appropriate setup files (note: running as root is generally not recommended)?

Originally posted by gvdhoorn with karma: 86574 on 2018-01-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Bharathraj on 2018-01-05:
export ROS_HOSTNAME=localhost

export ROS_MASTER_URI=http://localhost:11311

roslaunch rospy_tutorials talker_listener.launch

with the above steps, it works fine & that means rospy_tutorials is installed on the machines.

I am suspecting it could be related to env setup.

Comment by Bharathraj on 2018-01-05:
after adding this to env setup it's resolved now

export ROS_PACKAGE_PATH=/home/hjt/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

Thanks for ur support,

Comment by gvdhoorn on 2018-01-06:
I would recommend you source /home/hjt/catkin_ws/devel/setup.bash instead of manually setting the ROS_PACKAGE_PATH. Setting that variable manually should almost never be necessary.

Also: please consider not running nodes as root, it's rarely necessary.

Comment by gvdhoorn on 2018-01-06:
According to your comment it was essentially option 2 then in my answer that was the cause.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.