mirror of
https://github.com/ROB-535-F21-Team-3/Control-Project.git
synced 2025-08-23 19:02:44 +00:00
- Add gitignore for matlab's "asv" files - Provide garbage inputs for qualifying session submission of part 2
41 lines
2.0 KiB
Matlab
41 lines
2.0 KiB
Matlab
function [Utemp, FLAG_terminate] = ROB535_ControlProject_part2_Team3(TestTrack,Xobs_seen,curr_state)
|
|
% [Utemp, FLAG_terminate] = ROB535_ControlProject_part2_Team3(TestTrack,Xobs_seen,curr_state)
|
|
%
|
|
% This script generates control inputs that avoid randomly generated
|
|
% obstacles along the test track
|
|
%
|
|
% INPUTS:
|
|
% TestTrack the structure loaded from TestTrack.mat
|
|
%
|
|
% Xobs_seen the output of the senseObstacles function
|
|
%
|
|
% curr_state taken from the last state in Y, where Y is the actual
|
|
% trajectory updated after forward integrating the
|
|
% vehicle dynamics using control inputs at every planning
|
|
% iteration
|
|
%
|
|
% OUTPUTS:
|
|
% Utemp an N-by-2 vector of control inputs that will be passed
|
|
% to forwardIntegrateControlInput. Utemp must have enough
|
|
% control inputs with time step 0.01 seconds to forward
|
|
% integrate vehicle dynamics for the next 0.5 seconds
|
|
%
|
|
% FLAG_terminate a binary flag set by the function to indicate when to
|
|
% stop the simulation. Setting this flag to 1 at a
|
|
% planning iteration indicates that, after integrating
|
|
% forward vehicle dynamics using the control inputs from
|
|
% Utemp for 0.5 seconds, the vehicle would have reached
|
|
% the goal. If this flag is set to 0, then it imples that
|
|
% the car would not reach the goal after forward
|
|
% integrating for 0.5 seconds. Note that, in the event
|
|
% that FLAG_terminate is never set to 1, the simulation
|
|
% would stop after 20 minutes so that we can process all
|
|
% the teams files in a timely manner.
|
|
%
|
|
% Written by: Sravan Balaji, Xenia Demenchuk, and Peter Pongsachai
|
|
% Created: 30 Nov 2021
|
|
Utemp = NaN(51,2);
|
|
Utemp(:,1) = 0 .* ones(51,1); % delta
|
|
Utemp(:,2) = 5000 .* ones(51,1); % F_x
|
|
FLAG_terminate = rand(1,1) > 0.9;
|
|
end |