Apply on Real Turtlebot

So far we have done everything on the PC but how to use a real robot and apply all the knowledge on it?

Theme (Lab5)

  1. Turtlebot tutorials

  2. ROS

  3. Turtlebot

  4. SLAM

  5. Navigation

Equipment (Lab5)

  1. PC with ROS installed

  2. OPTIONAL: A real turtlebot

  3. Turtelbot tutorials from robotis.com

Before the lab (Lab5)

  1. Do the previous lab.

  2. Try to get together in a group of 2-4 people.

  3. To use a real turtlebot, find your way to the HVL Robotics lab.

Report (Lab5)

There is no need to hand in a report after this lab.

Signed attendance will suffice as approved lab exercise.

Tasks (Lab5)

  1. SLAM

  2. Navigation

Warning

Batteries are dangerous.

Setting up the Virtual Machine Network

In order to communicate with your Turtlebot in real world, you need to do some network settings. In the official Turtlebot tutorials, the procedure is well explained. However, for those who are using virtual machine, the process might look different. This section is a tailored version for our use case.

VM settings

  1. Select your virtual appliance on the left bar

  2. Click Edit virtual machine settings

  3. Select Network Adapter

  4. Select the first option Bridged: Connected directly to the physical network also check the Replicate physical network connection state

  5. Go to Configure Adapters and ONLY select the wireless adapter which your PC has. In our case it is “Killer(R) Wi-Fi 6 AX1650 160MHz Wireless Network Adapter”

  6. Save everything and start your virtual machine.

    ../_images/vm_bridge_settings.png

Connect to internet

  1. Make sure that you and your Turtlebot are connected to the same network.

  2. Check if they are: ping TURTLEBOT_IP

Note

It is better to set a static IP address in order not to change ROS_MASTER_URI settings after every restart. Go to your network settings in your virtual machine and set it to Manual from DHCP.

IP adress: 172.31.1.XXX where XXX is any number between 0-255 (excluding 0,1,131,132,133,134,135) Netmask: 255.255.255.0 Gateway and DNS empty

Check if your host machine and the guest machine in the same domain:

  • Windows host: Go to search bar at the bottom. Type ipconfig. Look at your wireless IPv4 IP number.

  • Linux host: Open a terminal and type ifconfig. Look at yout wlo section and look at your inet and netmask.

  • Mac host: Open a terminal and type /sbin/ifconfig

Afterwards, go to your virtual machine and open a terminal, type ifconfig. Look at yout wlo section and look at your inet and netmask. If the first 3 numbers of X.X.X.X are the same (172.31.1.xxx) then you are good.

../_images/ifconfig.png
../_images/ipconfig.png

Set Your Virtual Machine (Master)

  1. Open a terminal

  2. Type ifconfig and write down your IP address down somewhere.

  3. Type gedit ~/.bashrc

  4. Add at the end export ROS_IP=YOUR_IP_ADDRESS

  5. Save and exit

  6. Close the terminal and use a new one when your need.

Set Your Turtlebot (Slave)

  1. Open a terminal

  2. Type ssh pi@TURTLEBOT_IP

  3. Password: turtlebot

  4. Make sure the green text on the terminal is not rosuser@rosuser-VirtualBox but it is pi@raspberrypi. Then type nano ~/.bashrc

  5. Find export ROS_MASTER_URI

  6. Change it with your IP address.

  7. Hit Ctrl+X to exit editor mode in Nano.

  8. Hit ‘Y’ to save.

SLAM

Follow the SLAM tutorial to do some SLAM’in.

Remember roslaunch turtlebot3_gazebo turtlebot3_world.launch from the previous lab?

Navigation

See navigation tutorial.

Questions

  1. What is SLAM? What hardware is used for this?

  2. Did you use a real robot?

  3. Which flavour of OS and ROS did you use?

  4. What is a key difference between RViz and Gazebo?

  5. Did you remember to have fun?