Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Write a function with the following prototype function robot- this function should update the robot pose, dt seconds into the future. Assume robot has
1. Write a function with the following prototype function robot- this function should update the robot pose, dt seconds into the future. Assume robot has the following fields: robot.X, (x position) (y position) robot Phi, (heading in rad [pipil) robotvel, (linear velocity in m/s) (angular velocity in rad/s) 2. Write a simple script to test your fwdSim functiorn. 3. Using the following template, implement a controller for the Ackerman steered vehicle so that it can follow the road. a. Use a PD control law b. Add a drift term to the steering angle, what do you observe? c. Improve your control law. clear all close all %% Controller gains % write here your controller gains %% Simulation Pacers. ma 10: %simulation time in seconds desX= 0; % desired Y location (if following road, set to zero) t-0; % initial time d,-0.1 ; % simulation step time obowel 1.0; %velocity in m/s %% Start with a drift of zero - 0*pi/180; % for part 3.b of the activity you will add % a nonzero drift term, simulating % misaligned wheels % Robot Global Pose tobotX 0; % X Global robot position in m robot. Y 3; % Y Global robot position in m % Global orientation in radians, measured with respect to X axis %steering angle %% Define Robot wetlength-3; %[m] Po steering limits in radians robot gammaMas-pi/3; robot gaumasu -pi/3; kk -1; % iteration index %% Implement your simulation here % make sure the applied steering angle is within the allowable limits % you need to angles are always between-pi and pi % in a separate file write a function robot wdSim(roboto); % which upatesthe robot pose (x,y,heading) dt seconds into the future, while (t
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