== TurtleBot Networking Setup == <> 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. == Determining IP address == <> === Confirm Connectivity === Ping from the laptop to the workstation and back by IP, or fully resolved hostname. From !TurtleBot laptop ping workstation/desktop using ''IP_OF_WORKSTATION'' {{{ ping IP_OF_WORKSTATION }}} '''Note:''' Replace ''IP_OF_TURTLEBOT'' with actual IP address of !TurtleBot that was determined in previous step. From workstation ping !TurtleBot using ''IP_OF_TURTLEBOT'' {{{ ping IP_OF_TURTLEBOT }}} == TurtleBot Setup == === ROS_MASTER_URI === On !TurtleBot Laptop set ROS_MASTER_URI: {{{ echo export ROS_MASTER_URI=http://IP_OF_TURTLEBOT:11311 >> ~/.bashrc }}} '''Note:''' Replace ''IP_OF_TURTLEBOT'' with actual IP address of !TurtleBot that was determined in previous step. === ROS_HOSTNAME === On the '''!TurtleBot''' laptop set ROS_HOSTNAME to IP address of laptop. {{{ echo export ROS_HOSTNAME=IP_OF_TURTLEBOT >> ~/.bashrc }}} == Workstation Setup == === ROS_MASTER_URI === The ROS master runs on the !TurtleBot laptop, so on workstation set ROS_MASTER_URI to point to !TurtleBot laptop: {{{ echo export ROS_MASTER_URI=http://IP_OF_TURTLEBOT:11311 >> ~/.bashrc }}} === ROS_HOSTNAME === On workstation set ROS_HOSTNAME to match IP address of workstation. {{{ echo export ROS_HOSTNAME=IP_OF_WORKSTATION >> ~/.bashrc }}} == Verify ROS connectivity == 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. === Restart turtlebot service === After changing ROS_MASTER_URI and ROS_HOSTNAME on laptop, restart ''turtlebot'' server so it will use new settings. Open '''new''' command line terminal on !TurtleBot laptop and run: {{{ sudo service turtlebot stop sudo service turtlebot start }}} === Verify connectivity 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! }}} Check that the turtlebot service is started {{{ sudo service turtlebot start }}} Also make sure ROS_MASTER_URI is set correctly {{{ echo $ROS_MASTER_URI }}} === Verify connectivity between ROS nodes on TurtleBot laptop === In '''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 connectivity from workstation to ROS master === Open '''new''' command line terminal on workstation and run: {{{ rostopic list }}} If you don't see list of topics check value of ROS_MASTER_URI. === Verify connectivity from workstation to TurtleBot laptop === 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 !TurtleBot laptop. === Verify connectivity from TurtleBot laptop 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 laptop 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. == Troubleshooting == === VPN === For convenience and security it is often recommended to setup up a VPN to which both your robot and workstation can connect. If you do so, set the ROS_HOSTNAME to be the address on the VPN. Once you have setup the VPN you can set the turtlebot service to use it by following the instructions for an alternate network interface. === Alternate Network Interface === ||<#FFFF00> Check - this may not be functional for groovy || If you are using a different network adapter besides wlan0 (the default wireless), such as the ethernet port or a USB dongle, expand the instructions below, regardless of whether you are using a VPN service. <> {{{{#!wiki seesaw section Do the following {{{ roscd turtlebot_bringup/upstart sudo install.sh tun0 }}} If you get an error that looks like: {{{ sudo: install.sh: command not found }}} try typing: {{{ sudo ./install.bash tun0 }}} If you are using openvpn, the device is setup as tun0. If you are using a wireless dongle or ethernet device identify the network interface you want to use and replace tun0 with it. Other common alternatives would be wlan1 and eth0. }}}} == What Next? == * [[turtlebot_bringup/Tutorials/TurtleBot Bringup | Bring-up TurtleBot]] or return to [[Robots/TurtleBot | TurtleBot main page]].