Sample solution due date: Tue Feb 14 by 9:00 PM email to: mcb419@gmail.com subject: hw05 email content: url link to your jsbin project and answers to questions
In this assignment you will explore different types of Braitenberg vehicles. The simulation environment has been provided for you. The only thing that you will need to change is the controller code for the different types of Braitenberg vehicles. The main goal of the assignment is to understand how the controller architecture (crossed vs. uncrossed, excitatory vs. inhibitory) and controller parameters (gain and offset) influence the observed behaviors.
(Note: click-and-drag to temporarily add a light that follows the mouse.) |
The bots have two light sensors (this.sns.left, this.sns.right
) and two motors (this.mtr.left, this.mtr.right
).
Sensor activation follows an inverse-square law.
Motor activation corresponds to wheel velocity in pixels per tick.
The general form of your controller code should be:
motor(L/R) = OFFSET + GAIN * sensor(L/R)
where OFFSET and GAIN are constant values.
The OFFSET determines the motor speed with no sensor input (i.e., when the bot is far from all light sources).
The GAIN determines how strongly the sensors influence the motors. Your controller code should not manipulate
any other bot parameters. It should use the sensor values to set the motor values, and nothing more. The base
code will take care of everything else.
(The base code limits the overall bot speed to 5 pixels/tick, and the overall turning rate to 0.1 radians/tick.)
Use the Braitenberg controller formulation specified above to implement and tune the following four controllers
this.mtr.left = 1.0 - 100.0 * this.sns.right
, what would be the speed of the left motor when the right sensor is on the yellow line?