Code covered by the BSD License  

Highlights from
NXT SCARA (Two-Link Planar Robot Arm) Controller Design

image thumbnail

NXT SCARA (Two-Link Planar Robot Arm) Controller Design

by

 

17 Nov 2008 (Updated )

NXT SCARA Model-Based Design based on Embedded Coder Robot NXT.

post_sdo_codegen.m
% Post-Processing of Code Generation with Simulink Data Object
% Recover the variables and signal resolutions to pre-code generation.

% clear signal objects
cmd = 'clear';
for n = 1:num_sig
	cmd = [cmd, ' ', sig.name{n}];
end
eval(cmd)

% reset signal resolution
for n = 1:length(sig.handle.Signals)
	set_param(sig.handle.Signals(n), 'MustResolveToSignalObject', 'off')
end
for n = 1:length(sig.handle.States)
	set_param(sig.handle.States(n), 'StateMustResolveToSignalObject', 'off')
end

% clear parameter objects
cmd = 'clear';
for n = 1:num_param
	cmd = [cmd, ' ', param.name{n}];	
end
eval(cmd)

% make parameter data
cmd = [];
for n = 1:num_param
	cmd = [cmd, param.name{n}, ' = param.value{', num2str(n), '};'];
end
eval(cmd)

clear n cmd sig param num_sig num_param

Contact us