Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) Write 2 Matlab functions to implement the forward and inverse kinematics of the differential drive robot to be used in the labs Use SI
a) Write 2 Matlab functions to implement the forward and inverse kinematics of the differential drive robot to be used in the labs Use SI units Need to have 3 files: one for the forward kinematics, one for the inverse kinematics, and a main.m to test your code Employ the following function prototypes for the vehicle kinematics [vx,w] - fwdKinematics(thr_dot,thl_dot,robot) [thr_dot,thl dot]invKinematics(vx,w,robot) where, vx is the robot velocity in m/s, w is the angular velocity of the robot in rad/s, thr_dot and thl_dot are the angular velocities of the wheels in rad/s robot is a struct with the following fields wheelR wheel radius in [mj halfWidth half the track width in [m]. Note: track width is measured between centers of the wheels. In the main file, test your functions using the following inputs % Test Cases wheel velocities in rad/s % Fwd Motion thr dot-5; thl dot5; [vx,w]FwdKinematics (thr_dot, thl_dot, robot) fprintf (' straight, vx: %fm/ s w: %frad/sin',vx , w); [thr dot,thl dot]-InvKinematics (vx,w, robot) fprintf( ' straight, thr-dot: %frad/s th1-dot: %frad/s ',thr, dot , th-dot); fprintf (; % Turn about left wheel thrdot5 thl_dot - 0; vx, wEwdKinematics (thr_dot, thl_dot, robot); fprintf (' Turn about left wheel, vx : %fm/sw:rad/s ',VX,w); thr_dot,thl_dot] -InvKinematics (vx, w, robot) fprintf( 'straight, thr, dot: %frad/s thL-dot : Afrad/s ',thr, dot , thi, dot); fprintf (-) % Turn about right wheel thr dot-0; thl dot-5; [vx,w] FwdKinematics (thr dot, thl dot, robot) fprintf( 'Turn about right wheel, vx: %fm/s w: %frad/s '.vx , w); thr dot,thl dot] InvKinematics (vx, w, robot); fprintt( 'straight, thrdot : %frad/s th, dot : %frad/s ',thr-dot , thl-dot); fprintf (n %Turn about center point thr dot-5; thl dot5; vx, w]EwdKinematics (thr_dot, thl_dot, robot); fprintf( 'Turn in place, vx : %fm/sw: %frad/sin',vx , w); [thr dot, thl dot] = InvKinematics (vx,v, robot); tprintf( 'straight, thr-dot: %frad/s th1-dot: %frad/s ''thr-dot , thl-dot); fprintf ("---) a) Write 2 Matlab functions to implement the forward and inverse kinematics of the differential drive robot to be used in the labs Use SI units Need to have 3 files: one for the forward kinematics, one for the inverse kinematics, and a main.m to test your code Employ the following function prototypes for the vehicle kinematics [vx,w] - fwdKinematics(thr_dot,thl_dot,robot) [thr_dot,thl dot]invKinematics(vx,w,robot) where, vx is the robot velocity in m/s, w is the angular velocity of the robot in rad/s, thr_dot and thl_dot are the angular velocities of the wheels in rad/s robot is a struct with the following fields wheelR wheel radius in [mj halfWidth half the track width in [m]. Note: track width is measured between centers of the wheels. In the main file, test your functions using the following inputs % Test Cases wheel velocities in rad/s % Fwd Motion thr dot-5; thl dot5; [vx,w]FwdKinematics (thr_dot, thl_dot, robot) fprintf (' straight, vx: %fm/ s w: %frad/sin',vx , w); [thr dot,thl dot]-InvKinematics (vx,w, robot) fprintf( ' straight, thr-dot: %frad/s th1-dot: %frad/s ',thr, dot , th-dot); fprintf (; % Turn about left wheel thrdot5 thl_dot - 0; vx, wEwdKinematics (thr_dot, thl_dot, robot); fprintf (' Turn about left wheel, vx : %fm/sw:rad/s ',VX,w); thr_dot,thl_dot] -InvKinematics (vx, w, robot) fprintf( 'straight, thr, dot: %frad/s thL-dot : Afrad/s ',thr, dot , thi, dot); fprintf (-) % Turn about right wheel thr dot-0; thl dot-5; [vx,w] FwdKinematics (thr dot, thl dot, robot) fprintf( 'Turn about right wheel, vx: %fm/s w: %frad/s '.vx , w); thr dot,thl dot] InvKinematics (vx, w, robot); fprintt( 'straight, thrdot : %frad/s th, dot : %frad/s ',thr-dot , thl-dot); fprintf (n %Turn about center point thr dot-5; thl dot5; vx, w]EwdKinematics (thr_dot, thl_dot, robot); fprintf( 'Turn in place, vx : %fm/sw: %frad/sin',vx , w); [thr dot, thl dot] = InvKinematics (vx,v, robot); tprintf( 'straight, thr-dot: %frad/s th1-dot: %frad/s ''thr-dot , thl-dot); fprintf ("---)
Step 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