ROS communication with computer

Hi, we have another topic , need to ask you as following :

  1. How to setting Master ( our computer ) and Slave ( LeoRover) for they can identify each other ? Or LeoRover become as Master and our computer become as Slave
  2. How to known this setting are successful ? How to check it ?
    Thank you


We proceed as following :
ifconfig,
IP of Computer : 192.168.1.154 ( master)
IP of LeoRover RPI : 10.0.0.1 (slave)
nano . bashrc, paste export ROS_MASTER_URI …
source . bashrc

But still get trouble, master and slave can not communicate each other !!!
Thank you

I moved your question to a new topic as it was not related to the previous one. For future reference, please open a new topic whenever you want to ask a question that is not related to another topic.

It is generally controller by ROS_MASTER_URI and ROS_IP/ROS_HOSTNAME variables. You can read more about them here:
http://wiki.ros.org/ROS/EnvironmentVariables

I don’t recommend running the Master on your computer, as it will require your Rover to connect with it before starting any nodes and a simple connection loss may disturb the internal communication between nodes on Raspberry Pi. The only exception I can think of is a multi-robot environment.

On Raspberry Pi, these variables are set in /etc/ros/setup.bash file and I recommend leaving them as they are. In the default configuration, Raspberry Pi starts the roscore (ROS Master).

Assuming your computer is connected to the Leo Rover’s WiFi AP, your wireless interface should get an IP from the 10.0.0.0/24 subnet. Let’s take for example 10.0.0.80. On your computer, you should set:

export ROS_MASTER_URI=http://10.0.0.1:11311
export ROS_IP=10.0.0.80

On other network setups, this might require more configuration. The general rule is that ROS_MASTER_URI must be resolvable by your computer, The ROS_IP/ROS_HOSTNAME must be resolvable by all other computers on the ROS network. Please also check:

It’s hard to clearly answer this question. What I often do to check communication with the Master is to request a list of topics from it:

rostopic list

Then try to echo some topic to check if I can communicate with the nodes running on another computer, for example:

rostopic echo /joint_states

There is also the roswtf that sometimes help to find common network problems.


Dear Blazej Sowa,

We attached picture for your reference. Trouble was not improved : unable to communicate to MASTER .
ping 10.0.0.1 : data transmitting as picture.
We type roswtf and see on display. It may be you identified our trouble.
Please advise it.
Thank you

Hi,
How to create file : lidar.rules in directory /etc/udev/rules.d ?
Permission denied.

I may need some more information, please paste the output of these commands:

uname -a
ip address

Execute this command on the terminal on which you exported the ROS variables:

env | grep ROS

Is the master actually running on the rover? What output do you get when running:

rostopic list

on the robot?

You need root privilages to create a file in this location. You can use sudo to run a command as root. For example, to create the file in the nano text editor, type:

sudo nano /etc/udev/rules.d/lidar.rules



Please take a look to attached display . It taken from LeoRover robot output .
Thank you for your support.

OK, we followed your instruction.Done.
Thank you

Could you run these commands (except for rostopic list) on your computer?

Also, it seems that master is not running on the robot. Please show the output of these commands (on the robot):

systemctl status leo
journalctl -b -u leo --no-pager



This is output on the robot .
Yes, master not running on the robot.

Your robot.launch file is faulty as it references an empty launch file. Please remove or comment out the lines you added to the /etc/ros/robot.launch file. Then restart the service:

sudo systemctl restart leo

and check the status again.


And this is output on our computer after we run these commands.
Thank you

It seems that you are not connected to the rover’s AP, because you don’t have an IP address from 10.0.0.0/24 subnet. Please make sure to connect to it.

Then, make sure you have resolved this issue:

You also seem to use an OS on your computer that has some ROS variables preconfigured which can cause issues. Make sure to unset ROS_IPV6 and ROS_HOSTNAME variables:

unset ROS_IPV6
unset ROS_HOSTNAME

Then, set correct ROS_IP and ROS_MASTER_URI variables. Assuming you got a 10.0.0.50 IP, it should look like this:

export ROS_MASTER_URI=http://10.0.0.1:11311
export ROS_IP=10.0.0.50

If all of this is done, you can try running rostopic list or roswtf on your computer.

We set as your instruct but no successful.
Yes, it may be OS in our computer have problem because configure a lot of ROS program.
Do we need install Leo in our computer like RPI ? still use SD microcard with Leo and boot to computer .
In that case , we installed a lot of program for running another program and issue conflict to Leo.
If we install only ROS Melodic package and control Leo by remote ( without Leo in our computer) .
Please instruct again what we need install basically in our computer for control Leo robot ?

In case we don’t want to use Husarion Core 2 board anymore and use Arduno U23 , LeoRover Robot can be use , is it running ?
Again ,if replace by motor controller of ROBOTEQ model SBL-2360T , and re-programming LeoRover robot , do you think it will more simple and LeoRover running smoothly ?


We follow exactly your instruct but status not improved .
Unable to communicate with master !

You exported wrong ROS_IP variable value. It should be the address of your computer on the Rover’s network when you are connected to the LeoRover-xxxx AP. The roswtf tool even suggest you the correct address.

Also, it seems you still haven’t resolved the issue with the robot.launch file on your rover. Please remove the extra lines you added to /etc/ros/robot.launch file, then restart the service:

sudo systemctl restart leo

then. check the status again:

systemctl status leo

If the status is not active you won’t be able to connect via ROS from your computer.