Code covered by the BSD License  

Highlights from
NXT-LTD: Line Tracking Dancing Robot Demo

NXT-LTD: Line Tracking Dancing Robot Demo

by

 

23 May 2013 (Updated )

Modeling Logic for Robot Control with Simulink and Stateflow

set_up_project()
function set_up_project()
% Set up the environment for this project. It should be set to
% "Run at Start Up".

% Date   : Jan 17, 2013
% Copyright 2013 The MathWorks, Inc.    

% Use the Simulink Project API to get the current project:
p = slproject.getCurrentProject;

% Get the project root folder:
projectRoot = p.RootFolder;

% Set the location where generated code and other temporary files are
% created (slprj) to be the "work" folder of the current project:
myCacheFolder = fullfile(projectRoot, 'generatedCode');
if ~exist(myCacheFolder, 'dir')
    mkdir(myCacheFolder);
end

% Generate Code into a myCacheFolder
Simulink.fileGenControl('set', 'CacheFolder', myCacheFolder, ...
   'CodeGenFolder', myCacheFolder);


% Set the path for this project:
folders = project_paths();
for jj=1:numel(folders)
    addpath( fullfile(projectRoot, folders{jj}) );
end

% go to work directory
cd(fullfile(projectRoot,'work'));

disp('Opening Model')
% Open the model
open_system('Logic_RobotControl')

%Load the SysID motor identification
evalin('base','load(''motorSysID'')');

%
evalin('base','robotDimensions')

%Load Bus Object
% allBusObjects
evalin('base','load data')



Contact us