Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A robot has four wheels and Ackerman steering. The front wheels are 0.5m apart, as are the back wheels, and the wheel base is 0.9

A robot has four wheels and Ackerman steering. The front wheels are 0.5m apart, as are the back wheels, and the wheel base is 0.9 m.

Write a function qdot() that returns the derivative of the configuration of the robot. The robot configuration vector, and its derivative, use units of metres and radians. Enforce a maximum steering angle of degrees.

Write a function gotoPoint() that drives the robot from the specified initial configuration to the specified point and stops within 10mm of that point, and plots the path taken by the origin of the robot's coordinate frame. The first point on the plotted path must be the initial configuration, and the last point must be within 10mm of the goal point.

image text in transcribed

11 % this wrapper function allows the assessment code to access your functions 2 function out myFunction (op, varargin) switch op case 'qdot out qdot(varargin{:}); case 'gotoPoint' gotoPoint(varargin:}); end 9 end 10 11 function qnewstep(q, v, gamma) 12 13 14 15 16 17 18 19 28 21 % compute the new robot configuration, given an input configuration and driving for the time period dt with % specified velocity and steering wheel angle % Inputs: % q is the configuration vector (x, y, theta) in units of metres and radians % v is the robot velocity in units of m/s % gamma is the robot steering angle in units of radians % Outputs: % qnew is updated configuration vector (x, y, theta) in units of metres and radians, one time step later =0.1; % time step qd = qdot(q, v, gamma ) ; 23 end 24. 251 % YOUR CODE GOES BELOW HERE 26 27 function qd = qdot (q, v, gamma) 28 29 30 31 32 % Inputs: % q is the configuration vector (x, y, theta) in units of metres and radians % v is the velocity % gamma is the steering wheel angle % Return: % qd is the vector (xdot, ydot, thetadot) in units of metres/s and radians/s 34 end 35 36 function gotoPoint (q, point) 37 38 39 48 % Inputs : % q is the initial configuration vector (x, y, theta) in units of metres and radians % point is the vector (x, y) specifying the goal point of the robot % while not there yet % compute the speed and steering wheel angle % call step() to update the configuration % save the robot's position % plot the robot's path as a single line, from start to end end 47 Code to call your function 2 qd=myFunction(.qdot., q, 1, -1); 4 myFunction('gotoPoint', q, [4 5]); 11 % this wrapper function allows the assessment code to access your functions 2 function out myFunction (op, varargin) switch op case 'qdot out qdot(varargin{:}); case 'gotoPoint' gotoPoint(varargin:}); end 9 end 10 11 function qnewstep(q, v, gamma) 12 13 14 15 16 17 18 19 28 21 % compute the new robot configuration, given an input configuration and driving for the time period dt with % specified velocity and steering wheel angle % Inputs: % q is the configuration vector (x, y, theta) in units of metres and radians % v is the robot velocity in units of m/s % gamma is the robot steering angle in units of radians % Outputs: % qnew is updated configuration vector (x, y, theta) in units of metres and radians, one time step later =0.1; % time step qd = qdot(q, v, gamma ) ; 23 end 24. 251 % YOUR CODE GOES BELOW HERE 26 27 function qd = qdot (q, v, gamma) 28 29 30 31 32 % Inputs: % q is the configuration vector (x, y, theta) in units of metres and radians % v is the velocity % gamma is the steering wheel angle % Return: % qd is the vector (xdot, ydot, thetadot) in units of metres/s and radians/s 34 end 35 36 function gotoPoint (q, point) 37 38 39 48 % Inputs : % q is the initial configuration vector (x, y, theta) in units of metres and radians % point is the vector (x, y) specifying the goal point of the robot % while not there yet % compute the speed and steering wheel angle % call step() to update the configuration % save the robot's position % plot the robot's path as a single line, from start to end end 47 Code to call your function 2 qd=myFunction(.qdot., q, 1, -1); 4 myFunction('gotoPoint', q, [4 5])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions