## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##FILL ME IN
####################################
## for a custom note with links:
## note =
## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links 
## note.0=[[chatter_concert/Tutorials/indigo/Chatter Concert - Distributed|Chatter Concert - Distributed]] 
## descriptive title for the tutorial
## title = Chatter Concert - Wireless
## multi-line description to be displayed in search 
## description = Wireless handling of distributed chatter concerts
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link=[[turtle_concert/Tutorials/indigo/Turtle Concert|Turtle Concert]]
## next.1.link=
## what level user is this tutorial for 
## level= AdvancedCategory
## keywords = concert tutorials rocon
####################################

<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>

== Overview ==

The [[chatter_concert/Tutorials/indigo/Chatter Concert - Distributed|previous tutorial]] distributed a chatter concert across multiple machines. Realistically though, robots have to endure greater hardships than just being distributed. They also have to suffer isolation as well. This tutorial demonstrates how to handle a wireless connectivity between machines that can be up/down.

== The Concert ==

=== Preparation ===

'''Hardware'''

 * A ''concert'' PC, and an ''inno'' laptop (we will refer to this laptop by the name ''inno'')
 * The laptop at least must be wirelessly connected to the network.

'''Network Configuration'''

The ''inno laptop'' is about to undergo forced upheavals on its wireless network interface. This means you can't run your ros master there. It has to be on ''loopback''. At the same time, you need other systems to be able to know who the laptop is, so we will use hostnames if your machines already do not.

On the ''inno laptop'', edit `/etc/hosts` so that it recognises itself as being on the loopback ip:

{{{
127.0.1.1    inno
}}}

and also export the important multimaster variable:

{{{
export ROS_HOSTNAME=inno
}}}

On the ''concert pc'' you need to edit either `/etc/hosts` or add the appropriate info to your DNS server, e.g. in `/etc/hosts`

{{{
192.168.1.3  inno
}}}

and setup your `ROS_MASTER_URI` to its own ip address, e.g.

{{{
export ROS_IP=192.168.1.2
}}}

See the [[ROS/NetworkSetup|Ros Networking]] guide if you need further understanding.

=== Concert Launch ===

On the ''concert pc'' we launch the concert, one dudette and two dudes (just as in the [[chatter_concert/Tutorials/indigo/Chatter Concert - Distributed|previous tutorial]]).

{{{
> rocon_launch chatter_concert chatter.concert --screen --no-terminals local_machine_only:=false
}}}

Fire up two more shells to start some monitoring programs (you might like to add these to a copy of the `chatter.concert` file to automatically launch with the concert:

{{{
# First monitoring shell
> remote_gateway_info --loop --loop-period=0.6
}}}

{{{
# Second monitoring shell
> concert_conductor_graph
}}}

=== Inno Laptop Dude ===

On the ''inno laptop'' we launch another dude:

{{{
> roslaunch chatter_concert dude.launch --screen local_machine_only:=false
}}}


== Wireless Handling ==

On the ''inno laptop'' click on the network manager and disable the wireless, you should see a succession of things happen:

 * The ''inno laptop'' dude complains that its interface seems down and so won't write connection statistics on the hub.
 * A little while later, the concert hub reports that the remote dude has been uncontactable for a while
 * The `remote_gateway_info` monitor reports that the gateway is no longer alive.
 * The `concert_conductor_graph` reports that the client has moved to the 'missing' state.

Re-enabling the wireless network will see those events reversed.

## AUTOGENERATED DO NOT DELETE 
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE