Question: Implement the 5 functions in the header file MyServos.h: 1) void setSpeeds(int microsLeft, int microsRight) 2)void calibrateSpeeds() 3)void setSpeedsRPS (float rpsLeft, float rpsRight) 4)void setSpeedsIPS(float
Implement the 5 functions in the header file MyServos.h:
1) void setSpeeds(int microsLeft, int microsRight)
2)void calibrateSpeeds()
3)void setSpeedsRPS (float rpsLeft, float rpsRight)
4)void setSpeedsIPS(float ipsLeft, float ipsRight)
5)void setSpeedsvw(float v, float w)
The first function should set the speed of the motors by giving the speeds in microseconds. You should write the code so that microsLeft and microsRight control the left and right speeds of the wheels respectively. Also, you should implement the function so that if bothvalues are positive the robot will mov e forward, if both are negative it will move backwards, and if both are 0, it should not move.
The second function should use the encoder functions implemented on section B .1.2 to create a mapping from the servos input(micro seconds)to the servos output (wheel speed in revolutions per second). In other words, measure the speeds of the wheels for different input values and store the results. You should do this for both wheels since the servos output wont necessarily be the same for both wheels. This information will be used by the following functions.
The third function should set the speed of the motors as in the first function, but this time, theinput parameters indicate the speeds at which each wheel should spin.
The fourth function is the same as theprevious one, but this time, the speed is given in inches per second.
The fifth function should set the speed of the robot, so that the robot will move with a linear speed given by the parameter v (in inches per second), and with an angular velocity w(given in radians per second). Positive angular velocities should make the robot spin counterclockwise.
Aspects to consider:
The wheels diameter is 2.61''.
The wheels are separated by 3.95'' approximately, although this may vary from robot to robot since some may be bent.
FOR ARDUINO SOFTWARE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
