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
}
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 optimalStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started