Mini Turty II Robot Getting Started V1.0
Rhoeby Dynamics Mini Turty II Robot Getting Started Getting Started with Mini Turty II Robot Thank you for your purchase, and welcome to Rhoeby Dynamics products! This document provides a quick overview of the steps required to run ROS Navigation on the Mini Turty II platform.
Pre-requisites To proceed, you will need the following items: A ROS enabled PC (for robot setup, and running the ROS application RViz) An HDMI monitor and USB keyboard (for robot setup) Your ROS navigation-capable Mini Turty II robot! With the above to hand, proceed to the Quick-Start Instructions to get up and running now. Quick-Start Instructions 1. Plug in the following items to the robot: HDMI monitor (to Raspberry Pi 3) USB keyboard (to Raspberry Pi 3) 2. Switch on the Mini Turty II, using the switch on the side of the robot 3. Wait for Linux to boot and the login prompt to appear on the HDMI monitor 4. Login with the following: - user name: ubuntu - password: rhoeby001 5. Add your WiFi network credentials $ sudo vi /etc/network/interfaces Modify these lines to match your network: iface wlan0 inet dhcp wpa-ssid "Your Network SSID" wpa-psk "Your Password" Note: retain the quotes (""), eg if your WiFI network is called NETGEAR101, and your password is mypassword, the file entries would look like this: iface wlan0 inet dhcp wpa-ssid "NETGEAR101" wpa-psk "mypassword"
6. Reboot the robot $ sudo reboot 7. On the ROS-enabled PC, 'ssh' into the robot (default robot name is: ubuntu): $ ssh -l ubuntu ubuntu (Alternatively, in Windows, you could use PuTTY) 8. At the prompt, verify you can see the easy start scripts called: 'mini_turty_init.sh', 'min_turty_mapping.sh' and 'mini_turty_nav.sh' $ ls catkin_ws robot tmp mini_turty_init.sh mini_turty_mapping.sh mini_turty_nav.sh 9. Unplug HDMI, keyboard. Your robot is ready for action! Things You Can Do With Your Mini Turty II Robot There are many things you can do with your Mini-Turty II robot, including: Basic ROS Learning Teleop: robot remote control Map Building: make maps of your home or office for the robot to use Navigation: the robot moves autonomously around your home or office Frontier Exploration: the robot autonomously explores unknown terrain* Tele-Viewing: see what your robot sees, even from another room* Computer Vision: Mini Turty II recognizes objects in its environment* *Coming soon, to a robot near you! In the sections below, we explore each of these features in more detail.
Basic ROS Learning Learn the basics of ROS including things like running ROS nodes, working with topics, using rosrun and roslaunch, etc. See and interact with working examples of things like publisher and subscriber, record and playback of data (eg LiDAR data). Follow instructions for running ROS across multiple machines, and much more. Explore such topics as robot coordinate frames, like using the view_frames tool to graphically examine the robot tf frames. Graphical output helps simplify your view of the robot internal structure. Teleop Mini-Turty II supports tele-operation (remote control of the robot) via several methods, including: PC keyboard control (via SSH terminal, eg PuTTY*, or Linux minicom ) Phone-based control (install Play Store app Map Nav ) ROS control via cmd_vel topic * PuTTY is a simple terminal program you can run on any Windows PC, see http://putty.org All of the above methods control the robot via the built-in WiFi connection.
Using PuTTY for Teleop Using PuTTY is easy. Simply download the program from http://putty.org and follow the instructions for installation. Then enter the IP address of your robot and use SSH to connect to it. Log in using the Mini-Turty II username and password (default: ubuntu, pasword: rhoeby001), and begin using your robot!
Using Phone-Based Control You can remotely control Mini-Turty II using a phone-based application called Map Nav, which is available in the Play Store. Download and install the app, specify the IP address of the robot and begin driving your robot around using the virtual joystick control! With nothing more than the phone app itself (and a properly setup robot), you can be controlling your robot quickly. Using ROS Control Via the cmd_vel Topic Mini-Turty II subscribes to the ROS cmd_vel topic. As such you can remote control the robot by issuing commands using that topic. The following command tells the robot to move forward at 0.2 m/s: rostopic pub -1 /cmd_vel geometry_msgs/twist '[0.2, 0, 0]' '[0, 0, 0]' You can stop the robot by issuing this command: rostopic pub -1 /cmd_vel geometry_msgs/twist '[0, 0, 0]' '[0, 0, 0]' The first argument 0.2 is linear motion on the x-axis. The next two are the y-axis and z-axis respectively. The robot can only move in the x-axis because it is a differential drive robot. However, it does support angular motion in the z-axis! So you turn the robot by applying some z-axis angular motion, for example:
rostopic pub -1 /cmd_vel geometry_msgs/twist '[0, 0, 0]' '[0, 0, 0.1]' The above command will cause the robot to rotate on the spot! Of course you can combine motions to provide linear and angular motion at the same time, like this: rostopic pub -1 /cmd_vel geometry_msgs/twist '[0.1, 0, 0]' '[0, 0, 0.05]' The above command will cause the robot to move forward whilst simultaneously turning. Map Building The map building aspect is an exciting function of your new robot! It provides the means to make maps of your home or office for the robot to use. This can be both an interesting learning experience, and very useful to your robot in support of its more advanced features. Mapping: is the process of building maps based on data acquired from one or more sensors. A LiDAR sweep of the 360 degrees view and the taking of many range samples yields a crude map. But this map is usually far from complete. The second part of the process is to take many of these 360 degree scans and assemble them into a more complete map. As the robot begins to move around in it s environment, it is able to estimate where is it relative to the current and previously scanned data (the
process known as localization ), and then take new scans and add them into the map. The process of performing localization and mapping together is referred to as Simultaneous Localization And Mapping, or just simply SLAM! Using your robot, run mapping techniques such as: gmapping hector mapping karto mapping Save the map(s) for later use by the robot during navigation. Starting Mapping 1. At the ssh prompt, initialize the robot: $./mini_turty_init 2. Wait for initialization to complete, then initiate mapping $./mini_turty_mapping 3. On the ROS-enabled PC, setup your connection to the robot, by following these instructions: http://wiki.ros.org/ros/networksetup and http://wiki.ros.org/ros/tutorials/multiplemachines Basically... Set hostname (default is: ubuntu) $ sudo vi /etc/hostname $ sudo vi /etc/hosts 127.0.1.1 ubuntu Add remote machine (where RViz will run) $ sudo vi /etc/hosts (on the Mini Turty II robot) 192.168.0.51 vm-ubuntu $ sudo vi /etc/hosts (on the remote PC machine) 192.168.0.27 ubuntu
The above IP addresses and host names are just examples, replace these with your own addresses. 4. Set environment variable (on remote machine): $ export ROS_MASTER_URI=http://ubuntu:11311' 5. Run RViz (on the remote machine) $ rosrun rviz rviz 6. In RViz display topic 'laser_data', you should now see the scanner output on screen (you may need to set the Fixed Frame appropriately) 7. In RViz display the topic '/map', you should now see a partial map being built 8. In the ssh session (where you ran./mini_turty_mapping.sh, tele-operate the robot using the keyboard arrow keys. 9. Observe the map being built up 10. When enough map has been created, save the map using the following command (in a new ssh session): $ rosrun map_server map_saver Voila! Your map is saved!
Navigation Autonomous navigation includes use of the generated map, path planning, obstacle detection and obstacle avoidance. Navigation is comprised of path planning to reach a goal within a map, along with detection of new obstacles that are not part of the map. This is where the preceding elements of LiDAR, scanning, and mapping are all brought together into a functioning system. During navigation, the software provides real-time updates to the proposed path to keep the robot within the mapped area, whilst avoiding any new obstacles. In the picture below, we see a navigation goal being set. The user clicks a location on the map where they would like to robot to go, and the navigation software displays a large green arrow to show this goal.
In addition to showing the goal, the picture above also shows: the mapped data: the black areas the scan data from the LiDAR: the white dots the robots current position: the red circle obstacle inflation: the turquoise/purple areas In deriving a path to the goal, the robot must allow a safe distance around all obstacles. To this end, the purpose of obstacle inflation is to make obstacles appear larger than they are, and with a safety margin, to help ensure the robot does not collide with them. So the turquoise areas are areas the robot should avoid: they are the danger spots where collision could occur. During path planning, the robot footprint (in red) should not be made to overlap significantly with those inflated areas. As the robot navigates towards a goal, it maintains an area around itself where it performs obstacle inflation, and seeks to keep its path outside of those areas.
Running navigation Running navigation is simple with your Mini-Turty II robot. 1. To run the navigation suite, first close any previous mapping session (press 'q', followed by Ctrl-C), then execute the following: $./mini_turty_nav.sh Note: you may need to modify the path to the new map, as specified in mini_turty_nav.sh, see the line: 'roslaunch scanner2d amcl_rd_demo.launch map_file:=/home/ubuntu/robot/maps/map.yaml' Just do vi mini_turty_nav.sh and make your changes, if necessary depending on where you have your saved map. Frontier Exploration Frontier Exploration is one of the newest and coolest features of our robots. This functionality is what enables the robot to autonomously enter previously unexplored areas, and without any human intervention travel around to fully explore its environment whilst building a map for later use. Set Mini-Turty II free to explore the great unknown! Tele-Viewing Tele-Viewing allows users to see what the robots sees, even from another room! Using the on-robot camera with teleop, users can remotely operate the robot and monitor what s in the robot field of view.
Computer Vision Using OpenCV, run the Find Cat app to enable Mini-Turty II to search the mapped area for the presence of a cat! With this function the robot searches the entire mapped area and when it finds a cat it moves towards it and highlights the cat face with a bright magenta circle on the tele-viewed video image! This is a super-fun application that provides many opportunities to learn about the exciting field of computer vision. The app could be adapted to detect dogs, people and even many household objects. For further assistance, visit www.rhoeby.com, or send email to 'support@rhoeby.com'. Enjoy your new robot!