Question: WRITE A FUNCTIONAL MATLAB CODE FOR THE FOLLOWING PROJECT. MODEL THE KINEMATICS OF THE ROBOT AND SIMULATE IT BY CODING A FUNCTIONAL MATLAB CODE FOR

WRITE A FUNCTIONAL MATLAB CODE FOR THE FOLLOWING PROJECT. MODEL THE KINEMATICS OF THE ROBOT AND SIMULATE IT BY CODING A FUNCTIONAL MATLAB CODE FOR A UNICYCLE ROBOT.
BASE MATLAB CODE IS :
%% Simulator Skeleton File - Project 1
% This file provides the bare-bones requirements for interacting with the
% Robotarium. Note that this code won't actually run. You'll have to
% insert your own algorithm! If you want to see some working code, check
% out the 'examples' folder.
close all
%% Get Robotarium object used to communicate with the robots/simulator
N =1;
r = Robotarium('NumberOfRobots', N, 'ShowFigure', true);
data =[];
% Select the number of iterations for the experiment.
iterations =3000; % Do not change
% Create a boundary barrier
uni_barrier_certificate = create_uni_barrier_certificate_with_boundary();
% Other important variables
target1=[-0.5; -0.5; 0];
target2=[0.5; -0.5; 0];
target3=[0.5; 0.5; 0];
target4=[-0.5; 0.5; 0];
text(target1(1,1),target1(2,1),'\oplus','FontSize',12,'Color','blue') ;
text(target2(1,1),target2(2,1),'\otimes','FontSize',12,'Color','red');
text(target1(1,:)-.1,target1(2,:)-.2,'Target1')
text(target2(1,:)-.1,target2(2,:)-.2,'Target2')
text(target3(1,1),target3(2,1),'\oplus','FontSize',12,'Color','black') ;
text(target4(1,1),target4(2,1),'\otimes','FontSize',12,'Color','green');
text(target3(1,:)-.1,target3(2,:)+.2,'Target3')
text(target4(1,:)-.1,target4(2,:)+.2,'Target4')
k =1;
%%%%%%%%%%%%%%%%%%%%%%%% Place Static Variables Here %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
% var =0;
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Iterate for the previously specified number of iterations
for t =1:iterations
% Retrieve the most recent poses from the Robotarium. The time delay is
% approximately 0.033 seconds
p = r.get_poses();
%%%%%%%%%%%%%%%%%%%%%%%% Place Algorithm Here %%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
% u =???;
%u =[0; 1];
% You can try with u =[0.1; 0] and [0; 1] first. Observe what happens to
% get a sense of how it works.
% You should think about implementing a finite-state machine. How many
% states are there? What are the transitions? What signals the transition
% from one state to another?
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Send velocities to agents
% Apply the barrier to the valocities
u = uni_barrier_certificate(u, p);
% Set velocities of agents 1,...,N
r.set_velocities(1:N, u); % u is the input, a 2x1 vector for 1 robot
% Send the previously set velocities to the agents. This function must be called!
data =[data [p; u]];
r.step();
end
% Call r.debug() after our experiment is over!
save('data.mat', 'data');
r.debug(); % Do not modify
%%%%%%%%%%%%%%%%%%%%%%%% Place Helper Functions Here %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
% function a = foo(b)
%%%%%%%%%%%%%% Do not modify anything outside this area %%%%%%%%%%%%%%%
 WRITE A FUNCTIONAL MATLAB CODE FOR THE FOLLOWING PROJECT. MODEL THE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!