Cloud Derby​ Hackathon This Project Is Designed to Help You Learn Google Cloud Platform (GCP) in a Fun Way

Cloud Derby​ Hackathon This Project Is Designed to Help You Learn Google Cloud Platform (GCP) in a Fun Way

Cloud Derby​ Hackathon This project is designed to help you learn Google Cloud Platform (GCP) in a fun way. Your objective is to build a self driving robot that plays a ball game against other robots. We provide all the instructions to build hardware and software, but you are free to experiment, add, or change anything you like. You will be learning and using various Google Cloud services: ● IoT Core ● App Engine (GAE) ● Dialog Flow ● Pub/Sub ● Cloud Functions (GCF) ● Security (IAM) ● Cloud Storage (GCS) ● TensorFlow ● Cloud Networking ● Compute Engine (GCE) ● Machine Learning (ML) ● Cloud SDK See source code, list of the parts and rules of the game here: https://www.cloudderby.io. ​ ​ Here are the high-level steps that you will complete to install and run the game. Each of these is described in the next section. 1. Complete the initial Project Setup. ​ ​ 2. Take and Prepare Images for ML Training. ​ ​ 3. Deploy and start Object Detection Module on the cloud. ​ ​ 4. Deploy and start the Driving Controller Module on the cloud. ​ ​ 5. Provision and start GoPiGo Car software on the car. ​ ​ 6. Go to the Driving Controller Web App and start the game. ​ ​ 7. Build Dialogflow agent to control the car with your voice. ​ ​ For those who are interested in hosting Cloud Derby event, the list of materials and preparation steps for the event can be found on this site. ​ ​ Overview There are two subsystems in this game: (1) your robot car, and (2) Google Cloud Platform. Software running on the cloud controls the movement of your car. In order to do it, several interconnected modules work together and interact with the software running on the car via PubSub and IoT Core. We use Dexter GoPiGo cars for this game ​ ​ with wide angle camera and distance sensor. Please see the logical architecture below. ● Driving controller (Navigation Logic) ​ This component is responsible for consuming sensor information from the car and making driving decisions based on that data. It uses ML and other logic to make driving decisions in manual or automatic mode and send commands back to the car. ● Object Detection (Machine Learning APIs) ​ This component is responsible for processing images and detecting locations of colored balls using cloudderby.io 1 TensorFlow Object Detection API customized with the transferred learning to be tailored to colored balls. ● GoPiGo (Car) ​ Software on the car runs inside of the Raspberry Pi and uses Google Cloud IoT Core to communicate to the Cloud Derby modules running on GCP. The car takes pictures and laser distance measurements and sends those to the cloud for processing. Cloud components will process this input and make decisions on the car movements and send it back to the car. The car software accepts those messages and makes turns and drives based on those commands from the cloud side logic. During the building and training sections of the event, you will also use a Development environment ● Sensor simulator Sensor Simulator Module generates a hard coded set of signals faking real sensor information and sends it via PubSub to the cloud. This is useful for development and debugging and is not used for the game itself. ● Driving simulator Driving Simulator Module pulls commands from the Cloud and prints to the console. This is useful for development and debugging and is not used for the game. Conventions This event can be run in two different flavors: as an 8 hours event and a 4 hours event. In this manual we are using a convention to highlight what steps to do for each of these two kinds of events. No designation for the step means that the step needs to be done for both 8 and 4 hours events. In cases when you see the following: cloudderby.io 2 - perform this step only if you are doing the 8 hours version of the derby. ​ ​ ​ - perform this step only if you are doing the 4 hours version of the derby. ​ ​ We recommend that you copy & paste the commands to execute them in command line. If you type a command or its options incorrectly you may get all kinds of errors, including “permission denied” etc. because the project ID or other resource does not exist. Commands that you need to type on the command line are shown like this: cat code.py At times you’ll see a box with a Google beanie. This box contains interesting information or deeper level geek stuff that isn’t necessary to do to complete the lab. Feel free to explore or ignore. Let’s get started! cloudderby.io 3 Project Creation and Setup (15 mins) Each team member should follow all of the steps in this tutorial independently in their own project. However, be aware that only one car is provided for the team and you will select one of your team’s GCP projects to be used ​ ​ to control the car at the end of the day during the competition. In order to deploy and run Cloud Derby game you need to set up a project to develop and deploy your code. The following steps will help you to set up the development environment. Setting up your GCP environment Pick up your user account card from the instructor if you are in the Google organized event. If you are doing this project on your own, feel free to use your own GCP account. In a Chrome window, login to GCP Console http://console.cloud.google.com with the credentials provided to you ​ ​ by the instructor (for example: [email protected]). ​ ​ If you are an instructor hosting Cloud Derby event, you can generate GCP user accounts using create-hackathon.sh script provided you are 1) Google Admin Superuser and 2) GCP Org Admin. ​ Create a new project In the Google Cloud Console GUI​, select the three bar menu​ at the right of the top menu bar and choose ​ ​ the sub-menu option IAM & admin > Manage Resources​: ​ ​ cloudderby.io 4 You may need to select proper organization cloudderby.io​ in the drop down menu: ​ Note that if you are not doing this project as part of the Google organized event and are working with your own ​ ​ organization (acme.com, etc.), you need to select your own organization and come up with your own folder structure. It does not have to match instructions below for names of folders. Click CREATE PROJECT​ in the top sub-menu: ​ cloudderby.io 5 On the New Project page, enter a unique Project name that will be easy for the team to recognize and remember (for example: team15-dish-derby​). ​ Ensure that cloudderby.io​ is listed as the Organization. ​ Under Location​ click on the Browse​ button as you’ll need to select the folder that matches your team number ​ ​ ​ under the folder <TODAYs_DATE-CITY>​ (this folder is different for each event - just pick the proper date and city ​ ​ ​ location for your event). This will create a project under your team’s specific folder. NOTE: Your user ID only has permission to create a project in your Team’s folder. All other folders will have warning signs indicating that you don’t have permission to create projects in them. Folders allow companies to map their organization onto GCP and provides logical attach points for access management policies and Organization policies. Organizations can use folders to group projects under the organization node in a hierarchy. For example, your organization might contain multiple departments, each with its own set of GCP resources. Folders allow you to group these resources on a per-department basis. To select the location, expand the cloudderby.io​ org node. ​ cloudderby.io 6 Expand the <event-date>-<location>​ folder. ​ ​ ​ Click on the team folder provided to you by the instructors (for example Team-1-resources​). ​ Take note of your “Project ID” to the right of the project name. This ID will be used for subsequent steps. ​ ​ Then click Create​ to create a project: ​ Project IDs are globally unique identifiers for GCP projects and are the actual identifiers that GCP resources use. If your project name is unique enough, the ID will be the same as the name. In normal practice, we recommend that you name your project starting with your company name (c​ loudderby-myproject-dev) to ​ help ensure uniqueness. To go back to the home screen, click on the three-bar menu and select Home​. Ensure that your project is selected ​ in the pulldown menu. Clone GitHub repository with Cloud Derby source code We’ll be using Google Cloud Shell to execute our commands. Cloud Shell is an ephemeral Linux VM environment with persistent HOME directory for your user that automatically gets created. It includes GCP-specific tools such as the gcloud command line, as well as git and other open source tools. ​ ​ ​ ​ cloudderby.io 7 Click the Activate Google Cloud Shell​ button at the top of the console window. A Cloud Shell session will open ​ inside a new frame at the bottom of the console and displays a command-line prompt: To make things easier to see, you can also expand the Cloud Shell window to full size by clicking on the Open in New Window​ button. In this project we will be using the Cloud Derby source code on Github. Clone the source code into your Cloud Shell environment from GitHub onto your $HOME​ directory by executing this command in Cloud Shell. ​ cd $HOME ​ git clone https://github.com/GoogleCloudPlatform/cloud-derby.git Cloud Shell provides an integrated code editor that we will be using for development purposes. To open the editor, click on the pencil icon: We suggest that you use this editor for making changes to any file used later in this workshop.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    65 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us