Skip to content

Latest commit

 

History

History
117 lines (88 loc) · 11.4 KB

4-tutorials.md

File metadata and controls

117 lines (88 loc) · 11.4 KB
layout title permalink author show_menu
page
Tutorials
/tutorials
MK
true

<style> .ads:hover{ opacity:0.8; } </style> ## Robotic System Integration | Summer Course 2022 _Designed and delivered by Eyad Shakab, Arjun Sharma, and Dr. Majid Khonji_ [July 13 - July 22]

This high-level course teaches the basics of system integration using Linux OS and Robot Operating System (ROS). The objective is to build technical maturity and problem-solving skills to deal with diverse software efficiently and in a timely manner to get the task done. The course targets audiences from computer science (CS) backgrounds as well as those from other engineering disciplines as long as they are curious to learn beyond the instructions provided. For CS majors, the course will be more like a revision of basics but at the same time integrates different approaches that the student might not have been exposed to together.

Day 1-2: Linux Basics

By Eyad Shaklab

Task:

Day 3: Cloud Computing Basics

Designed by Majid Khonji, Supervised By Eyad Shaklab

Pre-requisites:

Parts:

Day 4-7: Robot Operating System

By Arjun Sharma

Day 7-8: Cloud Robotics

Designed by Majid Khonji, Supervised by Arjun Sharma

The objective here is to learn how to integrate one or more robots with a custom cloud server so that you can achieve some collaborative functionalities. We will try to perform those tasks using standard Linux tools avoiding fancy custom-made software as much as possible. The goal is to build a level of technical maturity at a system level that is generic enough to be applicable across domains. The knowledge you gain in this section will be highly transferrable to other domains outside robotics. It is important to highlight that the tutorial given here is by no mean the most efficient way to develop a production-ready REST API.

Day 7 (21/7/2022):

Pre-requisites:

  • Basics of networking (ports and ips). If you are not familiar about the topic, watch this 10 min video{:target="_blank"} before you proceed
  • Understanding of HTTP protocol{:target="_blank"} (a simple text based application protocol, running on top of TCP ). Here is an 8 min video tutorial{:target="_blank"}
  • Domain Name System (DNS), an application layer protocol. Here is short video tutorial{:target="_blank"}
  • A working installation of Apache web server on your AWS instance from Day 3

Parts: Understanding Web API

Day 8: Mini-project (22/7/2022)

Pre-requisites:

Parts:

Project: RESTful Robot - A Remote Tracking System

Deadline: 29/7/2022

The objective of this exercise is to build a small system that tracks your robots in the cloud. Due to limited time, we will build a simplified system using Turtlebot simulation, but the concept can scale and be applied to any robotic platform. Remember, a robot is simply a computer with sensors and actuators, so you might have a microcontroller (Arduino) connected to a temperature sensor, servo motor, and connected to a PC via a serial connection, USB. That is a legit robot. Increase the number of motors to four, connect a LiDAR and a webcam to the PC, and you get a car capable of autonomous driving. In this project, we have two parts:

  • Cloud server: which collects telemetry information from one or more robots
  • Robot(s): which runs on your laptop. You will write a ROS node that sends POST requests to the server every second to update its location. In this project, you will run a simulated robot, but in principle, the same exact code would run on real robots.

More precisely, you should perform the following tasks:

  • Run a Turtlesim simulation. Execute turtlesim_node and turtle_teleop_key (but you may try more sophisticated simulations as well).
  • Remote server connection: Write a ROS node that reads the x and y coordinates of the robot and sends HTTP POST requests to your cloud. Please use three variables in your code to allow easy configuration, robot_name, server_address, and api_delay where api_delay decides how much delay between subsequent API calls; set it to 1 sec.
  • RESTful API: your cloud server should follow the structure below
    • POST: accept a request following <server_address>/robot_name/x/y, where <robot_name> is the name that you chose in the ROS node, and x and y are Turtle coordinates. You may implement a python code (or bash script or any language you like) that receives the query from CGI module and append the received coordinates to a file named <robot_name>_loc.csv. You can choose any format for the file, but I suggest something like yyyy-mm-dd hh:mm:ss, x, x for each line.
    • GET: <server_address>/<robot_name> returns a simple HTML that shows a PNG plot for robot location. You may implement it in python and use matplotlib to output a PNG plot. You may need plt.plot and plt.savefig(<robot_name>.png)
  • Test your code with 2-3 of your colleagues and check if your RESTful API is functional
  • Optional:

Submission Instruction:

  • Send an Email to eyad.shaklab at ku.ac.ae and arjun.sharma at ku.ac.ae, and CC majid.khonji at ku.ac.ae, titled:
    • [AV-lab mini-project]: <first_name>_<last_name>
  • In the email, provide the following:
    • Your <server_address>. Make sure the server will be running for at least 1 week after your submission, if your server is free. if not, then please indicate in the email that the server is off. Our engineer will contact you to switch on the server.
    • Implemented APIs: indicate which APIs are implemented
    • Attach your ROS node, named <first_name>_<last_name>.py (if implemented in python)
      • For computer science folks, you may send your git repo address. For those who are not familiar with git, you may watch this tutorial and decide by yourself.


Useful Hacks:

  • Linux within Windows: If you suffer from slow performance of virtual machine, or you don't want to run dual boot system (as you keep going back and forth), you may try Windows Subsystem for Linux (WSL), you can run linux commands within Windows OS, much faster than in virtual machine. Here is a short tutorial to get started with WSL.
  • Text editor: you may use 'gedit' to edit files, which is a friendly user interface, but you need a graphical interface running, something that is not always affordable (say you are ssh a remote server). For power users, there is a better alternative that boosts your productivity ten folds beyond any graphical tool. Try vim, a text editor that comes with a learning curve. But it will pay off. Here is a short tutorial.
  • Terminal multiplexer : Suppose you log in to your remote cloud server with your laptop and run a command on the server. Then, suppose you lose internet connection, or the battery dies, or say you decide to switch off the laptop and continue working from home. What happens is that once you lose your ssh connection, your terminal dies with it, and all running processes forked from the terminal will get terminated. Therefore, you need some approach to keep commands running in the background, even if you get disconnected, and then attach to the left terminals. The solution is terminal multiplixer, an interesting software that allows you to resolve the disconnection issue plus more. You can even split your terminal into multiple zones, saving you from opening several terminals. Here is a video tutorial. Run sudo apt install tmux and try it.
  • Tiling Window Manager: Linux has a flexible architecture, allowing users to customize practically everything. An important part of any operating system distribution is window manager, a piece of software that organizes window placements. The default window manager for Ubuntu is Gnome (as of 2022). You may customize it as you wish. I personally recommend a different kind of window manager, called tiling window manager. This class of window managers automatically controls window placements into tiles, with minimal user involvement, clicks, and muscle movements. Once you get used to shortcuts, your productivity improves another ten fold (after using vim). Try i3 window manager! Here is a video tutorial to get started.
  • A more friendly shell: Shell is a kind of user interface that is based on text only, with no graphics. The default ubuntu shell is called Bash. Similar to graphical interface (e.g., ubuntu, fedoraI), it is a matter of personal taste. personally like fish, or a friendly interactive shell. It comes with a nice auto-complete and a dozen shortcuts (similar to that of ipython if you used it). Here is a short tutorial. Warning: you cannot run all standard bash commands out of the box. For example, you can't load (or source) bash configuration files. To source any bash config (such as ROS environment setup), you need a fish plugin called bass. Clone the GitHub repo and test it yourself.