## 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= [[turtlebot/Tutorials/hydro/Workstation Installation|Workstation Installation]]
## descriptive title for the tutorial
## title = Network Configuration
## multi-line description to be displayed in search
## description = Get turtlebot and your workstation chatting to each other.
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link=
## next.1.link=
## what level user is this tutorial for
## level= IntermediateCategory
## keywords = turtlebot installation
####################################
<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>

ROS requires bidirectional networking between all computers attached to the network and does not have security built in. Using a VPN is recommended.

For more information see [[ROS/NetworkSetup]] and [[ROS/EnvironmentVariables]]

For this tutorial you must know the IP of the netbook on !TurtleBot (''IP_OF_TURTLEBOT'').  You will also need the IP of your personal computer/workstation (''IP_OF_WORKSTATION'').  If the hostname is properly resolved on both computers, you don't need to set this.

Ultimately you will need to configure `ROS_MASTER_URI` and `ROS_HOSTNAME` correctly with these ip addresses to ensure the ros communication channels can find each other.

== Determining IP addresses ==
=== IfConfig ===
Get the ip addresses of both your turtlebot pc and the workstation pc <<SeeSaw(section="ifconfighelp",toshow="(more help)")>>.

{{{#!wiki seesaw ifconfighelp
<<Include(turtlebot/help/ifconfig)>>
}}}
=== Confirm Connectivity ===
Ensure that you can ping between machines <<SeeSaw(section="pinghelp",toshow="(more help)")>>.

{{{#!wiki seesaw pinghelp
<<Include(turtlebot/help/ping)>><<BR>>
}}}


== Turtlebot Setup ==
The instructions differ depending on whether you have a prepared usb derived release,  from debs, or from source.
||<<SeeSaw("+usb -deb -source", "Live Usb Installation")>> ||<<SeeSaw("-usb +deb -source", "Debs Installation")>> ||<<SeeSaw("-usb -deb +source", "Source Installation")>> ||




{{{{#!wiki seesaw usb/show
=== Live USB Installation ===

{{{
> echo export ROS_HOSTNAME=IP_OF_TURTLEBOT >> ~/.bashrc
> sudo sh -c 'echo export ROS_HOSTNAME=IP_OF_TURTLEBOT >> /etc/ros/setup.sh'
}}}.

Depending on your distributor or the usb iso, you should not need to do anything. The turtlebot service will automagically detect when your network comes up and down and configure variables appropriately.
}}}}
{{{{#!wiki seesaw deb
=== Deb Installation ===

You should export the variables inside your work space setup script.

{{{
> echo export ROS_MASTER_URI=http://IP_OF_TURTLEBOT:11311 >> ~/.bashrc
> echo export ROS_HOSTNAME=IP_OF_TURTLEBOT >> ~/.bashrc
}}}
Finally, bring down turtlebot if you have already launched it and relaunch.
}}}}
{{{{#!wiki seesaw source
=== Source Installation ===

You should export the variables inside your workspace setup script.

{{{
> echo export ROS_MASTER_URI=http://IP_OF_TURTLEBOT:11311 >> ~/turtlebot/devel/setup.sh
> echo export ROS_HOSTNAME=IP_OF_TURTLEBOT >> ~/turtlebot/devel/setup.sh
}}}

Finally, bring down turtlebot if you have already launched it and relaunch.
}}}}
== Workstation Setup ==
You should export the variables inside your workspace setup script. Note that the meaning of the `ROS_MASTER_URI` changes here - the master is in the turtlebot!

{{{
> echo export ROS_MASTER_URI=http://IP_OF_TURTLEBOT:11311 >> ~/.bashrc
> echo export ROS_HOSTNAME=IP_OF_WORKSTATION >> ~/.bashrc
}}}
== Verification ==
The following section is not strictly necessary.  However, if there is a problem with the ROS networking setup between the !TurtleBot and workstation, it will be easier to identify it early.

Be sure to relaunch turtlebot if you have manually set these variables.

=== Verify from TurtleBot to ROS master ===
On !TurtleBot laptop, make sure it can contact ROS master by running:

{{{
> rostopic list
}}}
If you get the following error:

{{{
ERROR: Unable to communicate with master!
}}}
If you see this, your turtlebot has not yet been started - refer to the [[turtlebot_bringup/Tutorials/hydro/TurtleBot Bringup|TurtleBot Bringup]] tutorial.

Also make sure `ROS_MASTER_URI` is set correctly

{{{
> echo $ROS_MASTER_URI
}}}
=== Verify between ROS nodes on TurtleBot ===
In a '''new''' terminal on !TurtleBot laptop run:

{{{
> rostopic echo /diagnostics
}}}
If you don't get a response a warning like

{{{
WARNING: topic [/diagnostics] does not appear to be published yet
}}}
Check that `ROS_HOSTNAME` is set correctly on !TurtleBot laptop.

{{{
> echo $ROS_HOSTNAME
}}}
=== Verify from workstation to TurtleBot ===
Open a '''new''' command line terminal on workstation and run:

{{{
> rostopic list
}}}
If you don't see list of topics check the value of `ROS_MASTER_URI`.

On workstation run:

{{{
> rostopic echo /diagnostics
}}}
If you don't get a warning that topic has not been published, then verify that `ROS_HOSTNAME` is set correctly on the !TurtleBot laptop.

=== Verify from TurtleBot to Workstation ===
Finally, check that !TurtleBot laptop can get data from ROS node running on workstation.

On workstation run:

{{{
> rostopic pub -r10 /hello std_msgs/String "hello"
}}}
On !TurtleBot run

{{{
> rostopic echo /hello
}}}
The message "hello" begin printed about 10 times a second.  If not, check the `ROS_HOSTNAME` setting on the workstation computer.

== What Next? ==
 * [[turtlebot_bringup/Tutorials/hydro/TurtleBot Bringup|Bring-up TurtleBot]] or return to [[Robots/TurtleBot|TurtleBot main page]].

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