11 Building a snack-pushing robot

 

This chapter covers

  • Reading a list of QR codes and icons from a CSV file
  • Locating and pushing selected objects
  • Creating a user interface for video streaming and snack selection
  • Building a snack-pushing robot

This chapter aims to build a snack-pushing robot that can be controlled by a web-based Python application. The chapter starts by reading a list of snacks from a CSV file. Each snack will have a QR code and icon assigned. The QR code will be used to help the robot find the snack. The snack icon will be displayed with the code in the web application. Then, we take on the challenge of moving the robot to the selected snack and positioning it in an ideal position to push the snack off the ledge and into the hands of a hungry snack-eating human. The robot will then return to the starting position and wait for another snack request. In the final part of the chapter, we create a user interface and a web application that shows a live video stream from the robot camera and provides a list of available snacks. Select the snack, and watch the robot push it off the edge of the table.

This application can be used as a launching point to create many different types of applications that can be controlled from a mobile device and have the robot seek and fetch different items from its environment. Robots that can drive around and use an arm to interact with their surroundings are quite versatile in their use.

11.1 Hardware stack

11.2 Software stack

11.3 Finding and pushing snacks

11.3.1 Reading the list of snacks

11.3.2 Pushing snacks

11.4 Creating the snack-pushing application

11.4.1 Selecting snacks with the application

11.4.2 Styling the web application

11.4.3 Adding the live video stream to the application

Summary