Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO THIS CODE USING RASPEBBERY PI AND PYTHON. CODE IN PYTHON AND RUN IN RASPBERRY PI, if i said it right. HERE'S THE LINK

PLEASE DO THIS CODE USING RASPEBBERY PI AND PYTHON. CODE IN PYTHON AND RUN IN RASPBERRY PI, if i said it right.

HERE'S THE LINK TO A SIMILAR CODE https://github.com/USC-ACTLab/pyCreate2/blob/master/pyCreate2/robot/create2_driver.py

PLEASE DO IT AS USING PYHTON AND SIMPLE AS YOU CAN MAKE.

The purpose of this assignment is to make sure you can write and execute programs for our iRobot Create 2 robots.

Instructions Please read carefully the following tasks and program the robot accordingly.

The instructions on how to use the robot and how to submit the project assignment is on the webpage, at the following links

https://sites.google.com/site/albertoquattrinili/home/teaching/csce274_2017/notes_create.pdf

ROBOT INTERFACE IS http://www.irobotweb.com/~/media/MainSite/PDFs/About/STEM/Create/iRobot_Roomba_600_Open_ Interface_Spec.pdf?la=en

Task 1. Write an interface1 for the serial communication, that includes:

a. Connection to the serial interface.

b. Sending of commands.

c. Reading of data.

d. Close the connection.

Task 2. Using the interface in Task 1, write an interface for the robot that:

a. Control the state of the robot (Start, Reset, Stop, Passive, Safe).

b. Read the state of the buttons.

c. Send a Drive command to set the velocity and the radius of the wheels, given the two as arguments.

Task 3. Write a program that utilizes the previous interfaces and:

a. Initializes the robot, by setting it in passive and safe mode.

b. If the robot is stopped, once the clean/power button is pressed, move counterclockwise along a regular pentagon with 30 cm sides. The robot stops once the pentagon is covered.

c. If the robot is moving, when the clean/power button is pressed, stop the robot when it reaches the current goal vertex.

d. Note that the program should continue listening for button presses, both in b. and c. cases, until the program is terminated. 1 Interface here refers to the general concept of Application Programming Interface (API), which is a set of programming instructions (that can be in classes or methods) that can be used to build your own application i.e., that in Task 3. An example in Python that uses classes can be found in https://python.swaroopch.com/oop.html.

Evaluation The solution will be evaluated according to the following.

Task 1 functionality (15):

Connection to serial interface.

Proper sending of commands (with correct encoding).

Proper reading of data, returning raw data.

Close the connection.

Task 2 functionality (15):

Control the state of the robot.

Proper reading of the state of each button.

Proper sending of Drive commands.

Task 3 functionality (30):

Proper initialization of the robot.

Accurate regular pentagon shape.

Proper reading of the button state even when the robot is moving.

Style (20): No duplication of executable code?

No magic numbers?

Names match functionality?

Adequate comments?

Comments match code?

Consistent formatting?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions