Guideline for Running Dialogue Scripts from a Remote Laptop

  • ssh into the turtlebot from the terminal window of a remote laptop (this needs to be done in every terminal window you use for the turtlebot, except for rviz)
     ssh turtle@<TURTLEBOTP_IP>
  • Need to export display when running a script that runs several scripts at once,
    export DISPLAY=:0
    or (prefer the second one)
    export DISPLAY=:0.0
  • Launch rviz separately in a terminal that is not ssh(ed) into the turtlebot
    • For navigation scripts, make sure to give the turtlebot the initial position using rviz(because most of the times, the turtlebot’s initial position is a little off which causes errors in the navigation part of the script)
       roslaunch turtlebot_rviz_launchers view_navigation.launch –screen
  • As you can see in run_2nd_dialog.py or run_delivery_guide_script.py:
    • you need to kill all previously running terminals and any remaining nodes before launching new scripts (to make sure the new scripts run properly and there is no confusion)
      subprocess.call([‘killall’, ‘-9’, ‘gnome-terminal’])
      subprocess.call([‘killall’, ‘-9’, ‘rosmaster’])
    • need time.sleep(int) method to give the first two commands some time to properly kill all the previously running terminals (need to import time to use this method)
    • need time.sleep(int) methods to give the turtlebot some time to launch
  • Always make sure (on Intel Nuc) that the sound input setting is set to kinect microphone and not the default microphone
  • roscore and turtlebot_bringup minimal.launch should not be running at once
    • if roscore is not needed if the turtlebot is launched
    • running both at once may cause errors (turtlebot may not launch properly)
  • Autonomous navigation will not work if the teleop command is running

Example of a script that runs all necessary scripts/commands/softwares:

 #!/bin/bash

import subprocess
import time

#kill all terminals and running nodes
subprocess.call([‘killall’, ‘-9’, ‘gnome-terminal’])
subprocess.call([‘killall’, ‘-9’, ‘rosmaster’])

#wait for everything to be killed properly
time.sleep(3)

#launch the turtlebot
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’, ‘roslaunch turtlebot_bringup minimal.launch’])

#wait for the turtlebot to be fully launched
time.sleep(1)

#launch soundplay
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’,’rosrun sound_play soundplay_node.py’])

#may be good to make sure soundplay runs properly before launching the dialogue script
time.sleep(1)

#launch the saved map of the environment (if applicable)
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’,’roslaunch turtlebot_navigation amcl_demo.launch map_file:=/home/turtlebot/savedmaps/stations.yaml’])

#call the dialogue script
subprocess.call([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’, ‘cd /opt/ros/indigo/share/pocketsphinx/demo/Ourstuff; python FinalDeliveryAndGuide.py’])

shut down command from the terminal: sudo shutdown -h now