roslaunch for multiple machines

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

roslaunch for multiple machines

chris_li
This post was updated on .
This is my first time to use .launch file, I am trying to run some nodes on multiple machines.  I have gone through the tutorial and previous posts, but I still can not find where my mistake is.

Here is my .launch file:

<launch>

<machine name="host" address="localhost" ros-root="/opt/ros/cturtle/ros" ros-package-path="/opt/ros/cturtle/stacks" default="true" >
    <env name="ROS_IP" value="192.168.1.122" />
</machine>  %% set my localhost env variable 


<node name="GMapping_SLAM" pkg="gmapping" type="slam_gmapping" required="true" />
%%node on my host machine


<machine name="Fit" address="192.168.1.100" ros-root="/opt/ros/cturtle/ros" ros-package-path="/opt/ros/cturtle/stacks" user="***" password="***" default="never" >
    <env name="ROS_MASTER_URI" value="<a href="http://192.168.1.122:11311&quot;">http://192.168.1.122:11311" />
    <env name="ROS_IP" value="192.168.1.100" />
</machine>  %%I am using my host machine's IP instead of its name

<node name="Hokuyo" pkg="hokuyo_node" type="hokuyo_node" machine="Fit" required="true" />
%%node on the other machine

</launch>


After I roslaunch this, I got this:

