Skip to content

GradBot Student Assignments

gavinspytek edited this page Mar 3, 2023 · 32 revisions

Lab 1: Project Grad Robotics

Introduction

In this assignment, you will construct a function that will allow you to easily set your robot’s translational and rotational speeds. This function will be a handy function, and we will make use of it throughout future lab assignments.


Recall that the kinematic model of our robot consists of the following equations:

  1. x translational speed in m/s $$V_{x}= \frac{r}{2}(S_{left}+S_{right})$$

  1. yaw rotational speed in radians/s $$V_{yaw}= \frac{r}{L}(S_{left}-S_{right})$$

  1. motor speed in radians per second $$S_{m}= \frac{(Power⋅6.80)}{100}$$

  1. r=0.065 m, L=0.238 m

Procedure

  1. Working as a class, solve the equations so that given a desired Vx and Vyaw, we can compute a corresponding power setting for the motors.

  2. Type in the following skeleton of a function:

function setSpeed(vx, vyaw) {
    const r = 0.065;    //wheel radius
    const l = 0.238;    //axel length
    var sleft;          //left speed
    var sright;         //right speed
    var lpower;         //left power
    var rpower;         //right power
    
    // Compute lpower and rpower
    // YOUR CODE HERE

    left.setPower(lpower);
    right.setPower(rpower);
}
  1. Complete the function by implementing the math that you developed in step 1 in the part that says “YOUR CODE HERE”.

  2. Use your function to perform the following actions:

       a. Have your robot roll forward 1 meter.

       b. Have your robot roll in a circle that is 2 meters in diameter.

       c. Have your robot stop after completing the circle.

  1. Open notepad and create a file on your flash drive called “functions.txt”, copy the setSpeed function into this file so we can use it again later.

  2. Download your robot.txt file from the robot simulator and submit your file on https://tinyurl.com/robotics-turnin. For “assignment” put “Lab 1”. You may also want to save your robot on your flash drive for later.


Lab 2: Turtle Graphics

--

Lab 3: Braitenberg Vehicles

--

Lab 4: Obstacle Avoidance

--

Lab 5: Battle Bots

Clone this wiki locally