Question: Program in C++ #include SimpleRSLK.h #define PULSES_PER_W_REVOLUTION 360 #define WHEEL_DIAMETER 7 int right_count = 0; int Left_count = 0; int left_speed = 15; int right_speed

Program in C++

#include "SimpleRSLK.h"

#define PULSES_PER_W_REVOLUTION 360 #define WHEEL_DIAMETER 7

int right_count = 0; int Left_count = 0;

int left_speed = 15; int right_speed = 15;

void setup(){ setupRSLK(); }

void loop(){ resetLeftEncoderCnt(); resetRightEncoderCnt(); setMotorDirection(BOTH_MOTORS, MOTOR_DIR_FORWARD); enableMotor(BOTH_MOTORS); setMotorSpeed(BOTH_MOTORS,right_speed); right_count = getEncoderRightCnt(); Left_count = getEncoderLeftCnt(); while (right_count

if (right_count > Left_count + 3) {

left_speed += 1; right_speed -=1; } else if (right_count + 3

}

Program in C++ #include "SimpleRSLK.h" #define PULSES_PER_W_REVOLUTION 360 #define WHEEL_DIAMETER 7 int

Part I: The main objective of this part is to have your vehicle drive three squares which is 0.5 meters on each side (four straights and four 90 degree CCW turns - 3 times) using only delay function and motors control functions with no encoders. You need to try it and see how good it will be to use only delay functions to do 3 squares, you will need to measure the distance between your start and end point. Videotape your robot traveling the three squares as first part of your lab video. MARK THE STARTING PLACE on your surface (center the robot on that mark), so I can see how well you travel the distance. Part II: The main objective of this part is to have your vehicle drive a single square which is 0.5 meters on each side (four straights and four 90 degree CCW turns). Use encoders. Then, from that position, travel an equilateral triangle with 0.5m sides and three appropriate CCW turns. These two shapes must be seamless - they are not two separate downloads of code. Videotape your robot traveling these two shapes. MARK THE STARTING PLACE on your surface (center the robot on that mark), so I can see how well you travel the distance. You can put a measuring tape to show the distance the robot is traveling. As described in class, you can solve this with increasing amount of points earned: A. Take the provided code, get it to compile and robot to run a square only (minimal points) B. Run a square and triangle, but code does not adjust motor speed to make straight lines and does not measure both encoders C. Run a square and triangle, but code does not adjust motor speed to make straight lines D. Run a square and triangle, and code adjusts motor speed to make straight lines E. Run a square and triangle, and code adjusts motor speed to make straight lines, and code structure is optimal Part I: The main objective of this part is to have your vehicle drive three squares which is 0.5 meters on each side (four straights and four 90 degree CCW turns - 3 times) using only delay function and motors control functions with no encoders. You need to try it and see how good it will be to use only delay functions to do 3 squares, you will need to measure the distance between your start and end point. Videotape your robot traveling the three squares as first part of your lab video. MARK THE STARTING PLACE on your surface (center the robot on that mark), so I can see how well you travel the distance. Part II: The main objective of this part is to have your vehicle drive a single square which is 0.5 meters on each side (four straights and four 90 degree CCW turns). Use encoders. Then, from that position, travel an equilateral triangle with 0.5m sides and three appropriate CCW turns. These two shapes must be seamless - they are not two separate downloads of code. Videotape your robot traveling these two shapes. MARK THE STARTING PLACE on your surface (center the robot on that mark), so I can see how well you travel the distance. You can put a measuring tape to show the distance the robot is traveling. As described in class, you can solve this with increasing amount of points earned: A. Take the provided code, get it to compile and robot to run a square only (minimal points) B. Run a square and triangle, but code does not adjust motor speed to make straight lines and does not measure both encoders C. Run a square and triangle, but code does not adjust motor speed to make straight lines D. Run a square and triangle, and code adjusts motor speed to make straight lines E. Run a square and triangle, and code adjusts motor speed to make straight lines, and code structure is optimal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!