... logging to /home/***/.ros/log/7626bb9e-f10e-11df-bc03-00264daa5299/roslaunch-***-toshibalaptop-3036.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://***-toshibalaptop:43812/
remote[192.168.1.100-0] starting roslaunch
remote[192.168.1.100-0]: creating ssh connection to 192.168.1.100:22, user[***]
remote[192.168.1.100-0]: ssh connection created
remote[192.168.1.100-0]: Exception while registering with roslaunch parent [http://***-toshibalaptop:43812/]: Traceback (most recent call last):
  File "/opt/ros/cturtle/ros/tools/roslaunch/src/roslaunch/server.py", line 489, in _register_with_server
    code, msg, _ = server.register(name, self.uri)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1235, in request
    self.send_content(h, request_body)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1349, in send_content
    connection.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 892, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 764, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 723, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 704, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 500, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known


[192.168.1.100-0] killing on exit
remote roslaunch failed to launch: Fit


From the error message, it seems that the name or some path information is missing.  But I did set the env ROS_MASTER_URI and ROS_IP and, I also reset ros-root and ros-package-path for the remote machine. (this seems to be the problem in previous posts about roslaunch issues).

Any suggestion is really appreciated~

Chris
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

Ken Conley
Hi Chris,

The problem appears to be with the machine you are running roslaunch
on. You need to set ROS_IP on it, as this is the default address it is
getting:

[http://***-toshibalaptop:43812/]

On an unrelated note, ros-package-path is misspelled in your machine tags.

HTH,
Ken

On Wed, Nov 17, 2010 at 9:47 AM, chris_li <[hidden email]> wrote:

>
> This is my first time to use .launch file, I am trying to run some nodes on
> multiple machines.  I have gone through the tutorial and previous posts, but
> I still can not find where my mistake is.
>
> Here is my .launch file:
>
> <launch>
>
> <machine name="host" address="localhost" ros-root="/opt/ros/cturtle/ros"
> ros-packge-path="/opt/ros/cturtle/stacks" default="true" >
>    <env name="ROS_IP" value="192.168.1.100" />
> </machine>  %% set my localhost env variable
>
>
> <node name="GMapping_SLAM" pkg="gmapping" type="slam_gmapping"
> required="true" />
> %%node on my host machine
>
>
> <machine name="Fit" address="192.168.1.100" ros-root="/opt/ros/cturtle/ros"
> ros-packge-path="/opt/ros/cturtle/stacks" user="***" password="***"
> default="never" >
>    <env name="ROS_MASTER_URI" value="http://192.168.1.122:11311" />
>    <env name="ROS_IP" value="192.168.1.100" />
> </machine>  %%I am using my host machine's IP instead of its name
>
> <node name="Hokuyo" pkg="hokuyo_node" type="hokuyo_node" machine="Fit"
> required="true" />
> %%node on the other machine
>
> </launch>
>
>
> After I roslaunch this, I got this:
>
> ... logging to
> /home/***/.ros/log/7626bb9e-f10e-11df-bc03-00264daa5299/roslaunch-***-toshibalaptop-3036.log
> Checking log directory for disk usage. This may take awhile.
> Press Ctrl-C to interrupt
> Done checking log file disk usage. Usage is <1GB.
>
> started roslaunch server http://***-toshibalaptop:43812/
> remote[192.168.1.100-0] starting roslaunch
> remote[192.168.1.100-0]: creating ssh connection to 192.168.1.100:22,
> user[***]
> remote[192.168.1.100-0]: ssh connection created
> remote[192.168.1.100-0]: Exception while registering with roslaunch parent
> [http://***-toshibalaptop:43812/]: Traceback (most recent call last):
>  File "/opt/ros/cturtle/ros/tools/roslaunch/src/roslaunch/server.py", line
> 489, in _register_with_server
>    code, msg, _ = server.register(name, self.uri)
>  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
>    return self.__send(self.__name, args)
>  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
>    verbose=self.__verbose
>  File "/usr/lib/python2.6/xmlrpclib.py", line 1235, in request
>    self.send_content(h, request_body)
>  File "/usr/lib/python2.6/xmlrpclib.py", line 1349, in send_content
>    connection.endheaders()
>  File "/usr/lib/python2.6/httplib.py", line 892, in endheaders
>    self._send_output()
>  File "/usr/lib/python2.6/httplib.py", line 764, in _send_output
>    self.send(msg)
>  File "/usr/lib/python2.6/httplib.py", line 723, in send
>    self.connect()
>  File "/usr/lib/python2.6/httplib.py", line 704, in connect
>    self.timeout)
>  File "/usr/lib/python2.6/socket.py", line 500, in create_connection
>    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
> gaierror: [Errno -2] Name or service not known
>
>
> [192.168.1.100-0] killing on exit
> remote roslaunch failed to launch: Fit
>
>
> From the error message, it seems that the name or some path information is
> missing.  But I did set the env ROS_MASTER_URI and ROS_IP and, I also reset
> ros-root and ros-package-path for the remote machine. (this seems to be the
> problem in previous posts about roslaunch issues).
>
> Any suggestion is really appreciated~
>
> Chris
>
> --
> View this message in context: http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1918649.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

chris_li
Hi Ken,

Thanks for your reply. Please check my previous post again, I correct my misspelling.

And I think I did set ROS_IP on my machine that I am running roslaunch.  The name of the machine is:
***-toshibalaptop,  its ip is 192.168.1.122        And the other machine's ip is 192.168.1.100

Please advise.

Sincerely,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

Ken Conley
Hi Chris,

Please run the following command:

python -c "import roslib.network; print roslib.network.get_address_override()"

That should report 192.168.1.122. If it reports **-toshibalaptop, it
probably won't work, unless you set that up in /etc/hosts or DNS.

cheers,
Ken

On Wed, Nov 17, 2010 at 11:45 AM, chris_li <[hidden email]> wrote:

>
> Hi Ken,
>
> Thanks for your reply. Please check my previous post again, I correct my
> misspelling.
>
> And I think I did set ROS_IP on my machine that I am running roslaunch.  The
> name of the machine is:
> ***-toshibalaptop,  its ip is 192.168.1.122        And the other machine's
> ip is 192.168.1.100
>
> Please advise.
>
> Sincerely,
> Chris
> --
> View this message in context: http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919284.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

chris_li
Hi Ken,

It reports: None

I am confused here. I thought I could either use the IP address or the name to locate the machine. I prefer IP address. I am pretty sure that the two IPs of my two machines are correct. 

Can I use the IP to set ROS_IP and ROS_MASTER_URI ??

Thanks.

Chris



On Wed, Nov 17, 2010 at 1:00 PM, Ken Conley [via ROS-Users] <[hidden email]> wrote:
Hi Chris,

Please run the following command:

python -c "import roslib.network; print roslib.network.get_address_override()"

That should report 192.168.1.122. If it reports **-toshibalaptop, it
probably won't work, unless you set that up in /etc/hosts or DNS.

cheers,
Ken

On Wed, Nov 17, 2010 at 11:45 AM, chris_li <[hidden email]> wrote:

>
> Hi Ken,
>
> Thanks for your reply. Please check my previous post again, I correct my
> misspelling.
>
> And I think I did set ROS_IP on my machine that I am running roslaunch.  The
> name of the machine is:
> ***-toshibalaptop,  its ip is 192.168.1.122        And the other machine's
> ip is 192.168.1.100
>
> Please advise.
>
> Sincerely,
> Chris
> --
> View this message in context: http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919284.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users



View message @ http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919381.html

To unsubscribe from roslaunch for multiple machines, click here.

Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

Ken Conley
Hi Chris,

 * If it reports None, then ROS_IP is not set. More specifically, I am
referring to setting ROS_IP in your shell, not the launch file itself
 * ROS_IP has no effect on ROS_MASTER_URI.

 - Ken

On Wed, Nov 17, 2010 at 12:08 PM, chris_li <[hidden email]> wrote:

>
> Hi Ken,
>
> It reports: None
>
> I am confused here. I thought I could either use the IP address or the name
> to locate the machine. I prefer IP address. I am pretty sure that the two
> IPs of my two machines are correct.
>
> Can I use the IP to set ROS_IP and ROS_MASTER_URI ??
>
> Thanks.
>
> Chris
>
>
>
> On Wed, Nov 17, 2010 at 1:00 PM, Ken Conley [via ROS-Users] <
> [hidden email]<ml-node%[hidden email]>
>> wrote:
>
>> Hi Chris,
>>
>> Please run the following command:
>>
>> python -c "import roslib.network; print
>> roslib.network.get_address_override()"
>>
>> That should report 192.168.1.122. If it reports **-toshibalaptop, it
>> probably won't work, unless you set that up in /etc/hosts or DNS.
>>
>> cheers,
>> Ken
>>
>> On Wed, Nov 17, 2010 at 11:45 AM, chris_li <[hidden email]<http://user/SendEmail.jtp?type=node&node=1919381&i=0>>
>> wrote:
>>
>> >
>> > Hi Ken,
>> >
>> > Thanks for your reply. Please check my previous post again, I correct my
>> > misspelling.
>> >
>> > And I think I did set ROS_IP on my machine that I am running roslaunch.
>>  The
>> > name of the machine is:
>> > ***-toshibalaptop,  its ip is 192.168.1.122        And the other
>> machine's
>> > ip is 192.168.1.100
>> >
>> > Please advise.
>> >
>> > Sincerely,
>> > Chris
>> > --
>> > View this message in context:
>> http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919284.html<http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919284.html?by-user=t>
>> > Sent from the ROS-Users mailing list archive at Nabble.com.
>> > _______________________________________________
>> > ros-users mailing list
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=1919381&i=1>
>> > https://code.ros.org/mailman/listinfo/ros-users
>> >
>> _______________________________________________
>> ros-users mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=1919381&i=2>
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>
>> ------------------------------
>>  View message @
>> http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919381.html
>>
>> To unsubscribe from roslaunch for multiple machines, click here<
>>
>>
>
> --
> View this message in context:
http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919429.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

chris_li
Hi Ken,

If I want to set ROS_IP in my shell, I think I can not write in my ~/.bashrc since it is ignored in roslaunch, does it mean that I have to write in my setup.sh ?

In my launch file, I have been using:

<env name="ROS_MASTER_URI" value="<a href="http://192.168.1.122:11311&quot;&gt;">http://192.168.1.122:11311"> and
<env name="ROS_IP" value="192.168.1.100 or 122">

to set ROS_IP and ROS_MASTER_URI,  but they do not seem to be recognized.

I noticed that in other posts for multiple roslaunch, people do not set ROS_MASTER_URI or ROS_IP.  Is it the right way? I am kinda lost here.
~
Chris
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

Ken Conley
Hi Chris,

1) You shouldn't need to set ROS_MASTER_URI in a roslaunch file
2) You need to set ROS_IP in your shell for the machine you run
roslaunch from. Any ROS_IP settings in your launch file are for
*remote* machines.
3) You can avoid having to use ROS_IP if you are able to just setup
your network to use hostnames properly, e.g. by adding entries to
/etc/hosts.  The reason why you don't see ROS_IP used much in other
setups is because they probably have configured their networks.

 - Ken

On Wed, Nov 17, 2010 at 1:04 PM, chris_li <[hidden email]> wrote:

>
> Hi Ken,
>
> If I want to set ROS_IP in my shell, I think I can not write in my ~/.bashrc
> since it is ignored in roslaunch, does it mean that I have to write in my
> setup.sh ?
>
> In my launch file, I have been using:
>
> <env name="ROS_MASTER_URI" value="http://192.168.1.122:11311"> and
> <env name="ROS_IP" value="192.168.1.100 or 122">
>
> to set ROS_IP and ROS_MASTER_URI,  but they do not seem to be recognized.
>
> I noticed that in other posts for multiple roslaunch, people do not set
> ROS_MASTER_URI or ROS_IP.  Is it the right way? I am kinda lost here.
> ~
> Chris
> --
> View this message in context: http://ros-users.122217.n3.nabble.com/roslaunch-for-multiple-machines-tp1918649p1919773.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: roslaunch for multiple machines

chris_li
Hi Ken,

I added entries in my /etc/hosts     It finally works!

Thanks a lot. I really appreciate it.

Chris